Problem with ref on buttons on fr-mode=view

33 views
Skip to first unread message

bsdang

unread,
Nov 17, 2015, 12:11:05 PM11/17/15
to orb...@googlegroups.com
Hi All,

We have a form built from form-builder, on which we want to show buttons
based on a condition in fr-mode view.

But this does not work in "view-mode", as soon as we put the ref=.[XPATH]
the button is not displayed at all even though the XPath is true()

<xh:body>
<fr:view>
<fr:body>
<fr:buttons>
<fr:pdf-button/>
<fr:apply-button ref=".[true()]"/>
</fr:buttons>
</fr:view>
</xh:body>


The apply button is not rendered at all in view mode, if we render the same
form in "edit" mode the button works fine i.e. based on the ref Xpath
condition being true or false.


Any pointers on how to fix this would be really helpful ?

Thanks,
Balvinder





--
View this message in context: http://discuss.orbeon.com/Problem-with-ref-on-buttons-on-fr-mode-view-tp4660784.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

Alessandro Vernet

unread,
Nov 17, 2015, 7:18:03 PM11/17/15
to orb...@googlegroups.com
Hi Balvinder,

What is this <fr:apply-button>? This is a custom XBL component of yours?
Does it handle the ref properly?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
View this message in context: http://discuss.orbeon.com/Problem-with-ref-on-buttons-on-fr-mode-view-tp4660784p4660787.html

bsdang

unread,
Nov 18, 2015, 5:41:42 AM11/18/15
to orb...@googlegroups.com
Hi Alex,

We have a custom process "apply", which is associated to apply button, this
has been implemented as per the
http://doc.orbeon.com/form-runner/advanced/buttons-and-processes/index.html
<http://doc.orbeon.com/form-runner/advanced/buttons-and-processes/index.html>

I want to show this button in "fr-view mode" only, so I added property
<property as="xs:string" name="oxf.fr.detail.buttons.view.erdf.add-call"
value="pdf apply"/>

But I also want to show/hide this button based on a condition. To add the
condition we added the fr:buttons in the form.xhtml
<fr:buttons>
<fr:pdf-button/>
<fr:apply-button ref=“.[xpath condition]"/>
</fr:buttons>

But once I add the ref attribute, the button does not render in “fr-view”
mode at all.

If I remove the ref from the button then it works in “fr-view” mode
<fr:buttons>
<fr:pdf-button/>
<fr:apply-button/>
</fr:buttons>

but problem is then I cannot show/hide the button conditionally.



--
View this message in context: http://discuss.orbeon.com/Problem-with-ref-on-buttons-on-fr-mode-view-tp4660784p4660790.html

Alessandro Vernet

unread,
Nov 18, 2015, 8:52:54 PM11/18/15
to orb...@googlegroups.com
Hi Balvinder,

Thank you for the precisions. I was also wondering if this is an XBL
component that you created, and if it properly handles the `ref` attribute.
I.e. if you were to use it on a page and write ref="()", would the button be
hidden?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
View this message in context: http://discuss.orbeon.com/Problem-with-ref-on-buttons-on-fr-mode-view-tp4660784p4660796.html
Reply all
Reply to author
Forward
0 new messages