Orbeon Form Builder - hyperlink with dynamic url?

不问归期 提交于 2019-12-02 08:58:23

问题


In Orbeon 4.4 Form Builder, I'd like to be able to add a hyperlink control to a form, where the target URL is constructed partially from values available in other form fields. In addition, I would like to be able to control the visibility of the hyperlink the same way as other FB controls (i.e. via the "relevent" attribute). What would be the best approach?

Tried using the existing "link button" control, & adding this within the appropriate corresponding <xf:trigger> tag in the source:

<xf:action ev:event="DOMActivate">
    <xf:load show="new" resource="http://staticurl.com"/>
</xf:action>

This works with a static url as the resource attribute (as in the example), but I can't get it to reference a value in another field.

I was able to use an AVT in the href attribute of an <a> tag, like so:

<xh:a target="_blank" href="{url-field}">LINK</xh:a> 

(In this case "url-field" was a field that constructed the URL via calculate=). However, even though this works, the <a> tag doesn't work in the FB editor like a standard FB control does, plus I don't know how well FB will deal with it as I make other changes to the form.


回答1:


You can use attribute value templates in xf:load/@resource attributes like you've done in the simple link:

<xf:action ev:event="DOMActivate">
    <xf:load show="new" resource="{xxf:bind('url-field-bind')}"/>
</xf:action>


来源:https://stackoverflow.com/questions/21102328/orbeon-form-builder-hyperlink-with-dynamic-url

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!