Hi all,
I am using Orbeon Form Builder. When the form open, I have to call a servlet that returns only one value and I set this value to one instance. I know that I can use the events xforms-model-construct-done or xforms-ready, but the submission is not working if there are required fields in the form. I have tried it with Orbeon 3.9.0.201105152053-PE (3.9 final version) and Orbeon 3.9.0.post.201107291426 PE (nightly build). Steps to reproduce it: 1) Create a new form using Form Builder, add one required input, past the following submission in the form and change the resource to any servlet that returns only one value. Result: The submission will not work and it will not call your servlet. 2) Remove the required input from your form. Result: The submission will work, because there isn't required input in the form. <xforms:send ev:event="xforms-model-construct-done" submission="submit_model_foobar"/> <xforms:submission id="submit_model_foobar" resource="http://localhost:8380/service/ValueServlet?key=show-last-internal" method="get" replace="text" serialization="text/plain" mediatype="text/plain" targetref="instance('fr-form-instance')/section-1/control-1" xxforms:cache="false"> </xforms:submission> Is it a bug? Is there a problem with this submission? I think since it is a submission with method type get, it should work even when there are required fields. Right? |
Administrator
|
Yes, I don't see why having required fields would change this!
You did try xforms-ready as well, is that right? -Erik On Wed, Aug 3, 2011 at 1:09 AM, inanda.menezes <[hidden email]> wrote: > Hi all, > > I am using Orbeon Form Builder. > When the form open, I have to call a servlet that returns only one value and > I set this value to one instance. > I know that I can use the events xforms-model-construct-done or > xforms-ready, but the submission is not working if there are required > fields in the form. > > I have tried it with Orbeon 3.9.0.201105152053-PE (3.9 final version) and > Orbeon 3.9.0.post.201107291426 PE (nightly build). > > Steps to reproduce it: > 1) Create a new form using Form Builder, add one required input, past the > following submission in the form and change the resource to any servlet that > returns only one value. > > Result: The submission will not work and it will not call your servlet. > > 2) Remove the required input from your form. > > Result: The submission will work, because there isn't required input in the > form. > > <xforms:send ev:event="xforms-model-construct-done" > submission="submit_model_foobar"/> > > > <xforms:submission id="submit_model_foobar" > > resource="http://localhost:8380/service/ValueServlet?key=show-last-internal" > method="get" > replace="text" > serialization="text/plain" > mediatype="text/plain" > > targetref="instance('fr-form-instance')/section-1/control-1" > xxforms:cache="false"> </xforms:submission> > > > Is it a bug? Is there a problem with this submission? I think since it is > a submission with method type get, it should work even when there are > required fields. Right? > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Form-Builder-Submission-method-get-does-not-work-in-form-with-required-field-tp3714724p3714724.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > 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 > > -- 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 |
Hi Erik!! Yes, I've tried xforms-ready as well.
The problem is not the event, it seems that it tries to validate the form before send this kind of submission! For exemplo, I also tried to add this in one trigger, like this: <xforms:trigger xmlns:xbl="http://www.w3.org/ns/xbl" xmlns:fb="http://orbeon.org/oxf/xml/form-builder" id="control-2-control" bind="control-2-bind"> <xforms:label ref="$form-resources/control-2/label"/> <xforms:help ref="$form-resources/control-2/help"/> <xforms:hint ref="$form-resources/control-2/hint"/> <xforms:alert ref="$fr-resources/detail/labels/alert"/> <xforms:action ev:event="DOMActivate"> <xforms:send submission="submit_model_foobar"/> </xforms:action> </xforms:trigger> Result: It will also works when there is no required field in the form. If there are required fields, it only works if I fill the fields correctly before click the button. I am just trying to retrieve one value. So, It should not try validate if the form is valid or not, but it seems that it is! |
Administrator
|
Thanks for the additional details. I will try to look at this. No
guarantee on the time as we have quite a backlog :( -Erik On Tue, Aug 9, 2011 at 1:45 AM, inanda.menezes <[hidden email]> wrote: > Hi Erik!! Yes, I've tried xforms-ready as well. > The problem is not the event, it seems that it tries to validate the form > before send this kind of submission! > > For exemplo, I also tried to add this in one trigger, like this: > > <xforms:trigger xmlns:xbl="http://www.w3.org/ns/xbl" > > xmlns:fb="http://orbeon.org/oxf/xml/form-builder" > id="control-2-control" > bind="control-2-bind"> > <xforms:label > ref="$form-resources/control-2/label"/> > <xforms:help > ref="$form-resources/control-2/help"/> > <xforms:hint > ref="$form-resources/control-2/hint"/> > <xforms:alert > ref="$fr-resources/detail/labels/alert"/> > <xforms:action ev:event="DOMActivate"> > > <xforms:send > submission="submit_model_foobar"/> > > </xforms:action> > </xforms:trigger> > > Result: > It will also works when there is no required field in the form. If there are > required fields, it only works if I fill the fields correctly before click > the button. > > I am just trying to retrieve one value. So, It should not try validate if > the form is valid or not, but it seems that it is! > > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Form-Builder-Submission-method-get-does-not-work-in-form-with-required-field-tp3714724p3729330.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > 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 > > -- 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 |
Ok Erik, thanks!
We really need it working =/. |
Administrator
|
Inanda,
Some good news: it's actually an easy one. Because the field is required, and initially blank, it makes the instance data invalid. When your submit_model_foobar submission is called, it first makes sure the data to submit is valid. Because it isn't, the submission doesn't run. If you just add the following attribute to your submision: validate="false", the issue goes away. Note that if you don't need to send instance data to your servlet at all, you can instead / in addition add this attribute: serialization="none" This causes the submission to not send any data to your servlet, and at the same time it won't try to validate it. -Erik On Thu, Aug 11, 2011 at 12:46 AM, inanda.menezes <[hidden email]> wrote: > Ok Erik, thanks! > We really need it working =/. > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Form-Builder-Submission-method-get-does-not-work-in-form-with-required-field-tp3714724p3735188.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > 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 > > -- 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 |
Hi Erik,
It worked, thanks a lot :D. |
Administrator
|
Excellent, thanks for confirming!
-Erik On Tue, Aug 16, 2011 at 1:20 PM, inanda.menezes <[hidden email]> wrote: > Hi Erik, > > It worked, thanks a lot :D. > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Form-Builder-Submission-method-get-does-not-work-in-form-with-required-field-tp3714724p3748334.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > 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 > > -- 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 |
Free forum by Nabble | Edit this page |