Problem with ref on buttons on fr-mode=view

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

Problem with ref on buttons on fr-mode=view

bsdang
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



Reply | Threaded
Open this post in threaded view
|

Re: Problem with ref on buttons on fr-mode=view

Alessandro  Vernet
Administrator
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
Reply | Threaded
Open this post in threaded view
|

Re: Problem with ref on buttons on fr-mode=view

bsdang
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

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.

Reply | Threaded
Open this post in threaded view
|

Re: Problem with ref on buttons on fr-mode=view

Alessandro  Vernet
Administrator
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