Open ebruchez opened 10 years ago
Accessing the forms current XML model via JS would be handy
@elson This can't be enabled by default for security reasons, so we would need a per-form configuration to enable this API.
Another useful event would be a value-check
event, similar to xforms-value-changed
but that would also fire when the value hasn't changed (e.g. when you blur a text input without changing the value). We're now listening to the blur
DOM event but that fires before Orbeon has updated its data model.
@dhinus What would that event do? The server already receives a DOMFocusOut
event in such cases, which cause the field to be marked as visited (except in the case of #619).
@ebruchez I didn't know of DOMFocusOut
, that might be enough.
The use case I have in mind is similar to the one in https://github.com/orbeon/orbeon-forms/issues/586, we have custom input fields where you can insert an external ID and we want to trigger an AJAX call whenever the input loses focus, even if the value hasn't changed.
@dhinus Ok you'll let us know if DOMFocusOut
is not enough.
For now we are planning to avoid exposing the XML to the client.
We have a first API in Orbeon Forms 2017.2 with #2634.
Is there a way for us to expose this as require('orbeon/form-runner.js')
or something like this?
Including:
1559: API to change the Form Runner language from JavaScript
2383: Switch to a wizard tab (if permitted)