Hi Alex,
Thanks, but that still doesn't seem to work for me. The value is indeed set before the submission (so the submission should be regarded as valid) but I am still getting a failed submission when I have validate="true" in the submission (and the field I am trying to set is required). I have <xforms:model id="main-model"> <xforms:instance id="data" xmlns=""> <data/> </xforms:instance> <xforms:bind nodeset="instance('data')" id="bind-data" required="true()"/> <xforms:submission id="submit" replace="all" ref="instance('data')" action="/echoSubmission" method="post" validate="true"/> </xforms:model>and <xforms:trigger id="trigger-submit"> <xforms:label>Submit</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="/data">2</xforms:setvalue> <xforms:refresh/> <xforms:send submission="submit"/> </xforms:action> </xforms:trigger>and the behaviour I see is that the submission fails with the following in the debug window: 2006-08-10 16:17:07,510 DEBUG org.orbeon.oxf.xforms.XFormsModelSubmission - XForms - instance document or subset thereof cannot be submitted: <data xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:layout="http://orionhealth.com/soprano/forms/layout" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:orion="http://orionhealth.com/soprano/forms/form" xmlns:ui="http://orionhealth.com/soprano/forms/form/ui" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xxforms:required="true">2</data> If I set validate="false" in the submission then the value of 2 does get submitted. Cheers, Dave McIntyre Alessandro Vernet wrote: Hi Dave, -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Hi Dave,
I am testing this again, and I have here a use case seems that now works for me even without the <xforms:refresh/>. (I am not sure if this test case did not work yesterday, or if did but made a mistake somehow.) Have a look at the attached example. You can run it in the sandbox. In the instance I have <data>0</data>. The constraint on this element is for the value to be 1. The trigger is: <xforms:trigger> <xforms:label>Go</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="/data">1</xforms:setvalue> <xforms:send submission="submission"/> </xforms:action> </xforms:trigger> Because it sets the value to 1, the submission happens. Change this and set the value to 2, and the submission won't happen. 1) If this example does not work as describe here, you might want to upgrade to a newer version. 2) If this works, but you have a similar case that doesn't work, it would be good if you could create, based on your case, a stand-alone file that we can run in the sandbox. Alex On 8/9/06, Dave McIntyre <[hidden email]> wrote: > > Hi Alex, > > Thanks, but that still doesn't seem to work for me. The value is indeed > set before the submission (so the submission should be regarded as valid) > but I am still getting a failed submission when I have validate="true" in > the submission (and the field I am trying to set is required). > > I have > <xforms:model id="main-model"> > <xforms:instance id="data" xmlns=""> > <data/> > </xforms:instance> > > <xforms:bind nodeset="instance('data')" id="bind-data" required="true()"/> > > <xforms:submission id="submit" replace="all" ref="instance('data')" > action="/echoSubmission" method="post" > validate="true"/> > </xforms:model> > > and > <xforms:trigger id="trigger-submit"> > <xforms:label>Submit</xforms:label> > <xforms:action ev:event="DOMActivate"> > <xforms:setvalue ref="/data">2</xforms:setvalue> > <xforms:refresh/> > <xforms:send submission="submit"/> > </xforms:action> > </xforms:trigger> > > and the behaviour I see is that the submission fails with the following in > the debug window: > 2006-08-10 16:17:07,510 DEBUG > org.orbeon.oxf.xforms.XFormsModelSubmission - XForms - > instance document or subset thereof cannot be submitted: > > <data xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:layout="http://orionhealth.com/soprano/forms/layout" > xmlns:xlink="http://www.w3.org/1999/xlink" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:orion="http://orionhealth.com/soprano/forms/form" > xmlns:ui="http://orionhealth.com/soprano/forms/form/ui" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xhtml="http://www.w3.org/1999/xhtml" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > xxforms:required="true">2</data> > > If I set validate="false" in the submission then the value of 2 does get > submitted. > > Cheers, > Dave McIntyre > > > Alessandro Vernet wrote: > Hi Dave, > > Doing a <xforms:refresh/> instead of <xforms:revalidate/> should work > for you. At least it worked for me in a small example I create trying > to reproduce this: > > <xforms:action ev:event="DOMActivate"> > <xforms:setvalue ref="/data">2</xforms:setvalue> > <xforms:refresh/> > <xforms:send submission="submission"/> > </xforms:action> > > But I would have thought that <xforms:revalidate/> would have done the > trick as well. I'll let Erik confirm this. > > Alex > > > > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws action-load-target.xhtml (1K) Download Attachment
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Administrator
|
In reply to this post by Adrian Baker-2
Adrian,
OK. We are thinking about adding at least one other function that would be exposed to custom JavaScript. Since this function is not strictly related to controls, maybe we'll create another class under ORBEON.xforms. That class will contain those functions that are explicitly designed to be used by custom JavaScript in forms. Alex On 8/9/06, Adrian Baker <[hidden email]> wrote: > > Nope, using a function like this seems perfectly ok. > > Alessandro Vernet wrote: > Adrian, > > Yes, it is broken. And we are quite evil, because we did it on purpose > :). Before, the JavaScript code was notified by the browser that the > 'value' property was changed because we were registering an event > handler on every input. This is quite expensive, so we don't do that > anymore. In the future you will need to call an API provided in > xforms.js to set the value. It could be: > > ORBEON.xforms.Controls.setValue("control-id", newValue); > > Any better suggestion? > > Alex > > On 8/6/06, Adrian Baker <[hidden email]> wrote: > > > Javascript integration > (http://www.orbeon.com/ops/doc/reference-xforms-ng#d2501990e4731) > seems broken - setting the value of a control doesn't seem to result in the > engine being notified of the new value. > > Alessandro Vernet wrote: > All, > > I won't try to claim that the new code is absolutely bug-free, but I > think we are back to acceptable level of stability. If you were using > nightly builds before, and still feel adventurous, this is your day to > give a try to a nightly build. If you notice any regression compared > to what we had last week (or of course any annoying bug), please let > us know. > > http://forge.objectweb.org/nightlybuilds/ops/ops/ > > Alex > > On 7/24/06, Erik Bruchez <[hidden email]> wrote: > > All, > > The new and improved client-side JavaScript code will probably be > checked in later today, but there are still some known issues associated > with it. > > Since this code is likely to break your app, we don't recommend getting > nightlies while we work on fixing those issues. > > On the other hand committing this will encourage us to fix the remaining > issues quickly! > > -Erik > > -- > Orbeon - XForms Everywhere: > http://www.orbeon.com/blog/ > > > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > > > > > ________________________________ > > -- 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 ObjectWeb > mailing lists service home page: http://www.objectweb.org/wws > > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > > > > > ________________________________ > > -- 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 ObjectWeb > mailing lists service home page: http://www.objectweb.org/wws > > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Administrator
|
In reply to this post by David McIntyre
Dave,
The exception is now fixed. I don't know why your submission fails though. Neither refresh not revalidate should do anything useful in theory, because as per the XForms spec submission revalidates anyway before actually submitting. -Erik Dave McIntyre wrote: > Hi Alex, > > Thanks, but that still doesn't seem to work for me. The value is indeed > set before the submission (so the submission should be regarded as > valid) but I am still getting a failed submission when I have > validate="true" in the submission (and the field I am trying to set is > required). > > I have > > <xforms:model id="main-model"> > <xforms:instance id="data" xmlns=""> > <data/> > </xforms:instance> > > <xforms:bind nodeset="instance('data')" id="bind-data" required="true()"/> > > <xforms:submission id="submit" replace="all" ref="instance('data')" action="/echoSubmission" method="post" > validate="true"/> > </xforms:model> > > and > > <xforms:trigger id="trigger-submit"> > <xforms:label>Submit</xforms:label> > <xforms:action ev:event="DOMActivate"> > <xforms:setvalue ref="/data">2</xforms:setvalue> > <xforms:refresh/> > <xforms:send submission="submit"/> > </xforms:action> > </xforms:trigger> > > and the behaviour I see is that the submission fails with the following > in the debug window: > 2006-08-10 16:17:07,510 DEBUG > org.orbeon.oxf.xforms.XFormsModelSubmission - XForms - instance > document or subset thereof cannot be submitted: > > <data xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:layout="http://orionhealth.com/soprano/forms/layout" > xmlns:xlink="http://www.w3.org/1999/xlink" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:orion="http://orionhealth.com/soprano/forms/form" > xmlns:ui="http://orionhealth.com/soprano/forms/form/ui" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xhtml="http://www.w3.org/1999/xhtml" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > xxforms:required="true">2</data> > > If I set validate="false" in the submission then the value of 2 does get > submitted. > > Cheers, > Dave McIntyre > > Alessandro Vernet wrote: >> Hi Dave, >> >> Doing a <xforms:refresh/> instead of <xforms:revalidate/> should work >> for you. At least it worked for me in a small example I create trying >> to reproduce this: >> >> <xforms:action ev:event="DOMActivate"> >> <xforms:setvalue ref="/data">2</xforms:setvalue> >> <xforms:refresh/> >> <xforms:send submission="submission"/> >> </xforms:action> >> >> But I would have thought that <xforms:revalidate/> would have done the >> trick as well. I'll let Erik confirm this. >> >> Alex > > > ------------------------------------------------------------------------ > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Adrian Baker-2
Adrian Baker wrote:
> Labels for hidden (non-relevant) dropdowns are displayed. This one should be fixed now. > I guess this comes back to the old problem of xforms:select/select1 not > having a wrapping span the way xforms:input does... That's not directly related because we put an xforms-disabled class on labels as controls become non-relevant. -Erik -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by Alessandro Vernet
Alex, I tried your example in the sandbox, and as you say it did validate and then submit. However, when I modified the instance data and bind from <xforms:instance> <data>0</data> </xforms:instance> <xforms:bind nodeset="/data" constraint=". = 1"/>to <xforms:instance> <data/> </xforms:instance> <xforms:bind nodeset="/data" required="true()"/>it no longer works on the sandbox at http://www.orbeon.com/ops/goto-example/xforms-sandbox. With this version, if I change the initial data to 3, then the value does get changed to 1 before submission. So the issue is presumably that the "required-empty" status is not being updated even though the value changes and the "value-invalid" status changes. I've attached my modified version. Hopefully the fix you mention will work with this. Thanks again for your help, Dave McIntyre Erik Bruchez wrote: Dave, Alessandro Vernet wrote: Hi Dave, -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws action-load-target.xhtml (1K) Download Attachment |
Administrator
|
Dave,
As I understand the spec, revalidation takes place at the be beginning of submission, but not recalculation. However, the "required" MIP is computed during revalidation. So you should add an <xforms:recalculate/> before the submission. That should do it. I admit, this is a little tricky ;-) -Erik Dave McIntyre wrote: > Hi Alex and Erik, > > Alex, I tried your example in the sandbox, and as you say it did > validate and then submit. > > However, when I modified the instance data and bind from > > <xforms:instance> > <data>0</data> > </xforms:instance> > <xforms:bind nodeset="/data" constraint=". = 1"/> > > to > > <xforms:instance> > <data/> > </xforms:instance> > <xforms:bind nodeset="/data" required="true()"/> > > it no longer works on the sandbox at > http://www.orbeon.com/ops/goto-example/xforms-sandbox. With this > version, if I change the initial data to 3, then the value does get > changed to 1 before submission. So the issue is presumably that the > "required-empty" status is not being updated even though the value > changes and the "value-invalid" status changes. > > I've attached my modified version. Hopefully the fix you mention will > work with this. > > Thanks again for your help, > > Dave McIntyre > > Erik Bruchez wrote: >> Dave, >> >> The exception is now fixed. >> >> I don't know why your submission fails though. Neither refresh not >> revalidate should do anything useful in theory, because as per the >> XForms spec submission revalidates anyway before actually submitting. >> >> -Erik > > > Alessandro Vernet wrote: >> Hi Dave, >> >> I am testing this again, and I have here a use case seems that now >> works for me even without the <xforms:refresh/>. (I am not sure if >> this test case did not work yesterday, or if did but made a mistake >> somehow.) >> >> Have a look at the attached example. You can run it in the sandbox. In >> the instance I have <data>0</data>. The constraint on this element is >> for the value to be 1. The trigger is: >> >> <xforms:trigger> >> <xforms:label>Go</xforms:label> >> <xforms:action ev:event="DOMActivate"> >> <xforms:setvalue ref="/data">1</xforms:setvalue> >> <xforms:send submission="submission"/> >> </xforms:action> >> </xforms:trigger> >> >> Because it sets the value to 1, the submission happens. Change this >> and set the value to 2, and the submission won't happen. >> >> 1) If this example does not work as describe here, you might want to >> upgrade to a newer version. >> 2) If this works, but you have a similar case that doesn't work, it >> would be good if you could create, based on your case, a stand-alone >> file that we can run in the sandbox. >> >> Alex > > > ------------------------------------------------------------------------ > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |