Thread: [Xsltforms-support] Problem with preventing submission
Brought to you by:
alain-couthures
From: Aleksandar S. <ale...@pr...> - 2010-02-09 15:13:47
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"> </head> <body bgcolor="#ffffff" text="#000000"> <font face="Calibri">Hi,<br> <br> I have a problem to prevent submission when form is not valid. Here is my test case:<br> <br> <small><font face="Courier New, Courier, monospace"><?xml version="1.0" encoding="utf-8"?><br> <?xml-stylesheet type="text/xsl" href="xsltforms/xsltforms.xsl"?><br> <html xmlns:xforms=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2002/xforms">"http://www.w3.org/2002/xforms"</a> xmlns:ev=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/xml-events">"http://www.w3.org/2001/xml-events"</a> xmlns:an=<a class="moz-txt-link-rfc2396E" href="http://www.together.at/2006/ANOTHER">"http://www.together.at/2006/ANOTHER"</a> xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/xhtml">"http://www.w3.org/1999/xhtml"</a> xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a> xmlns:xpdl=<a class="moz-txt-link-rfc2396E" href="http://www.wfmc.org/2002/XPDL1.0">"http://www.wfmc.org/2002/XPDL1.0"</a> xmlns:xsd=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a> xmlns:xpil=<a class="moz-txt-link-rfc2396E" href="http://www.together.at/2006/XPIL1.0">"http://www.together.at/2006/XPIL1.0"</a>><br> <head><br> <title>Contact</title><br> <xforms:model><br> <br> <xforms:submission id="s01" method="post" show="new" replace="all" action="whatever.xml"><br> <xforms:message level="modeless" ev:event="xforms-submit-error">Submit error.</xforms:message><br> </xforms:submission><br> <br> <xforms:instance id="firstInstance"><br> <xpil:ExtendedWorkflowFacilityInstance><br> <xpil:StringDataInstance Id="firstname" Value="VALUE">INSIDE</xpil:StringDataInstance><br> </xpil:ExtendedWorkflowFacilityInstance><br> </xforms:instance><br> <br> <!--THIS DOESN'T WORK GOOD--><br> <xforms:bind id="firstname" required="true()" nodeset="instance('firstInstance')/xpil:StringDataInstance/@Value" constraint="string-length(.) &gt; 0" type="xsd:string" /><br> <br> <!--THIS WORKS--><br> <!--<xforms:bind id="firstname" required="true()" nodeset="instance('firstInstance')/xpil:StringDataInstance" constraint="string-length(.) &gt; 0" type="xsd:string" />--><br> <br> </xforms:model><br> </head><br> <body><br> <h2>Contact</h2><br> <xforms:group appearance="minimal"><br> <br> <xforms:input bind="firstname"><br> <xforms:label>Name</xforms:label><br> </xforms:input><br> <br> </xforms:group><br> <br> <xforms:submit submission="s01"><br> <xforms:label>View</xforms:label><br> </xforms:submit><br> </body><br> </html><br> </font></small><br> When I change value in input element validation is properly performed but I'm able to submit non-valid form.<br> I discovered that I CAN'T submit non-valid form when <small><font face="Courier New, Courier, monospace">nodeset </font></small>in <small><font face="Courier New, Courier, monospace">bind </font></small>element is "</font><font face="Calibri"><small><font face="Courier New, Courier, monospace">instance('firstInstance')/xpil:StringDataInstance</font></small></font><font face="Calibri">"</font><font face="Calibri"> but I CAN submit non-valid form when <small><font face="Courier New, Courier, monospace">nodset</font> </small>is "</font><font face="Calibri"><small><font face="Courier New, Courier, monospace">instance('firstInstance')/xpil:StringDataInstance/@Value</font></small></font><font face="Calibri">".<br> <br> Is this bug or I'm missing something?<br> <br> Regards</font><br> <b><span style="font-size: 9pt; font-family: "Tahoma","sans-serif"; letter-spacing: 0.3pt;" lang="SR"></span></b><span style="font-size: 8pt; font-family: "Tahoma","sans-serif"; letter-spacing: 0.3pt;" lang="SR"><o:p></o:p></span><o:p><br> </o:p> <div class="moz-signature"> <div class="Section1"></div> </div> </body> </html> |
From: COUTHURES A. <ala...@ag...> - 2010-02-09 20:39:48
|
Hi Aleksandar, > When I change value in input element validation is properly performed > but I'm able to submit non-valid form. > I discovered that I CAN'T submit non-valid form when nodeset in bind > element is "instance('firstInstance')/xpil:StringDataInstance" but I > CAN submit non-valid form when nodset is > "instance('firstInstance')/xpil:StringDataInstance/@Value". > > Is this bug or I'm missing something? Well... Because attributes validation status was not tested before submission, submission was allowed for non valid attributes. The corresponding instructions have been added in the SVN version. BTW, I reconsidered the logical test to determine whether a value is valid or not... Are you experimenting XForms for workflow management ? Do you think this could result in an online demo about that ? Thanks! -Alain |
From: Aleksandar S. <ale...@pr...> - 2010-02-10 09:28:04
|
Hi Alain, I've just checked out SVN version and it works. Great! I'm implementing XSLTForms in Shark project (yes, it is workflow management server) as alternative to Chiba. I have another issue but I will write another mail for that... Thanks! On 9.2.2010 21:40, COUTHURES Alain wrote: > Hi Aleksandar, >> When I change value in input element validation is properly performed >> but I'm able to submit non-valid form. >> I discovered that I CAN'T submit non-valid form when nodeset in bind >> element is "instance('firstInstance')/xpil:StringDataInstance" but I >> CAN submit non-valid form when nodset is >> "instance('firstInstance')/xpil:StringDataInstance/@Value". >> >> Is this bug or I'm missing something? > Well... Because attributes validation status was not tested before > submission, submission was allowed for non valid attributes. > > The corresponding instructions have been added in the SVN version. > > BTW, I reconsidered the logical test to determine whether a value is > valid or not... > > Are you experimenting XForms for workflow management ? Do you think > this could result in an online demo about that ? > > Thanks! > > -Alain |