In Form Builder I have a form that includes an Explanatory Text field. The text includes a link. I want the URL for that link to be different in each environment. For my HTTP Services in forms I am using a property that I have defined as described in this blog post.
Is it possible to use a property to configure the URL in the Explanatory Text?
Once RFE 2427 is implemented, you'll have a real solution to your problem. Right now, the text shown by fr:explanation
is entirely static.
You could work around this though, by creating your own custom model logic that, on form load, replaces a certain string from the text by the value of the property you defined:
SITEURL
. xxf:readonly="true"
on the fr-form-resources
instance. This is the resulting form.properties-local.xml
add a custom model logic: <property as="xs:anyURI" name="oxf.fr.detail.model.custom.*.*" value="oxf:/forms/resources/model.xml"/>
.properties-local.xml
, define the value of the placeholder with a property: <property as="xs:string" name="com.example.siteurl" value="http://www.orbeon.com/"/>
.model.xml
, on form load, replace SITEURL
by the value of the property.And here is the content of the model.xml
:
<xf:model xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms">
<xf:action event="xforms-model-construct-done">
<xf:action iterate="instance('fr-form-resources')/resource/text-with-link/text">
<xf:setvalue ref="."
value="
replace(
.,
'SITEURL',
xxf:property('com.example.siteurl')
)"/>
</xf:action>
</xf:action>
</xf:model>