Login  Register

RE: RE: Using xxforms:invalid-binds() with <xxforms:message> on submit error

Posted by Philip.Cantin on Dec 21, 2009; 6:33pm
URL: https://discuss.orbeon.com/Using-xxforms-invalid-binds-with-xxforms-message-on-submit-error-tp974421p976439.html

Stephanie,

Now I'm curious: is this an error message you're getting? If so, what exactly does it look like? And what is your current Orbeon setup? (Tomcat or Liferay, current build being used, etc.)


---Philip

Stephanie Hall (TT) wrote
Hi Philip,

Thanks for your help, but I keep getting "Invalid Submit" whenever I try to access the standardxform2.xhtml file you mentioned...

Thanks,
Stephanie

-----Original Message-----
From: Philip.Cantin [mailto:pjcantin@gmail.com]
Sent: Monday, December 21, 2009 11:32 AM
To: ops-users@ow2.org
Subject: [ops-users] RE: Using xxforms:invalid-binds() with <xxforms:message> on submit error


Stephanie,

From what I'm seeing, xxforms:binding doesn't seem to be working properly.
I've attached a minimal example that runs in the XForms Sandbox, if anyone wants to reproduce this issue. To reproduce:

1) Download standardxform2.xhtml in the XForms Sandbox. Click the Submit button once, and the message 'Required' should appear.
2) Type in 120 into the input field, and click the Submit button again. The message 'Not in range' should appear.
3) Repeat steps 1 and 2, but this time, change:

<xf:message if="xxforms:invalid-binds(instance('views')/range) and instance('views')/range = ''">Required</xf:message>

to:

<xf:message if="xxforms:invalid-binds(event('xxforms:binding')) = 'my-bind'">Required</xf:message>


and

<xf:message if="xxforms:invalid-binds(instance('views')/range) and
number(instance('views')/range) &gt;= 100">Not in range</xf:message>

to:

<xf:message if="xxforms:invalid-binds(event('xxforms:binding')) = 'my-bind2'">Not in range</xf:message>


No messages should appear with this change.



Meanwhile, Stephanie, as a workaround, you could do what I did in standardxform2.xhtml and have your if statement within <xforms:message> include an 'xxforms:invalid-binds' statement that points directly to the node with the binding, and add the condition that was used in the binding.....instead of using an extension function.


Hope this helps,

Philip


http://n4.nabble.com/file/n976377/standardxform2.xhtml standardxform2.xhtml


Stephanie Hall (TT) wrote:
>
> Could someone please help me with this?  
>
>  
>
> From: Stephanie Hall (TT)
> [mailto:Stephanie.Hall@tradingtechnologies.com]
> Sent: Thursday, December 17, 2009 4:05 PM
> To: ops-users@ow2.org
> Subject: [ops-users] Using xxforms:invalid-binds() with
> <xxforms:message> on submit error
>
>  
>
> Hi all,
>
>  
>
> I’m trying to figure out a way to tell my users exactly why their
> submissions are failing when I encounter  the xforms-submit-error event.
>
>  
>
> So far I have:
>
>  
>
> <xforms:submission>
>
>                 <xforms:action ev:event=”xforms-submit-error”>
>
>                                 <xxforms:message
> if=”xxforms:invalid-binds(event(‘’xxforms:binding’)) = ‘myBindId’”
> level=”modal”>Submission failed because…</xxforms:message>
>
>                                 <xxforms:message
> if=”xxforms:invalid-binds(event(‘’xxforms:binding’)) = ‘myBindId2’”
> level=”modal”>Submission failed because…</xxforms:message>
>
>                 </xforms:action>
>
> </xforms:submission>
>
>  
>
> And if there is an error then I do see a message, but I see messages
> for the binds that are valid when I shouldn’t.  Can someone please
> point out what I am doing wrong?  I tried following the examples in
> the documentation, but it doesn’t seem to work.
>
>  
>
> Thanks,
>
> Stephanie
>
>  
>
>                
>
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org
> mailing list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>

--
View this message in context: http://n4.nabble.com/Using-xxforms-invalid-binds-with-xxforms-message-on-submit-error-tp974421p976377.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.


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