conditional action on submission response

Posted by Ron Peterson on
URL: https://discuss.orbeon.com/conditional-action-on-submission-response-tp3003751.html

Hi,

I'm trying to conditionally respond to a submission response according
to the value of one of the response instance's element values.  This is
what I have now, but the second action is the only one that ever fires.
(I'm 99% certain that I am in fact sometimes returning a non-empty
elementValue - I'm going to trace that to be sure later today..)

      <xforms:action ev:event="xforms-submit-done"
                     observer="mysubmission"
                     if="string-length(instance('submission-response')//elementValue) > 0">
        <xforms:message level="modal" ev:event="DOMActivate">Non-Empty String</xforms:message>
        <xforms:toggle case="case-non-empty" />
      </xforms:action>

      <xforms:action ev:event="xforms-submit-done"
                     observer="mysubmission"
                     if="string-length(instance('submission-response')//elementValue) = 0">
        <xforms:message level="modal" ev:event="DOMActivate">Empty String</xforms:message>
        <xforms:toggle case="case-empty" ev:event="DOMActivate" />
      </xforms:action>

So I guess I'm wondering why this doesn't work.  I'm also curious how
other folks would do this.  Is there a common pattern for doing an
'else' action, or is the pattern to simply create two mutually exclusive
'if' actions?

TIA

-Ron-


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws