Jos Vos wrote:

What is the proper way to "escape" from a page (going to another page)
without being caught by XForms validation?

For example, I have a page with a left menu with a search button,
like:

  <xf:submit xxf:appearance="link">
    <xf:label>Search</xf:label>
    <xf:setvalue ref="/form/action">search</xf:setvalue>
  </xf:submit>

When I click on this, I want to jump to the search page, and no XForms
validation of the current form should be done.

I though I found the answer by including in my forms a bind like:

  <xf:bind nodeset="/form/username"
           required="/form/show-errors = 'true'"/>

and by adding the following to my search button:

  <xf:setvalue ref="/form/show-errors">false</xf:setvalue>

Unfortunately, this doesn't work (when is the bind evaluated?).
But, surprisingly, if I make the bind condition something like:

  <xf:bind nodeset="/form/username"
           required="/form/action != 'search'"/>

it does work and I can jump to the search page from an invalid
form!  I do not understand this, as I change the values of
/form/action and /form/show-errors at the same place (in the
submit of the search).

This may be a bug.

But actions and action results actually do not care about whether the form is valid or not. So you can just test on the "search" action and go to your search page, even if the current form is being validated and is actually invalid.

-Erik



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
orbeon-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to