Orbeon 表单生成器 - 带有动态 url 的超链接? [英] Orbeon Form Builder - hyperlink with dynamic url?

查看:53
本文介绍了Orbeon 表单生成器 - 带有动态 url 的超链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Orbeon 4.4 表单生成器中,我希望能够向表单添加超链接控件,其中目标 URL 部分由其他表单字段中的可用值构成.此外,我希望能够以与其他 FB 控件相同的方式(即通过相关"属性)控制超链接的可见性.最好的方法是什么?

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?

尝试使用现有的链接按钮"控件,&在源代码中相应的 <xf:trigger> 标记中添加它:

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>

这适用于静态 url 作为资源属性(如示例中所示),但我无法让它引用另一个字段中的值.

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.

我能够在 <a> 标签的 href 属性中使用 AVT,如下所示:

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> 

(在这种情况下,url-field"是一个通过 calculate= 构建 URL 的字段).然而,即使这有效,<a> 标签在 FB 编辑器中并不像标准 FB 控件那样工作,而且我不知道 FB 会如何处理它,因为我对表单进行其他更改.

(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.

推荐答案

您可以在 xf:load/@resource 属性中使用属性值模板,就像您在简单链接中所做的那样:

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>

这篇关于Orbeon 表单生成器 - 带有动态 url 的超链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆