Form Runner Button Visibility

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Form Runner Button Visibility

kiskandar
Hi All,

We would like to toggle the visibility of certain form runner buttons
depending on a specific status of our application. At the moment we are
thinking about having an additional properties file which is included as
part of properties-local.xml which will contain the information on the
status of our application as follows:

*configurable-properties.xml*
<property as="xs:string" name="im.application.readonly" value="true" />

*properties-local.xml*
<property as="xs:string" name="oxf.fr.detail.button.edit.visible.*.*">
    not(xxf:property('im.application.readonly')="true")
</property>

<xi:include href="oxf:/config/configurable-properties.xml" />

The idea for now is to have our application modify the value of the
im.application.readonly property inside configurable-properties.xml file
whenever there's a change in the status of our application. We are wondering
if there's maybe another way to achieve this without our application having
to modify the configurable-properties.xml file on the filesystem every time
the status of our application changes ?

Kind regards
Kris


--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Form Runner Button Visibility

Alessandro  Vernet
Administrator
Hi Kris,

Having your app dynamically change a file on disk indeed looks like a recipe
for problems. I'm not sure what logic you would need to have to decide
whether to show or hide that button, but if you can write that logic in
Java, you could place that code in a servlet filter that sets a header, that
you can then read from the XPath in your
`oxf.fr.detail.button.edit.visible.*.*` property, like:
`xxf:get-request-header('Im-Application-Readonly') = 'true'`.

This technique is very flexible, as it allows you to have any code you want,
and the decision on whether to show the button can even depend on who the
current user is, or other factors. Would something along these line work for
you?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet