orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
514 stars 221 forks source link

`oxf.fr.detail.button.$button.visible` doesn't support `fr:control-string-value()` #6542

Closed ebruchez closed 1 week ago

ebruchez commented 1 week ago

This started happening since we introduced fr:buttons-bar. The evaluation context of the visibility expressions is now inside an XBL component. We use xxf:evaluate() for those.

Considering a way to tell to evaluate the expression in a given XForms context:

We only document a single parameter to xxf:evaluate(), although on the JVM we just delegate to saxon:evaluate() which can take more parameters. On JS, we only implement one parameter, the XPath expression as string.

+1 from customer

ebruchez commented 1 week ago
ebruchez commented 1 week ago

For the $control notation, the expression must be processed through replaceVarReferencesWithFunctionCallsFromString(). It is desirable not to do this at each evaluation of a button's visibility, which means this should be cached.

An obvious place to do this is in the properties, as we cache a result associated with that.

ebruchez commented 1 week ago

Cool, @avernet just added replaceVarReferencesWithFunctionCallsFromProperty() :)

ebruchez commented 1 week ago