Form buttons add/remove at runtime

5 views
Skip to first unread message

r.gadkari

unread,
May 23, 2019, 4:42:28 AM5/23/19
to orb...@googlegroups.com
To add buttons for form, config given on the site is like this

for e.g. <property as="xs:string"
name="oxf.fr.detail.buttons.yforms.contact">pdf save-final</property>

This needs to be placed in the local properties xml file. While this works
but we need the ability to change the buttons at runtime.

We have a requirement where the business user wants the ability to set which
buttons (Save-final and/or pdf) are available for which form.
The config file - local properties xml is part of the deployment and
business user cannot edit that file at runtime.

Can you please advise how it can be achieved?

Thanks
Rohan

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

Jarosław Kowalewski

unread,
May 23, 2019, 5:06:00 AM5/23/19
to orb...@googlegroups.com
Hi Rohan,
you could define the visibility of the buttons in the properties.xml based on the value in the form.

<property as="xs:string"  name="oxf.fr.detail.button.save-final.visible.*.*">
if(exists(//show-save-final-button) and //show-save-final-button = 'false') then false() else true()
</property>

where show-save-final-button is a control name in your form. Note that with such a solution you need to add special fields to each form. 

Another approach can be to use request parameters but I've never tried it so not sure if it's supported by Orbeon.
<property as="xs:string"  name="oxf.fr.detail.button.save-final.visible.*.*">
if(xxf:get-request-parameter('show-button')) then false() else true()
</property>


BR,
Jarek

--
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 orbeon+un...@googlegroups.com.
To post to this group, send email to orb...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1558600947492-0.post%40n4.nabble.com.

r.gadkari

unread,
May 23, 2019, 6:31:17 AM5/23/19
to orb...@googlegroups.com
Thanks Jarek,

This has helped to resolve the issue.
Reply all
Reply to author
Forward
0 new messages