Hello,
Something I don't understand: in Form Builder, there's a Link Button control, you can enter an URL in it, but once you render it in Form Runner, the link is not clickable... Can anyone one tell me what it's all about? Thanks in advance. |
Administrator
|
In reply to this post by marek2608
Actually, you don't enter a URL in the button, but a label. The label
appears as the text of the link. The link only works as a button, that is it doesn't take you to another page, but it allows you to start an action. It would be nice to have a link control, but this is not part of the toolbox as of 3.9. -Erik On Mon, Dec 12, 2011 at 2:10 PM, marek2608 <[hidden email]> wrote: > Hello, > Something I don't understand: > in Form Builder, there's a Link Button control, you can enter an URL in it, > but once you render it in Form Runner, the link is not clickable... > > Can anyone one tell me what it's all about? > > Thanks in advance. > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Link-Button-tp4187841p4187841.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
How would I do to create a "hyperlink" control?
|
To be more specific, I would like to build this control in such manner that it is accessible from the form builder controls menu. So form builder users can added without having to edit the form's source code.
Thanks again |
I was able to add a hyperlink control to the toolbox by adding the folloing code into other-controls.xbl:
<xbl:binding id="fb-hyperlink" element="fr|hyperlink"> <metadata xmlns="http://orbeon.org/oxf/xml/form-builder"> <display-name lang="en">Hyperlink</display-name> <display-name lang="fr">Hyperlien</display-name> <icon lang="en"> <small-icon>/apps/fr/style/images/silk/link.png</small-icon> <large-icon>/apps/fr/style/images/silk/link.png</large-icon> </icon> <template> <xforms:trigger xmlns="" appearance="minimal" id=""> <xforms:label ref=""/> <xforms:help ref=""/> <xforms:hint ref=""/> <xforms:alert ref="$fr-resources/detail/labels/alert"/> <xforms:action ev:event="DOMActivate"> <xforms:load ref="../label/@ref" show="new"/> </xforms:action> </xforms:trigger> </template> </metadata> </xbl:binding> I have 2 questions: 1. Is that a good place to add this? 2. The expression: <xforms:load ref="../label/@ref" show="new"/> Does not seem to work, there's something wrong with my xpath expression. I would like to use the label ref (which would be an URL) to open in a new window. It does work if I use a hard coded URL or the $form-resource/control-name/label ref but this is not a usable senario since this has to be dynamic based on the control name that will be provided by user. Thanks again! |
Administrator
|
In reply to this post by marek2608
> I have 2 questions:
> 1. Is that a good place to add this? It is ok, but it might be better to add that to your own .xbl file. You can then modify the Form Builder property that includes controls in the toolbox to add that file, for example: <property as="xs:string" name="oxf.fb.toolbox.group.custom.uri.*.*" value="oxf:/path/to/my/controls.xbl"/> where "custom" is a unique identifier you can choose to identify your new group of controls. > 2. The expression: <xforms:load ref="../label/@ref" show="new"/> > Does not seem to work, there's something wrong with my xpath expression. I > would like to use the label ref (which would be an URL) to open in a new > window. > It does work if I use a hard coded URL or the > $form-resource/control-name/label ref but this is not a usable senario since > this has to be dynamic based on the control name that will be provided by > user. That's a tough one. In the nightly builds, there is a function called xxforms:effective-id() which returns the full id of the closest enclosing control. But I don't think this was available in 3.9. If that was the case, you could write: <xforms:load resource="{$form-resource/*[name() = xxforms:effective-id()]/label}" show="new"/> Also in current builds, there is an xxforms:label() function to retrieve the label of a control by id. This would allow writing: <xforms:load resource="{xxforms:label(xxforms:effective-id())}" show="new"/> -Erik > > Thanks again! > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Link-Button-tp4187841p4192436.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Thanks for the info, as it is in 3.9, is it possible to query the bind element associated with the control and find the mapped control name?
This way I could find the corresponding label. Thanks again. |
Administrator
|
This should work:
https://gist.github.com/1504902 -Erik On Fri, Dec 16, 2011 at 11:28 AM, marek2608 <[hidden email]> wrote: > Thanks for the info, as it is in 3.9, is it possible to query the bind > element associated with the control and find the mapped control name? > > This way I could find the corresponding label. > > Thanks again. > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Link-Button-tp4187841p4205918.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |