Re: Nested forms in WizardStep
Hi, I never had to build such a scenario, but IFormVisitorParticipant can help you? Let your nested Form (or its parent) implement the interface and return false from #processChildren(). Have fun Sven Am 17.11.2017 um 09:18 schrieb Dirk Forchel: No, I was not searching for a solution how to "disabling nested form validation" as I was unsure whether it's a proper solution to use nested forms in a WizardStep. To get an impression how the checkout should look like have a look at http://demo.designing-world.com/bigshop-aa/bigshop/checkout-1.html. Exists a best practice solution how to deal with those scenarios? I'm just curious. -- Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms in WizardStep
No, I was not searching for a solution how to "disabling nested form validation" as I was unsure whether it's a proper solution to use nested forms in a WizardStep. To get an impression how the checkout should look like have a look at http://demo.designing-world.com/bigshop-aa/bigshop/checkout-1.html. Exists a best practice solution how to deal with those scenarios? I'm just curious. -- Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms in WizardStep
Have you tried https://stackoverflow.com/questions/26502864/disabling-nested-form-validation-in-wicket ? Have fun sven Am 16.11.2017 um 18:19 schrieb Dirk Forchel: Currently we use the Wizard/WizardStep classes from wicket-extensions to set required data for an object (in our case a checkout process with some user Information, e.g. addresses etc.). The first step contains a Login form with two "required" input components for the credentials and a separate "Login" button and a Panel with two ratio buttons where the user must decide whether to go on without login (anonymous) or to register a new user account. Only the values for the ratio buttons should be triggered by this step with the "next" button. The Login itself should be triggered with the additional "login" button which is not part of the ButtonBar. As far as I know it's not good to have nested forms. We don't need to have forms inside our steps actually, since the Wizard itself has a form already. I've noticed that if the user hits the "next" button, the form validation for the login form ist triggered as well, but it should not. The form processing for the login form should actually not part of step, but the "login container" must be part of the view. What is the best solution to implement this scenario? I implemented the step without an additional form component and used an AjaxButton. In AjaxButton#onSubmit I implemented the authentication stuff. But further on I got some problems with updating the current state and how to go on to the next step. Also I've noticed, that pressing the "next" button would require some input for the credentials. So I'm a bit confused now. I hope, I could express myself clearly. Could someone give me some hint? Thank you very much. -- Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: nested forms with modal window
Hi, public void onSubmit(AjaxRequestTarget target, Form form) { remarkModalWindow.show(target); for(FaultModel fm : selectedModel.getObject()) { System.out.println("ActionButton Remark: " + fm.getFaultRemark()); } } the submit of my modal window will be executed ... after he runs through the selectedModel. Wicket's modal window isn't 'modal' in that it holds processing until it is closed again. So of course your loop will execute immediately after telling the model window to be shown - it will not be shown until the current thread has finished request processing. Regards Sven On 23.02.2017 16:20, christoph.ma...@t-systems.com wrote: Hello, I have a form which contains a modal window. The submit button of this form is an AjaxButton and should first open the modal window. This form contains a collection of message object which should be changed by the modal window. The modal window also contains a form and a AjaxButton to submit the form. Here the user can write something into a textfield and submit this form of the modal window. So the message objects will be changed by the users input and then the modal window will be closed by modalWindow.close(target). This is the submit of the mother form: @Override public void onSubmit(AjaxRequestTarget target, Form form) { remarkModalWindow.show(target); for(FaultModel fm : selectedModel.getObject()) { System.out.println("ActionButton Remark: " + fm.getFaultRemark()); } } The selected model is a collection of messages which should be changed by the modal window. Therefore I will show the submit of the form of the modal window: @Override protected void onSubmit(AjaxRequestTarget target, Form form) { RemarkForm remarkForm = (RemarkForm)form; for(FaultModel faultModel : remarkForm.getSelectedModel().getObject()) { System.out.println("Sets the old remark " + faultModel.getFaultRemark() + " to " + remarkForm.getModelObject().getFaultRemark()); faultModel.setFaultRemark(remarkForm.getModelObject().getFaultRemark()); } remarkForm.getRemarkModalWindow().close(target); } The change of the remark is successful and the window will be closed fine. But on my console I see the output: ActionButton Remark: null Sets the old remark null to testen So it says the submit of my modal window will be executed to late. It will be triggered after he runs through the selectedModel. But first I want to change the selectedModel by the modal window and close it and then I want to write the output in the mother submit to the console. Why did he trigger the next steps after calling modalWindow.show? I thought the inner form have to be submitted before the next steps of the mother submit will be called. What can I do here? Mit freundlichen Grüßen Christoph Manig - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms
Hi, As others explained - yes, this is correct behavior. In the produced page markup you can see that there is form element only for the outer form. The inner form is represented by a div element. Martin Grigorov Wicket Training and Consulting On Fri, Jan 10, 2014 at 7:04 PM, gmparker2000 greg.par...@brovada.comwrote: When submitting an inner form it appears that the request contains all of the outer and inner form fields. Is this the expected behaviour? From what I can see it appears that the outer form is submitted, and only the inner form parameters are validated and used for model updates. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-tp4663620.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms
Nested form elements (what I'm assuming you're referring to) aren't allowed, per the HTML spec: http://www.w3.org/TR/html5/forms.html I wouldn't expect Wicket to follow any kind of predictable behavior (especially since different browsers likely exhibit different behaviors themselves). Best, Chris On Fri, Jan 10, 2014 at 12:04 PM, gmparker2000 greg.par...@brovada.comwrote: When submitting an inner form it appears that the request contains all of the outer and inner form fields. Is this the expected behaviour? From what I can see it appears that the outer form is submitted, and only the inner form parameters are validated and used for model updates. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-tp4663620.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms
Html does not support nested forms. Wicket works around this limitation and allows form nesting. I think it changes the html so that the inner form tags become span tags. This means that whenever any of the forms needs to be posted, everything is posted since in the result html there's only one form element. Wicket provides some mechanisms so that submitting the outer form submits (validates and updates models) the inner forms too, whereas submitting an inner form only validates and updates the model for this inner form. You can find more details in the wicket free guide ( https://code.google.com/p/wicket-guide) and at https://cwiki.apache.org/confluence/display/WICKET/Nested+Forms (not sure how up-to-date is the latter). On Fri, Jan 10, 2014 at 7:04 PM, gmparker2000 greg.par...@brovada.comwrote: When submitting an inner form it appears that the request contains all of the outer and inner form fields. Is this the expected behaviour? From what I can see it appears that the outer form is submitted, and only the inner form parameters are validated and used for model updates. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-tp4663620.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms
Also see section 12.5 Nested forms of the Free Guide at http://wicket.apache.org/guide/guide/chapter11.html#chapter11_5 On Fri, Jan 10, 2014 at 12:56 PM, Marios Skounakis msc...@gmail.com wrote: Html does not support nested forms. Wicket works around this limitation and allows form nesting. I think it changes the html so that the inner form tags become span tags. This means that whenever any of the forms needs to be posted, everything is posted since in the result html there's only one form element. Wicket provides some mechanisms so that submitting the outer form submits (validates and updates models) the inner forms too, whereas submitting an inner form only validates and updates the model for this inner form. You can find more details in the wicket free guide ( https://code.google.com/p/wicket-guide) and at https://cwiki.apache.org/confluence/display/WICKET/Nested+Forms (not sure how up-to-date is the latter). On Fri, Jan 10, 2014 at 7:04 PM, gmparker2000 greg.par...@brovada.com wrote: When submitting an inner form it appears that the request contains all of the outer and inner form fields. Is this the expected behaviour? From what I can see it appears that the outer form is submitted, and only the inner form parameters are validated and used for model updates. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-tp4663620.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms: error messages of the inner form now showing up
Is this the expected behavior? No, it isn't. Please create a quickstart and attach it to a new Jira issue. Sven On 04/22/2013 06:57 PM, pureza wrote: I have two nested forms. When I submit the outer form, the inner form's validation fails but no error is shown. I know the validation fails because the #onError() method of the inner form is being called. It is as if Wicket creates a brand-new, error-free, inner form after the page refreshes. Is this the expected behavior? Thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-forms-error-messages-of-the-inner-form-now-showing-up-tp4658166.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms: error messages of the inner form now showing up
Hi, I've fixed this. It seems I forgot to call #setReuseItems(true) in a ListView :-) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-forms-error-messages-of-the-inner-form-now-showing-up-tp4658166p4658202.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms ...
Hi, the values of all form components are submitted, but only the ones from the submitted nested form are processed. See Form#wantSubmitOnNestedFormSubmit() and the tests in NestedFormSubmitTest. Sven On 04/02/2013 12:40 PM, RalfButler wrote: Hi there, to my understanding the forms in the bottom code are nested. But why is the value of the outer textbox submitted when I click the inner submit button only? According to this page https://cwiki.apache.org/WICKET/nested-forms.html only the value of the inner textbox should be submitted when the inner submit button is pressed. Would be great if someone could explain this. Most likely I do something wrong here. Thanks. Ralf public class HomePage extends WebPage { private static final long serialVersionUID = 1L; private Model innerModel= new Model(Inner); private Model outerModel= new Model(Outer); public HomePage() { add(new Label(labelOuter, outerModel)); add(new Label(labelInner, innerModel)); Form formA = new Form(outerForm){ @Override protected void onSubmit() { System.out.println(Outer form submitted); } }; add(formA); formA.add(new TextField(outerFormTF, outerModel)); Form formB = new Form(innerForm){ @Override protected void onSubmit() { System.out.println(Inner form submitted); } }; formA.add(formB); formB.add(new TextField(innerFormTF, innerModel)); } } HTML: !DOCTYPE html html xmlns:wicket=http://wicket.apache.org; head meta charset=utf-8 / titleApache Wicket Quickstart/title link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:regular,bold' rel='stylesheet' type='text/css' / link rel=stylesheet href=style.css type=text/css media=screen title=Stylesheet / /head body Outer value br/ Inner value form wicket:id=outerForm input wicket:id=outerFormTF type=text/ input type=submit value=Outer Form / form wicket:id=innerForm input wicket:id=innerFormTF type=text/ input type=submit value=Inner Form / /form /form /body /html -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-forms-tp4657683.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms ...
Thanks for the quick reply Sven! Still confusing to me; for wantSubmitOnNestedFormSubmit() it says By default, this is false, so when a nested form is submitted, this form will not be submitted. And since I did not overwrite wantSubmitOnNestedFormSubmit of the OuterForm to return true, I'd expect that OuterForm is not submitted when the inner form submit button is pressed. Could it be that 'submit' and 'process' got a bit confused in the JavaDoc? I reckon it has something to do with the code I wrote. I slightly modified it ... same result. But it would be great if you could skim through it. May aim is that outerModel does not get assigned a value of the outerTextField when the innser submit button is pressed. Thanks, Ralf JAVA: HTML: -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-forms-tp4657683p4657687.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms ...
Ah, you're not using any button components, so there's no way for Wicket to know which form was submitted. Sven On 04/02/2013 01:48 PM, RalfButler wrote: Thanks for the quick reply Sven! Still confusing to me; for wantSubmitOnNestedFormSubmit() it says By default, this is false, so when a nested form is submitted, this form will not be submitted. And since I did not overwrite wantSubmitOnNestedFormSubmit of the OuterForm to return true, I'd expect that OuterForm is not submitted when the inner form submit button is pressed. Could it be that 'submit' and 'process' got a bit confused in the JavaDoc? I reckon it has something to do with the code I wrote. I slightly modified it ... same result. But it would be great if you could skim through it. May aim is that outerModel does not get assigned a value of the outerTextField when the innser submit button is pressed. Thanks, Ralf JAVA: HTML: -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-forms-tp4657683p4657687.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms ...
Ah! Thank you very much Sven. Yes, that makes sense!! In case anyone is interested: JAVA: HTML: -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-forms-tp4657683p4657689.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms and Multipart Fileupload Issue
Was this issue resolved? I am running on the same codebase and have the same issue. jcorbin wrote This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all. We have a page with a form that pops up modal window with a form specified as well. When we try to submit, we get the following exception: java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot. at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:113) at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:83) at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500) at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862) at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177) ... Setting Form.setMultipart(true) on either form has no affect. We are running Wicket Version 1.4.7. Is there a fix for this issue? Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p4174557.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms in 1.4.x - order of calling onSubmit
On Tue, Oct 18, 2011 at 3:11 PM, Bruno Borges bruno.bor...@gmail.com wrote: After playing with Nested Forms in WIcket 1.4.18, I found out that the onSubmit method of these forms is called at the end of the process. If a parent form has a button and this button is submited, its onSubmit method is called before anything. Then, parent form's onSubmit method is called. Then, it will navigate through all nested forms calling their onSubmit method. The problem is that I have a nested forms that changes a value in the model that is associated with the parent form. My usecase has an AddressPanel with a form inside that manipulates the person.address object. This panel is created by informing two IModelAddress objects. One is to be used as the Person's address. The other one is to be used as copy of, because of a CheckBox that states Use the same address as of account holder. On its onSubmit method, is where I clone the account holder address to the actual person.address. But because of the order of how Wicket calls onSubmit methods, this implementation fails. Any suggestion? Should Wicket call all nested forms' onSubmit methods before calling the Button's onSubmit (or the parent form onSubmit) ? This is how it behaves in Wicket 1.5. See org.apache.wicket.markup.html.form.Form.delegateSubmit(IFormSubmitter) You are recommended to upgrade! ;-) Thanks, *Bruno Borges* (21) 7672-7099 *www.brunoborges.com* -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms in 1.4.x - order of calling onSubmit
Can't upgrade... :-( Political issues (read: conservative corporation with terrible decision makers) *Bruno Borges* (21) 7672-7099 *www.brunoborges.com* On Thu, Oct 20, 2011 at 9:28 AM, Martin Grigorov mgrigo...@apache.orgwrote: On Tue, Oct 18, 2011 at 3:11 PM, Bruno Borges bruno.bor...@gmail.com wrote: After playing with Nested Forms in WIcket 1.4.18, I found out that the onSubmit method of these forms is called at the end of the process. If a parent form has a button and this button is submited, its onSubmit method is called before anything. Then, parent form's onSubmit method is called. Then, it will navigate through all nested forms calling their onSubmit method. The problem is that I have a nested forms that changes a value in the model that is associated with the parent form. My usecase has an AddressPanel with a form inside that manipulates the person.address object. This panel is created by informing two IModelAddress objects. One is to be used as the Person's address. The other one is to be used as copy of, because of a CheckBox that states Use the same address as of account holder. On its onSubmit method, is where I clone the account holder address to the actual person.address. But because of the order of how Wicket calls onSubmit methods, this implementation fails. Any suggestion? Should Wicket call all nested forms' onSubmit methods before calling the Button's onSubmit (or the parent form onSubmit) ? This is how it behaves in Wicket 1.5. See org.apache.wicket.markup.html.form.Form.delegateSubmit(IFormSubmitter) You are recommended to upgrade! ;-) Thanks, *Bruno Borges* (21) 7672-7099 *www.brunoborges.com* -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms in 1.4.x - order of calling onSubmit
On Thu, Oct 20, 2011 at 3:07 PM, Bruno Borges bruno.bor...@gmail.com wrote: Can't upgrade... :-( Political issues (read: conservative corporation with terrible decision makers) They let you use wicket, so they can't be too bad :) Martijn - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms quick question
Yes they are necessarily nested. Thanks Martin, I'll give it a try. Alex On 05/06/2011 09:15 PM, Martin Grigorov wrote: instead of setRequired() use isRequired(submittedForm == innerForm) On Fri, May 6, 2011 at 6:04 PM, Titonjyt...@gmail.com wrote: Are these necessarily nested forms? 2011/5/5 Alexandru Artimonaarti...@developmentgateway.org Hey guys, When I submit the main form can I prevent the submit of the inner forms? I have some small forms to add items to the main form. The fields in the inner forms have setRequired(true), so when I submit the main form I get errors that those fields are empty. Any ideas? Thanks, Alexandru - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms quick question
Are these necessarily nested forms? 2011/5/5 Alexandru Artimon aarti...@developmentgateway.org Hey guys, When I submit the main form can I prevent the submit of the inner forms? I have some small forms to add items to the main form. The fields in the inner forms have setRequired(true), so when I submit the main form I get errors that those fields are empty. Any ideas? Thanks, Alexandru - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms quick question
instead of setRequired() use isRequired(submittedForm == innerForm) On Fri, May 6, 2011 at 6:04 PM, Tito njyt...@gmail.com wrote: Are these necessarily nested forms? 2011/5/5 Alexandru Artimon aarti...@developmentgateway.org Hey guys, When I submit the main form can I prevent the submit of the inner forms? I have some small forms to add items to the main form. The fields in the inner forms have setRequired(true), so when I submit the main form I get errors that those fields are empty. Any ideas? Thanks, Alexandru - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms and conditional validation
I did manage to get this working using the other pattern from the conditional-validation page (i.e. using the FormVisitorParticipant) but I'm still curious if the isEnabled solution should work or not? Regards Robert On 03/30/2011 02:45 PM, Robert Dahlström wrote: Hi, I'm currently trying to work out how to do conditional validation with nested forms. Googling a bit gave me the following suggestion on how to disable a nested form: (From https://cwiki.apache.org/WICKET/conditional-validation.html) Form nestedForm = new Form(nestedForm) { @Override public boolean isEnabled() { if (getRootForm().findSubmittingButton() != null) { return getRootForm().findSubmittingButton().getForm() == this; } else { return true; } } But when I try this with Wicket 1.4.16 I noticed that findSubmittingButton internally calls isEnabledInHierarchy which ends up calling isEnabled so I get stuck in a loop that eventually throws an exception. So how should one go about working with nested forms if I don't want the nested form to be submitted when the outer form is submitted? Appreciative of any help, Regards Robert - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms and conditional validation
depending on external factors while overriding isenabled()/isvisible() is dangerous for the reasons youve just found out. this is why we take care to provide alternative hooks, such as IFormVisitorParticipant -igor 2011/3/30 Robert Dahlström robert.dahlst...@ongame.com: I did manage to get this working using the other pattern from the conditional-validation page (i.e. using the FormVisitorParticipant) but I'm still curious if the isEnabled solution should work or not? Regards Robert On 03/30/2011 02:45 PM, Robert Dahlström wrote: Hi, I'm currently trying to work out how to do conditional validation with nested forms. Googling a bit gave me the following suggestion on how to disable a nested form: (From https://cwiki.apache.org/WICKET/conditional-validation.html) Form nestedForm = new Form(nestedForm) { @Override public boolean isEnabled() { if (getRootForm().findSubmittingButton() != null) { return getRootForm().findSubmittingButton().getForm() == this; } else { return true; } } But when I try this with Wicket 1.4.16 I noticed that findSubmittingButton internally calls isEnabledInHierarchy which ends up calling isEnabled so I get stuck in a loop that eventually throws an exception. So how should one go about working with nested forms if I don't want the nested form to be submitted when the outer form is submitted? Appreciative of any help, Regards Robert - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms and Multipart Fileupload Issue
https://issues.apache.org/jira/browse/WICKET-3555 Thanks Martin Grigorov-4 wrote: Create a ticket please. And attach the quickstart. On Wed, Mar 23, 2011 at 12:19 PM, Stijn Maller lt;stijn.mal...@gmail.comgt;wrote: gt; Alexander, gt; gt; I'm facing the same issue and I'm convinced it is a bug. gt; gt; When a FileUploadField in a nested form causes an error, then: gt; gt; - The ErrorMessage is registered on the outer form (instead of the inner gt; form) gt; - The outer form's onError method is called (instead of that of the inner gt; form) gt; - The outer form is considered not valid gt; gt; This goes against https://cwiki.apache.org/WICKET/nested-forms.html and gt; it's gt; also the opposite of what happens when the FileUploadField is submitted gt; without error. (Only the inner form's onSubmit is called) gt; gt; As a sidenote, I also find it a bit strange that: gt; 1) the FileUploadField itself is considered valid and the error message is gt; not registered to this component. gt; 2) the onSubmit method of the AjaxButton is called instead of the onError gt; method. gt; gt; Sorry, but I have not found a workaround yet. gt; gt; Kind regards, gt; Stijn gt; gt; gt; On 17 January 2011 17:59, Alexander Morozov gt; lt;alexander.v.moro...@gmail.comgt;wrote: gt; gt; gt; gt; gt; Hi, gt; gt; gt; gt; I have faced with another problem, related to nested forms and gt; gt; FileUploadField (wicket-1.4.15). gt; gt; The nested form have FileUploadField instance and defined gt; setMaxSize(100K). gt; gt; In case of submitting thru Ajax file more than 100K, hasError() on the gt; gt; nested form return false. But I expect here 'true' - because of gt; setMaxSize gt; gt; constraint violation. Is this expected behavior ? gt; gt; gt; gt; Quickstart is attached. gt; gt; gt; http://apache-wicket.1842946.n4.nabble.com/file/n3221235/modalproject2.zip gt; gt; modalproject2.zip gt; gt; gt; gt; Thanks gt; gt; gt; gt; -- gt; gt; View this message in context: gt; gt; gt; http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3221235.html gt; gt; Sent from the Users forum mailing list archive at Nabble.com. gt; gt; gt; gt; - gt; gt; To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org gt; gt; For additional commands, e-mail: users-h...@wicket.apache.org gt; gt; gt; gt; gt; -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com lt;http://jweekend.com/gt; - -- http://www.linkedin.com/in/amorozov -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3402637.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms and Multipart Fileupload Issue
Alexander, I'm facing the same issue and I'm convinced it is a bug. When a FileUploadField in a nested form causes an error, then: - The ErrorMessage is registered on the outer form (instead of the inner form) - The outer form's onError method is called (instead of that of the inner form) - The outer form is considered not valid This goes against https://cwiki.apache.org/WICKET/nested-forms.html and it's also the opposite of what happens when the FileUploadField is submitted without error. (Only the inner form's onSubmit is called) As a sidenote, I also find it a bit strange that: 1) the FileUploadField itself is considered valid and the error message is not registered to this component. 2) the onSubmit method of the AjaxButton is called instead of the onError method. Sorry, but I have not found a workaround yet. Kind regards, Stijn On 17 January 2011 17:59, Alexander Morozov alexander.v.moro...@gmail.comwrote: Hi, I have faced with another problem, related to nested forms and FileUploadField (wicket-1.4.15). The nested form have FileUploadField instance and defined setMaxSize(100K). In case of submitting thru Ajax file more than 100K, hasError() on the nested form return false. But I expect here 'true' - because of setMaxSize constraint violation. Is this expected behavior ? Quickstart is attached. http://apache-wicket.1842946.n4.nabble.com/file/n3221235/modalproject2.zip modalproject2.zip Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3221235.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms and Multipart Fileupload Issue
Create a ticket please. And attach the quickstart. On Wed, Mar 23, 2011 at 12:19 PM, Stijn Maller stijn.mal...@gmail.comwrote: Alexander, I'm facing the same issue and I'm convinced it is a bug. When a FileUploadField in a nested form causes an error, then: - The ErrorMessage is registered on the outer form (instead of the inner form) - The outer form's onError method is called (instead of that of the inner form) - The outer form is considered not valid This goes against https://cwiki.apache.org/WICKET/nested-forms.html and it's also the opposite of what happens when the FileUploadField is submitted without error. (Only the inner form's onSubmit is called) As a sidenote, I also find it a bit strange that: 1) the FileUploadField itself is considered valid and the error message is not registered to this component. 2) the onSubmit method of the AjaxButton is called instead of the onError method. Sorry, but I have not found a workaround yet. Kind regards, Stijn On 17 January 2011 17:59, Alexander Morozov alexander.v.moro...@gmail.comwrote: Hi, I have faced with another problem, related to nested forms and FileUploadField (wicket-1.4.15). The nested form have FileUploadField instance and defined setMaxSize(100K). In case of submitting thru Ajax file more than 100K, hasError() on the nested form return false. But I expect here 'true' - because of setMaxSize constraint violation. Is this expected behavior ? Quickstart is attached. http://apache-wicket.1842946.n4.nabble.com/file/n3221235/modalproject2.zip modalproject2.zip Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3221235.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Nested Forms and Multipart Fileupload Issue
Hi, I have faced with another problem, related to nested forms and FileUploadField (wicket-1.4.15). The nested form have FileUploadField instance and defined setMaxSize(100K). In case of submitting thru Ajax file more than 100K, hasError() on the nested form return false. But I expect here 'true' - because of setMaxSize constraint violation. Is this expected behavior ? Quickstart is attached. http://apache-wicket.1842946.n4.nabble.com/file/n3221235/modalproject2.zip modalproject2.zip Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3221235.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms and Multipart Fileupload Issue
Hi, WICKET-2779 seems to be related to modal windows with upload and ajax but jcorbins original post was about a nested form in a modal window within a multipart form. Are both issues fixed or does the problem from jcorbins first post persist? thanks Christian -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3159359.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms onSubmit() question ...
Just a feature request: - beforeSubmit() method on Form would be usefull - make it configurable order of onSubmit() method calls (SUBMIT_NESTED_FIRST, SUBMIT_NESTED_LAST) Regards Armando -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-forms-onSubmit-question-tp3026993p3028422.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms onSubmit() question ...
Hi Armando, have you tried calling method visitChildren(Form.class, visitor) in the main onSubmit? Maybe this could help you to gather children's data before submit root form. Bye. Hey wicket ppl ... Is there any beforeSubmit() event like method available on Form. I need it cause I have nested forms and only one form is allowed to store data in the database, so if I had a method beforeSubmit() all my nested forms could send data to the root form and root form would submit it to the database. I also though of it because I was looking at sources of Form class and nested forms onSubmit() method gets called after main form onSubmit() is executed, so In my case data is first stored into database and after that nested forms provide data to the main form to be stored in database. So either I implement procesing on my own (which I really wouldn't like to do, cause it's allready there (validation, processing, etc...)) or is there a beforeSubmit() kinda way available and I can't find it anywhere ... Any help appreciated. Regards Armando - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms onSubmit() question ...
Hey well ... that's also the way to do it .. thanks for idea ... regards Armando -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-forms-onSubmit-question-tp3026993p3027217.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms and Multipart Fileupload Issue
Did you add a jira issue James ? If not i can do it. Its a showstopper for me. Ilja Pavkovic pisze: Hi, Hmmm...I thought the Wicket Team already implemented something similar to this into the framework some time ago. Perhaps you should provide a quickstart and perhaps put it in a jira ticket? Best Regards, Ilja Pavkovic -- Michał Letyński ConSol* Consulting Solutions Software Poland Sp. z o.o. ul. Piastowska 44c, 30-070 Krakow mail: mi...@consol.pl tel: +48 609 266 753 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms and Multipart Fileupload Issue
Jirra issue with quickstart added: https://issues.apache.org/jira/browse/WICKET-2779 Michał Letyński pisze: Did you add a jira issue James ? If not i can do it. Its a showstopper for me. Ilja Pavkovic pisze: Hi, Hmmm...I thought the Wicket Team already implemented something similar to this into the framework some time ago. Perhaps you should provide a quickstart and perhaps put it in a jira ticket? Best Regards, Ilja Pavkovic - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms and Multipart Fileupload Issue
Is there a wicket version where it works ? I tried with 1.4.6 and 1.4.7 but i get the same error which James got. My use case : I'm trying to submit a form via ajax to upload a file inside modal window. After debug: FileUploadBase.isMultipartContent get false because if (contentType.toLowerCase().startsWith(MULTIPART)) - contentType = application/x-www-form-urlencoded James Carman pisze: You're trying to submit a form via ajax to upload a file? On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James jcor...@iqnavigator.com wrote: This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all. We have a page with a form that pops up modal window with a form specified as well. When we try to submit, we get the following exception: java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot. at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:113) at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:83) at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500) at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862) at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177) ... Setting Form.setMultipart(true) on either form has no affect. We are running Wicket Version 1.4.7. Is there a fix for this issue? Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Nested Forms and Multipart Fileupload Issue
Yeah, some feedback from the Wicket Contributors on this issue would be greatly appreciated. -Original Message- From: Michał Letyński [mailto:mletyn...@consol.pl] Sent: Wednesday, March 10, 2010 7:52 AM To: users@wicket.apache.org Subject: Re: Nested Forms and Multipart Fileupload Issue Is there a wicket version where it works ? I tried with 1.4.6 and 1.4.7 but i get the same error which James got. My use case : I'm trying to submit a form via ajax to upload a file inside modal window. After debug: FileUploadBase.isMultipartContent get false because if (contentType.toLowerCase().startsWith(MULTIPART)) - contentType = application/x-www-form-urlencoded James Carman pisze: You're trying to submit a form via ajax to upload a file? On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James jcor...@iqnavigator.com wrote: This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all. We have a page with a form that pops up modal window with a form specified as well. When we try to submit, we get the following exception: java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot. at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:113) at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:83) at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500) at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862) at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177) ... Setting Form.setMultipart(true) on either form has no affect. We are running Wicket Version 1.4.7. Is there a fix for this issue? Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms and Multipart Fileupload Issue
Someone at work had some luck with this approach from what I understand... http://www.dooriented.com/blog/2008/04/23/wicket-ajax-like-file-upload-on-a-modal-window/ 2010/3/10 Michał Letyński mletyn...@consol.pl: Is there a wicket version where it works ? I tried with 1.4.6 and 1.4.7 but i get the same error which James got. My use case : I'm trying to submit a form via ajax to upload a file inside modal window. After debug: FileUploadBase.isMultipartContent get false because if (contentType.toLowerCase().startsWith(MULTIPART)) - contentType = application/x-www-form-urlencoded James Carman pisze: You're trying to submit a form via ajax to upload a file? On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James jcor...@iqnavigator.com wrote: This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all. We have a page with a form that pops up modal window with a form specified as well. When we try to submit, we get the following exception: java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot. at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:113) at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:83) at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500) at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862) at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177) ... Setting Form.setMultipart(true) on either form has no affect. We are running Wicket Version 1.4.7. Is there a fix for this issue? Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Nested Forms and Multipart Fileupload Issue
Hmmm...I thought the Wicket Team already implemented something similar to this into the framework some time ago. -Original Message- From: James Carman [mailto:jcar...@carmanconsulting.com] Sent: Wednesday, March 10, 2010 11:15 AM To: users@wicket.apache.org Subject: Re: Nested Forms and Multipart Fileupload Issue Someone at work had some luck with this approach from what I understand... http://www.dooriented.com/blog/2008/04/23/wicket-ajax-like-file-upload-on-a-modal-window/ 2010/3/10 Michał Letyński mletyn...@consol.pl: Is there a wicket version where it works ? I tried with 1.4.6 and 1.4.7 but i get the same error which James got. My use case : I'm trying to submit a form via ajax to upload a file inside modal window. After debug: FileUploadBase.isMultipartContent get false because if (contentType.toLowerCase().startsWith(MULTIPART)) - contentType = application/x-www-form-urlencoded James Carman pisze: You're trying to submit a form via ajax to upload a file? On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James jcor...@iqnavigator.com wrote: This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all. We have a page with a form that pops up modal window with a form specified as well. When we try to submit, we get the following exception: java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot. at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:113) at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:83) at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500) at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862) at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177) ... Setting Form.setMultipart(true) on either form has no affect. We are running Wicket Version 1.4.7. Is there a fix for this issue? Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms and Multipart Fileupload Issue
Perhaps it's in Wicket-stuff? I don't know. On Wed, Mar 10, 2010 at 1:19 PM, Corbin, James jcor...@iqnavigator.com wrote: Hmmm...I thought the Wicket Team already implemented something similar to this into the framework some time ago. -Original Message- From: James Carman [mailto:jcar...@carmanconsulting.com] Sent: Wednesday, March 10, 2010 11:15 AM To: users@wicket.apache.org Subject: Re: Nested Forms and Multipart Fileupload Issue Someone at work had some luck with this approach from what I understand... http://www.dooriented.com/blog/2008/04/23/wicket-ajax-like-file-upload-on-a-modal-window/ 2010/3/10 Michał Letyński mletyn...@consol.pl: Is there a wicket version where it works ? I tried with 1.4.6 and 1.4.7 but i get the same error which James got. My use case : I'm trying to submit a form via ajax to upload a file inside modal window. After debug: FileUploadBase.isMultipartContent get false because if (contentType.toLowerCase().startsWith(MULTIPART)) - contentType = application/x-www-form-urlencoded James Carman pisze: You're trying to submit a form via ajax to upload a file? On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James jcor...@iqnavigator.com wrote: This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all. We have a page with a form that pops up modal window with a form specified as well. When we try to submit, we get the following exception: java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot. at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:113) at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:83) at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500) at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862) at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177) ... Setting Form.setMultipart(true) on either form has no affect. We are running Wicket Version 1.4.7. Is there a fix for this issue? Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms and Multipart Fileupload Issue
No - there is support for submitting forms via ajax that contain file upload fields - in the core of Wicket. It was added near the beginning of 1.4 IIRC. However, I'm not sure about this particular use case. It sounds like a bug. Could you please create a quickstart, attach to a JIRA, and post the JIRA link back here? Then we can take a look. Thanks -- Jeremy Thomerson http://www.wickettraining.com On Wed, Mar 10, 2010 at 12:21 PM, James Carman jcar...@carmanconsulting.com wrote: Perhaps it's in Wicket-stuff? I don't know. On Wed, Mar 10, 2010 at 1:19 PM, Corbin, James jcor...@iqnavigator.com wrote: Hmmm...I thought the Wicket Team already implemented something similar to this into the framework some time ago. -Original Message- From: James Carman [mailto:jcar...@carmanconsulting.com] Sent: Wednesday, March 10, 2010 11:15 AM To: users@wicket.apache.org Subject: Re: Nested Forms and Multipart Fileupload Issue Someone at work had some luck with this approach from what I understand... http://www.dooriented.com/blog/2008/04/23/wicket-ajax-like-file-upload-on-a-modal-window/ 2010/3/10 Michał Letyński mletyn...@consol.pl: Is there a wicket version where it works ? I tried with 1.4.6 and 1.4.7 but i get the same error which James got. My use case : I'm trying to submit a form via ajax to upload a file inside modal window. After debug: FileUploadBase.isMultipartContent get false because if (contentType.toLowerCase().startsWith(MULTIPART)) - contentType = application/x-www-form-urlencoded James Carman pisze: You're trying to submit a form via ajax to upload a file? On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James jcor...@iqnavigator.com wrote: This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all. We have a page with a form that pops up modal window with a form specified as well. When we try to submit, we get the following exception: java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot. at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:113) at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:83) at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500) at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862) at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177) ... Setting Form.setMultipart(true) on either form has no affect. We are running Wicket Version 1.4.7. Is there a fix for this issue? Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms and Multipart Fileupload Issue
You're trying to submit a form via ajax to upload a file? On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James jcor...@iqnavigator.com wrote: This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all. We have a page with a form that pops up modal window with a form specified as well. When we try to submit, we get the following exception: java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot. at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:113) at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:83) at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500) at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862) at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177) ... Setting Form.setMultipart(true) on either form has no affect. We are running Wicket Version 1.4.7. Is there a fix for this issue? Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Nested Forms and Multipart Fileupload Issue
My submit action is on the modal popup which does NOT contain a FileUpload Field, but the form the modal is launched from does have a FileUpload field. So, we have a page with a button added to a form that pops up a modal dialog that also defines a form. This modal popup has a Submit button that does so via Ajax (e.g., AjaxButton). Once we click the ajax submit button, we get the error below. -Original Message- From: James Carman [mailto:jcar...@carmanconsulting.com] Sent: Tuesday, March 09, 2010 2:30 PM To: users@wicket.apache.org Subject: Re: Nested Forms and Multipart Fileupload Issue You're trying to submit a form via ajax to upload a file? On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James jcor...@iqnavigator.com wrote: This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all. We have a page with a form that pops up modal window with a form specified as well. When we try to submit, we get the following exception: java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot. at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:113) at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:83) at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500) at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668) at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862) at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177) ... Setting Form.setMultipart(true) on either form has no affect. We are running Wicket Version 1.4.7. Is there a fix for this issue? Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms
Ok, then is the content found at these two pages not relevant for v1.4? http://cwiki.apache.org/WICKET/nested-forms.html and http://cwiki.apache.org/WICKET/conditional-validation.html I understand the idea of nested forms and I understand that HTML only supports one form. I had hoped that Wicket would only process the submitted form versus the entire form (whole form is submitted, only nested form actually processed). And from the content on the pages, I had thought it was a more common use case. My intent was to have a main form with various fields and then a grouping of fields within a nested form. This nested form was supposed to be submitted using an AjaxSumitLink for the nsted form. I suppose an alternative would be to have a custom behavior that called serializeForm on the client and then handled the component processing on its own. The trick in that case would be the FormValidators. If you have a better idea, I'm all ears. Thanks for the input. On Fri, Feb 19, 2010 at 1:56 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: you cannot have an isolated embedded form, as far as html is concerned that is an oxymoron. you can try hacking around it with IFormVisitorParticipant or by overriding form.process() on your main form, etc. but i do not think this is a usecase we will support... -igor On Fri, Feb 19, 2010 at 10:09 AM, Charles Deal chuckdea...@gmail.com wrote: I'm sorry to bump this. At the least, can anyone point me to some code that has successfully implemented isolated, nested forms using Wicket 1.4.x? On Wed, Feb 17, 2010 at 8:43 AM, Charles Deal charles.d...@missionse.comwrote: I am attempting to put an isolated form within the main form of my page. I found http://cwiki.apache.org/WICKET/nested-forms.html which was helpful in understanding how the processing works. I was even more excited when I found http://cwiki.apache.org/WICKET/conditional-validation.html which instructed me exactly how to alter the form object to do what I wanted. Unfortunately, the trick does not work as I expected it to. It seems that if I simply implement IFormVisitorParticipant.processChildren, it is not enough to stop the Nested form's FormValidator from firing when the main form is submitted. Therefore, I tried to implement the isEnabled technique. This did have the desired effect the first time through a page (enter data, submit main, no nested validator fires) but when the page re-renders after the submit, the nested form is now disabled! It seems that the findSubmittingButton() method finds the button that was used to submit the form, even though the page is rendering again. Another thing I noticed upon my different attempts is that altering the isEnabled method to use findSubmittingButton() won't work because findSubmittingButton() calls isEnabled()! which puts the code in an infinite loop. Could someone please enlighten me on how to code an isolated nested form using Wicket 1.4.x. Where isolated means that I want the form to have its own submit button and those fields are only submitted/processed/validated when that button is clicked. I want the form to be ignored by the parent form. This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind MSE to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms
if you press the submit button inside the embedded form - then only the embedded form is processed. but, if you press a submit button inside the outer form then it and all its embedded forms are processed. -igor On Sat, Feb 20, 2010 at 6:41 PM, Charles Deal chuckdea...@gmail.com wrote: Ok, then is the content found at these two pages not relevant for v1.4? http://cwiki.apache.org/WICKET/nested-forms.html and http://cwiki.apache.org/WICKET/conditional-validation.html I understand the idea of nested forms and I understand that HTML only supports one form. I had hoped that Wicket would only process the submitted form versus the entire form (whole form is submitted, only nested form actually processed). And from the content on the pages, I had thought it was a more common use case. My intent was to have a main form with various fields and then a grouping of fields within a nested form. This nested form was supposed to be submitted using an AjaxSumitLink for the nsted form. I suppose an alternative would be to have a custom behavior that called serializeForm on the client and then handled the component processing on its own. The trick in that case would be the FormValidators. If you have a better idea, I'm all ears. Thanks for the input. On Fri, Feb 19, 2010 at 1:56 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: you cannot have an isolated embedded form, as far as html is concerned that is an oxymoron. you can try hacking around it with IFormVisitorParticipant or by overriding form.process() on your main form, etc. but i do not think this is a usecase we will support... -igor On Fri, Feb 19, 2010 at 10:09 AM, Charles Deal chuckdea...@gmail.com wrote: I'm sorry to bump this. At the least, can anyone point me to some code that has successfully implemented isolated, nested forms using Wicket 1.4.x? On Wed, Feb 17, 2010 at 8:43 AM, Charles Deal charles.d...@missionse.comwrote: I am attempting to put an isolated form within the main form of my page. I found http://cwiki.apache.org/WICKET/nested-forms.html which was helpful in understanding how the processing works. I was even more excited when I found http://cwiki.apache.org/WICKET/conditional-validation.html which instructed me exactly how to alter the form object to do what I wanted. Unfortunately, the trick does not work as I expected it to. It seems that if I simply implement IFormVisitorParticipant.processChildren, it is not enough to stop the Nested form's FormValidator from firing when the main form is submitted. Therefore, I tried to implement the isEnabled technique. This did have the desired effect the first time through a page (enter data, submit main, no nested validator fires) but when the page re-renders after the submit, the nested form is now disabled! It seems that the findSubmittingButton() method finds the button that was used to submit the form, even though the page is rendering again. Another thing I noticed upon my different attempts is that altering the isEnabled method to use findSubmittingButton() won't work because findSubmittingButton() calls isEnabled()! which puts the code in an infinite loop. Could someone please enlighten me on how to code an isolated nested form using Wicket 1.4.x. Where isolated means that I want the form to have its own submit button and those fields are only submitted/processed/validated when that button is clicked. I want the form to be ignored by the parent form. This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind MSE to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested Forms
I'm sorry to bump this. At the least, can anyone point me to some code that has successfully implemented isolated, nested forms using Wicket 1.4.x? On Wed, Feb 17, 2010 at 8:43 AM, Charles Deal charles.d...@missionse.comwrote: I am attempting to put an isolated form within the main form of my page. I found http://cwiki.apache.org/WICKET/nested-forms.html which was helpful in understanding how the processing works. I was even more excited when I found http://cwiki.apache.org/WICKET/conditional-validation.html which instructed me exactly how to alter the form object to do what I wanted. Unfortunately, the trick does not work as I expected it to. It seems that if I simply implement IFormVisitorParticipant.processChildren, it is not enough to stop the Nested form's FormValidator from firing when the main form is submitted. Therefore, I tried to implement the isEnabled technique. This did have the desired effect the first time through a page (enter data, submit main, no nested validator fires) but when the page re-renders after the submit, the nested form is now disabled! It seems that the findSubmittingButton() method finds the button that was used to submit the form, even though the page is rendering again. Another thing I noticed upon my different attempts is that altering the isEnabled method to use findSubmittingButton() won't work because findSubmittingButton() calls isEnabled()! which puts the code in an infinite loop. Could someone please enlighten me on how to code an isolated nested form using Wicket 1.4.x. Where isolated means that I want the form to have its own submit button and those fields are only submitted/processed/validated when that button is clicked. I want the form to be ignored by the parent form. This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind MSE to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.
Re: Nested Forms
you cannot have an isolated embedded form, as far as html is concerned that is an oxymoron. you can try hacking around it with IFormVisitorParticipant or by overriding form.process() on your main form, etc. but i do not think this is a usecase we will support... -igor On Fri, Feb 19, 2010 at 10:09 AM, Charles Deal chuckdea...@gmail.com wrote: I'm sorry to bump this. At the least, can anyone point me to some code that has successfully implemented isolated, nested forms using Wicket 1.4.x? On Wed, Feb 17, 2010 at 8:43 AM, Charles Deal charles.d...@missionse.comwrote: I am attempting to put an isolated form within the main form of my page. I found http://cwiki.apache.org/WICKET/nested-forms.html which was helpful in understanding how the processing works. I was even more excited when I found http://cwiki.apache.org/WICKET/conditional-validation.html which instructed me exactly how to alter the form object to do what I wanted. Unfortunately, the trick does not work as I expected it to. It seems that if I simply implement IFormVisitorParticipant.processChildren, it is not enough to stop the Nested form's FormValidator from firing when the main form is submitted. Therefore, I tried to implement the isEnabled technique. This did have the desired effect the first time through a page (enter data, submit main, no nested validator fires) but when the page re-renders after the submit, the nested form is now disabled! It seems that the findSubmittingButton() method finds the button that was used to submit the form, even though the page is rendering again. Another thing I noticed upon my different attempts is that altering the isEnabled method to use findSubmittingButton() won't work because findSubmittingButton() calls isEnabled()! which puts the code in an infinite loop. Could someone please enlighten me on how to code an isolated nested form using Wicket 1.4.x. Where isolated means that I want the form to have its own submit button and those fields are only submitted/processed/validated when that button is clicked. I want the form to be ignored by the parent form. This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind MSE to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: nested forms onSubmit
VisitChildren(Form.class, ) Martijn On Friday, January 29, 2010, Dave Kallstrom dave.kallst...@gmail.com wrote: Hi, Is there anyway to notify nested forms that they are being submitted? The onSubmit method of nested forms do not get called when the parent form is submitted. I tried implementing IFormSubmitListener but that didn't seem to help. -- Dave Kallstrom -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.4 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: nested forms onSubmit
Nested forms in wicket component hierarachy. Not in html. You can nest forms in wicket which are replaced when the page is rendered and swapped out for divs. http://cwiki.apache.org/WICKET/nested-forms.html On Fri, Jan 29, 2010 at 5:38 PM, Riyad Kalla rka...@gmail.com wrote: Are nested forms a valid HTML construct? I'm running through the use-case here in my head and it doesn't click -- form submission is 1:1 with an HTTP POST, what do multiple embedded forms even mean in this regard? I don't think this is kosher... On Fri, Jan 29, 2010 at 2:04 PM, Dave Kallstrom dave.kallst...@gmail.com wrote: Hi, Is there anyway to notify nested forms that they are being submitted? The onSubmit method of nested forms do not get called when the parent form is submitted. I tried implementing IFormSubmitListener but that didn't seem to help. -- Dave Kallstrom -- Dave Kallstrom
Re: nested forms onSubmit
Are nested forms a valid HTML construct? I'm running through the use-case here in my head and it doesn't click -- form submission is 1:1 with an HTTP POST, what do multiple embedded forms even mean in this regard? I don't think this is kosher... On Fri, Jan 29, 2010 at 2:04 PM, Dave Kallstrom dave.kallst...@gmail.comwrote: Hi, Is there anyway to notify nested forms that they are being submitted? The onSubmit method of nested forms do not get called when the parent form is submitted. I tried implementing IFormSubmitListener but that didn't seem to help. -- Dave Kallstrom
Re: Nested forms : don't process inner form when outer form is submitted
In the example, the inner form is enabled only when the submitter button is that of itself (i.e. I'm submitting the inner form). In all other cases the form is always disabled: I've tried the example and in factthe form is totally disabled, I can't fill my textfield and I can't even submit the form. Something is wrong with the example? John Krasnay wrote: Have a look at the bottom of this page: http://cwiki.apache.org/WICKET/conditional-validation.html The example shown disables the whole inner form when the outer form is submitted, meaning the inner form won't even be submitted. If you want the inner form to be submitted but just not required, remove the isEnabled override and implement isRequired on your text fields with similar code. jk On Tue, Feb 10, 2009 at 12:33:00AM -0800, Marieke Vandamme wrote: Thanks for the suggestions, but I'm still not sure how to implement it. My innerform implements IFormVisitorParticipant. I override processChildren(), but how do I know which form is getting submitted??? Because when innerform is submitted, i want to return true, otherwise false. Thanks for any help!! Marieke. igor.vaynberg wrote: try letting your inner form implement IFormVisitorParticipant. another way is to override isrequired() and check for the submitting component. -igor On Mon, Feb 9, 2009 at 3:17 AM, Marieke Vandamme ma...@tvh.be wrote: Hello, I've been reading a lot about nested forms and what should happen with the inner forms when the outer form gets submitted. But I didn't found out how you can implement what i'm trying: I have inner form with some RequiredTextFields on it. These are required when the inner form is processed with an AjaxButton, but not when the outer form is submitted. How can I do this? Thanks for any help !!! Marieke. -- View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21910941.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21929547.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p24841072.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms : don't process inner form when outer form is submitted
On Thu, Aug 06, 2009 at 02:40:13AM -0700, nytrus wrote: In the example, the inner form is enabled only when the submitter button is that of itself (i.e. I'm submitting the inner form). In all other cases the form is always disabled: Yes, that is the point. I've tried the example and in factthe form is totally disabled, I can't fill my textfield and I can't even submit the form. Something is wrong with the example? The isEnabled method only controls form processing on the server. If you can't even type characters in your text field you have something else going on at the browser level. jk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms : don't process inner form when outer form is submitted
John Krasnay wrote: The isEnabled method only controls form processing on the server. If you can't even type characters in your text field you have something else going on at the browser level. Well usually in a disabled box you cannot type, no matter what browser you are using. Anyway I think we can let the fields enabled but override the isRequired(): if the submitting is the rootform just return false. In this way component is correctly displayed but validated when submitting the inner form (the one to which it belongs). -- View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p24847306.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms : don't process inner form when outer form is submitted
On Thu, Aug 06, 2009 at 07:09:20AM -0700, nytrus wrote: John Krasnay wrote: The isEnabled method only controls form processing on the server. If you can't even type characters in your text field you have something else going on at the browser level. Well usually in a disabled box you cannot type, no matter what browser you are using. I guess I wasn't clear enough. Returning false from the form's isEnabled method should *not* disable the text field in the browser. It simply disables the default processing for the form. You should still be able to enter a value in the text field, but it won't be validated and the backing model will not be updated. Perhaps you are mistakenly overriding the text field's isEnabled method instead. Note that the text field's isEnabled is queried at render time, well before you know which button was pressed. Anyway I think we can let the fields enabled but override the isRequired(): if the submitting is the rootform just return false. In this way component is correctly displayed but validated when submitting the inner form (the one to which it belongs). This might work for you, but be aware it can trip you up too, e.g. other validators on the components will still be invoked and the models for components in the nested form will still be updated. jk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms : don't process inner form when outer form is submitted
no, when a form's isenabled() returns false then all of its descendants are also disabled. when a formcomponent is disabled it adds disabled=disabled attribute, so you wont be able to use it in the browser. -igor On Thu, Aug 6, 2009 at 7:32 AM, John Krasnayj...@krasnay.ca wrote: On Thu, Aug 06, 2009 at 07:09:20AM -0700, nytrus wrote: John Krasnay wrote: The isEnabled method only controls form processing on the server. If you can't even type characters in your text field you have something else going on at the browser level. Well usually in a disabled box you cannot type, no matter what browser you are using. I guess I wasn't clear enough. Returning false from the form's isEnabled method should *not* disable the text field in the browser. It simply disables the default processing for the form. You should still be able to enter a value in the text field, but it won't be validated and the backing model will not be updated. Perhaps you are mistakenly overriding the text field's isEnabled method instead. Note that the text field's isEnabled is queried at render time, well before you know which button was pressed. Anyway I think we can let the fields enabled but override the isRequired(): if the submitting is the rootform just return false. In this way component is correctly displayed but validated when submitting the inner form (the one to which it belongs). This might work for you, but be aware it can trip you up too, e.g. other validators on the components will still be invoked and the models for components in the nested form will still be updated. jk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms : don't process inner form when outer form is submitted
Oh, is that new? Perhaps my example on the wiki is indeed fubar. jk On Thu, Aug 06, 2009 at 08:14:51AM -0700, Igor Vaynberg wrote: no, when a form's isenabled() returns false then all of its descendants are also disabled. when a formcomponent is disabled it adds disabled=disabled attribute, so you wont be able to use it in the browser. -igor On Thu, Aug 6, 2009 at 7:32 AM, John Krasnayj...@krasnay.ca wrote: On Thu, Aug 06, 2009 at 07:09:20AM -0700, nytrus wrote: John Krasnay wrote: The isEnabled method only controls form processing on the server. If you can't even type characters in your text field you have something else going on at the browser level. Well usually in a disabled box you cannot type, no matter what browser you are using. I guess I wasn't clear enough. Returning false from the form's isEnabled method should *not* disable the text field in the browser. It simply disables the default processing for the form. You should still be able to enter a value in the text field, but it won't be validated and the backing model will not be updated. Perhaps you are mistakenly overriding the text field's isEnabled method instead. Note that the text field's isEnabled is queried at render time, well before you know which button was pressed. Anyway I think we can let the fields enabled but override the isRequired(): if the submitting is the rootform just return false. In this way component is correctly displayed but validated when submitting the inner form (the one to which it belongs). This might work for you, but be aware it can trip you up too, e.g. other validators on the components will still be invoked and the models for components in the nested form will still be updated. jk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms : don't process inner form when outer form is submitted
i dont think its that new, but maybe changed since youve written your wiki. -igor On Thu, Aug 6, 2009 at 8:24 AM, John Krasnayj...@krasnay.ca wrote: Oh, is that new? Perhaps my example on the wiki is indeed fubar. jk On Thu, Aug 06, 2009 at 08:14:51AM -0700, Igor Vaynberg wrote: no, when a form's isenabled() returns false then all of its descendants are also disabled. when a formcomponent is disabled it adds disabled=disabled attribute, so you wont be able to use it in the browser. -igor On Thu, Aug 6, 2009 at 7:32 AM, John Krasnayj...@krasnay.ca wrote: On Thu, Aug 06, 2009 at 07:09:20AM -0700, nytrus wrote: John Krasnay wrote: The isEnabled method only controls form processing on the server. If you can't even type characters in your text field you have something else going on at the browser level. Well usually in a disabled box you cannot type, no matter what browser you are using. I guess I wasn't clear enough. Returning false from the form's isEnabled method should *not* disable the text field in the browser. It simply disables the default processing for the form. You should still be able to enter a value in the text field, but it won't be validated and the backing model will not be updated. Perhaps you are mistakenly overriding the text field's isEnabled method instead. Note that the text field's isEnabled is queried at render time, well before you know which button was pressed. Anyway I think we can let the fields enabled but override the isRequired(): if the submitting is the rootform just return false. In this way component is correctly displayed but validated when submitting the inner form (the one to which it belongs). This might work for you, but be aware it can trip you up too, e.g. other validators on the components will still be invoked and the models for components in the nested form will still be updated. jk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms not working in wizard.
Thanks I got it sorted. Previously I was overriding delegateSubmit to perform validation. I have moved some of my validation logic into onSubmit which has remedied the situation. On Tue, Jul 7, 2009 at 9:01 PM, nino martinez waelnino.martinez.w...@gmail.com wrote: Hi Ned I know I have something similar, but my part are working.. It's pretty hard digesting without code.. :( 2009/7/7 Ned Collyer ned.coll...@gmail.com: The nesting is - The outer form is inside the wizard, then I have an inner form inside one of the steps. Sorry, I cant show you the output of the html - I scrapped the impl I had am implementing a less wizardy wizard. On Mon, Jul 6, 2009 at 8:36 PM, nino martinez waelnino.martinez.w...@gmail.com wrote: Is the form nested in the other form in html. I remember vaguely something about it needs to be nested, wicket then rewrites it or something like that.. How does the resulting html look like? 2009/7/6 Ned Collyer ned.coll...@gmail.com: I am currently running wicket 1.4-rc2 I have nested forms setup in the wizard. One of my steps is as follows. code public class MyStep1 extends WizardStep { public MyStep1(final CompoundPropertyModelCampaign campaignModel) { super(Step 1, Wow bananas); add(new Form(form) { �...@override protected void onSubmit() { super.onSubmit(); --- never fired } }); } } /code The wizard successfully navigates between steps, and validation occurs against any fields in the nested forms. The onSubmit of the inner form is never fired - this is ... pretty annoying :) Any ideas? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms not working in wizard.
Could this be related to this issue: https://issues.apache.org/jira/browse/WICKET-2150 ? Ned Collyer wrote: The nesting is - The outer form is inside the wizard, then I have an inner form inside one of the steps. Sorry, I cant show you the output of the html - I scrapped the impl I had am implementing a less wizardy wizard. On Mon, Jul 6, 2009 at 8:36 PM, nino martinez waelnino.martinez.w...@gmail.com wrote: Is the form nested in the other form in html. I remember vaguely something about it needs to be nested, wicket then rewrites it or something like that.. How does the resulting html look like? 2009/7/6 Ned Collyer ned.coll...@gmail.com: I am currently running wicket 1.4-rc2 I have nested forms setup in the wizard. One of my steps is as follows. code public class MyStep1 extends WizardStep { public MyStep1(final CompoundPropertyModelCampaign campaignModel) { super(Step 1, Wow bananas); add(new Form(form) { @Override protected void onSubmit() { super.onSubmit(); --- never fired } }); } } /code The wizard successfully navigates between steps, and validation occurs against any fields in the nested forms. The onSubmit of the inner form is never fired - this is ... pretty annoying :) Any ideas? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms not working in wizard.
Hi Ned I know I have something similar, but my part are working.. It's pretty hard digesting without code.. :( 2009/7/7 Ned Collyer ned.coll...@gmail.com: The nesting is - The outer form is inside the wizard, then I have an inner form inside one of the steps. Sorry, I cant show you the output of the html - I scrapped the impl I had am implementing a less wizardy wizard. On Mon, Jul 6, 2009 at 8:36 PM, nino martinez waelnino.martinez.w...@gmail.com wrote: Is the form nested in the other form in html. I remember vaguely something about it needs to be nested, wicket then rewrites it or something like that.. How does the resulting html look like? 2009/7/6 Ned Collyer ned.coll...@gmail.com: I am currently running wicket 1.4-rc2 I have nested forms setup in the wizard. One of my steps is as follows. code public class MyStep1 extends WizardStep { public MyStep1(final CompoundPropertyModelCampaign campaignModel) { super(Step 1, Wow bananas); add(new Form(form) { �...@override protected void onSubmit() { super.onSubmit(); --- never fired } }); } } /code The wizard successfully navigates between steps, and validation occurs against any fields in the nested forms. The onSubmit of the inner form is never fired - this is ... pretty annoying :) Any ideas? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms not working in wizard.
Is the form nested in the other form in html. I remember vaguely something about it needs to be nested, wicket then rewrites it or something like that.. How does the resulting html look like? 2009/7/6 Ned Collyer ned.coll...@gmail.com: I am currently running wicket 1.4-rc2 I have nested forms setup in the wizard. One of my steps is as follows. code public class MyStep1 extends WizardStep { public MyStep1(final CompoundPropertyModelCampaign campaignModel) { super(Step 1, Wow bananas); add(new Form(form) { �...@override protected void onSubmit() { super.onSubmit(); --- never fired } }); } } /code The wizard successfully navigates between steps, and validation occurs against any fields in the nested forms. The onSubmit of the inner form is never fired - this is ... pretty annoying :) Any ideas? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms not working in wizard.
The nesting is - The outer form is inside the wizard, then I have an inner form inside one of the steps. Sorry, I cant show you the output of the html - I scrapped the impl I had am implementing a less wizardy wizard. On Mon, Jul 6, 2009 at 8:36 PM, nino martinez waelnino.martinez.w...@gmail.com wrote: Is the form nested in the other form in html. I remember vaguely something about it needs to be nested, wicket then rewrites it or something like that.. How does the resulting html look like? 2009/7/6 Ned Collyer ned.coll...@gmail.com: I am currently running wicket 1.4-rc2 I have nested forms setup in the wizard. One of my steps is as follows. code public class MyStep1 extends WizardStep { public MyStep1(final CompoundPropertyModelCampaign campaignModel) { super(Step 1, Wow bananas); add(new Form(form) { �...@override protected void onSubmit() { super.onSubmit(); --- never fired } }); } } /code The wizard successfully navigates between steps, and validation occurs against any fields in the nested forms. The onSubmit of the inner form is never fired - this is ... pretty annoying :) Any ideas? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: nested forms and locale
like you were told, you have to add the textfield to the ajax target. also, if you want to repull the value from the model, textfield.clearinput() might do the trick. -igor On Mon, Jun 8, 2009 at 10:44 PM, msteffmst...@emercos.com wrote: Could anybody help on this - please ? Or maybe give me a hint as to where to start debugging this. I tried to follow the setLocale() to see what the behaviour of wicket is, but i guess i have to start elsewhere.. Thanks for any answer! msteff wrote: Hi, I am having problems using nested forms and changing locale. I have 2 links for changing the locale. It works until i press the AjaxButton in the inner form. Hereafter the txtField's getObject is not called anymore. What am i doing wrong ? Any suggestions ? public class ProblemPage extends WebPage { private MapString, String map = new HashMapString, String(); public ProblemPage() { map.put(en, Hello); map.put(da, Goddag); getSession().setLocale(new Locale(en, EN)); add(new Link(enLocale) { public void onClick() { getSession().setLocale(new Locale(en, EN)); } }); add(new Link(daLocale) { public void onClick() { getSession().setLocale(new Locale(da, DK)); } }); Form outerform = new Form(outerform) { protected void onSubmit() { super.onSubmit(); } }; add(outerform); TextField txtField = new TextField(txtfield,new Model() { public Object getObject() { return map.get(getSession().getLocale().getLanguage()); } public void setObject(Object o) { map.put(getSession().getLocale().getLanguage(),(String)o); } }); outerform.add(txtField); Form innerform = new Form(innerform) { protected void onSubmit() { super.onSubmit(); } }; outerform.add(innerform); AjaxButton editButton= new AjaxButton(pressmeButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }; editButton.add(new SimpleAttributeModifier(value,Press me)); // editButton.setDefaultFormProcessing(false); innerform.add(editButton); outerform.add(new AjaxButton(submitButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }); } } !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head/head body English Danish form wicket:id=outerform input type=text wicket:id=txtfield/ form wicket:id=innerform input type=button wicket:id=pressmeButton/ /form input type=button value=Save wicket:id=submitButton/ /form /body /html -- Kinds regards, Morten Steffensen - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/nested-forms-and-locale-tp23911537p23936648.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: nested forms and locale
Hello Igor, Thanks for your answer. I added the txtField to the target argument of the onSubmit of the Pressme button. It didn't help. Also seems a bit strange to me to add the fields of the outer form to the button of the inner form.. However, if i submit the outer form, then changing the locale will indirectly call the model getObject on the txtField again. It seems that submitting the inner form changes the state of the outer form so that changing the locale has no effect on its elements before the outer form is also submittet. I really appreciate any help here.. Kind regards, Morten The attached example is just for illustration. In the real application, the inner form is a component holding a list, where items can be added. Like the outer form holds the attributes of a person, and the inner form is a list of his favorit colours or what ever.. --- Added code with txtField added to the target public class ProblemPage extends WebPage { private MapString, String map = new HashMapString, String(); public ProblemPage() { map.put(en, Hello); map.put(da, Goddag); getSession().setLocale(new Locale(en)); add(new Link(enLocale) { public void onClick() { getSession().setLocale(new Locale(en)); } }); add(new Link(daLocale) { public void onClick() { getSession().setLocale(new Locale(da)); } }); Form outerform = new Form(outerform); add(outerform); final TextField txtField = new TextField(txtfield,new Model() { public Object getObject() { return map.get(getSession().getLocale().getLanguage()); } public void setObject(Object o) { map.put(getSession().getLocale().getLanguage(),(String)o); } }); outerform.add(txtField); txtField.setOutputMarkupId(true); Form innerform = new Form(innerform); outerform.add(innerform); AjaxButton editButton= new AjaxButton(pressmeButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); target.addComponent(txtField); } }; innerform.add(editButton); outerform.add(new AjaxButton(submitButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }); } } msteff wrote: Hi, I am having problems using nested forms and changing locale. I have 2 links for changing the locale. It works until i press the AjaxButton in the inner form. Hereafter the txtField's getObject is not called anymore. What am i doing wrong ? Any suggestions ? public class ProblemPage extends WebPage { private MapString, String map = new HashMapString, String(); public ProblemPage() { map.put(en, Hello); map.put(da, Goddag); getSession().setLocale(new Locale(en, EN)); add(new Link(enLocale) { public void onClick() { getSession().setLocale(new Locale(en, EN)); } }); add(new Link(daLocale) { public void onClick() { getSession().setLocale(new Locale(da, DK)); } }); Form outerform = new Form(outerform) { protected void onSubmit() { super.onSubmit(); } }; add(outerform); TextField txtField = new TextField(txtfield,new Model() { public Object getObject() { return map.get(getSession().getLocale().getLanguage()); } public void setObject(Object o) { map.put(getSession().getLocale().getLanguage(),(String)o); } }); outerform.add(txtField); Form innerform = new Form(innerform) { protected void onSubmit() { super.onSubmit(); } }; outerform.add(innerform); AjaxButton editButton= new AjaxButton(pressmeButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }; editButton.add(new SimpleAttributeModifier(value,Press me)); //editButton.setDefaultFormProcessing(false); innerform.add(editButton); outerform.add(new AjaxButton(submitButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }); } } !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head/head body English Danish form wicket:id=outerform input type=text
Re: nested forms and locale
why dont you reproduce this in a quickstart and attach it to a jira issue. on the quickstart page clearly outline what the problem is and what are the steps necessary to reproduce it. it will be much easier then discussing random snippets of code here and there. -igor On Tue, Jun 9, 2009 at 2:41 AM, msteffmst...@emercos.com wrote: Hello Igor, Thanks for your answer. I added the txtField to the target argument of the onSubmit of the Pressme button. It didn't help. Also seems a bit strange to me to add the fields of the outer form to the button of the inner form.. However, if i submit the outer form, then changing the locale will indirectly call the model getObject on the txtField again. It seems that submitting the inner form changes the state of the outer form so that changing the locale has no effect on its elements before the outer form is also submittet. I really appreciate any help here.. Kind regards, Morten The attached example is just for illustration. In the real application, the inner form is a component holding a list, where items can be added. Like the outer form holds the attributes of a person, and the inner form is a list of his favorit colours or what ever.. --- Added code with txtField added to the target public class ProblemPage extends WebPage { private MapString, String map = new HashMapString, String(); public ProblemPage() { map.put(en, Hello); map.put(da, Goddag); getSession().setLocale(new Locale(en)); add(new Link(enLocale) { public void onClick() { getSession().setLocale(new Locale(en)); } }); add(new Link(daLocale) { public void onClick() { getSession().setLocale(new Locale(da)); } }); Form outerform = new Form(outerform); add(outerform); final TextField txtField = new TextField(txtfield,new Model() { public Object getObject() { return map.get(getSession().getLocale().getLanguage()); } public void setObject(Object o) { map.put(getSession().getLocale().getLanguage(),(String)o); } }); outerform.add(txtField); txtField.setOutputMarkupId(true); Form innerform = new Form(innerform); outerform.add(innerform); AjaxButton editButton= new AjaxButton(pressmeButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); target.addComponent(txtField); } }; innerform.add(editButton); outerform.add(new AjaxButton(submitButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }); } } msteff wrote: Hi, I am having problems using nested forms and changing locale. I have 2 links for changing the locale. It works until i press the AjaxButton in the inner form. Hereafter the txtField's getObject is not called anymore. What am i doing wrong ? Any suggestions ? public class ProblemPage extends WebPage { private MapString, String map = new HashMapString, String(); public ProblemPage() { map.put(en, Hello); map.put(da, Goddag); getSession().setLocale(new Locale(en, EN)); add(new Link(enLocale) { public void onClick() { getSession().setLocale(new Locale(en, EN)); } }); add(new Link(daLocale) { public void onClick() { getSession().setLocale(new Locale(da, DK)); } }); Form outerform = new Form(outerform) { protected void onSubmit() { super.onSubmit(); } }; add(outerform); TextField txtField = new TextField(txtfield,new Model() { public Object getObject() { return map.get(getSession().getLocale().getLanguage()); } public void setObject(Object o) { map.put(getSession().getLocale().getLanguage(),(String)o); } }); outerform.add(txtField); Form innerform = new Form(innerform) { protected void onSubmit() { super.onSubmit(); } }; outerform.add(innerform); AjaxButton editButton= new AjaxButton(pressmeButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }; editButton.add(new SimpleAttributeModifier(value,Press me)); // editButton.setDefaultFormProcessing(false); innerform.add(editButton); outerform.add(new AjaxButton(submitButton) {
Re: nested forms and locale
Hello Igor, Thanks for your answers! I have made a jira issue: WICKET-2320 But... maybe this is not a bug, but rather a feature. I would just like to know how to deal with it then. Kind regards, Morten Steffensen Igor Vaynberg wrote: why dont you reproduce this in a quickstart and attach it to a jira issue. on the quickstart page clearly outline what the problem is and what are the steps necessary to reproduce it. it will be much easier then discussing random snippets of code here and there. -igor On Tue, Jun 9, 2009 at 2:41 AM, msteffmst...@emercos.com wrote: Hello Igor, Thanks for your answer. I added the txtField to the target argument of the onSubmit of the Pressme button. It didn't help. Also seems a bit strange to me to add the fields of the outer form to the button of the inner form.. However, if i submit the outer form, then changing the locale will indirectly call the model getObject on the txtField again. It seems that submitting the inner form changes the state of the outer form so that changing the locale has no effect on its elements before the outer form is also submittet. I really appreciate any help here.. Kind regards, Morten The attached example is just for illustration. In the real application, the inner form is a component holding a list, where items can be added. Like the outer form holds the attributes of a person, and the inner form is a list of his favorit colours or what ever.. --- Added code with txtField added to the target public class ProblemPage extends WebPage { private MapString, String map = new HashMapString, String(); public ProblemPage() { map.put(en, Hello); map.put(da, Goddag); getSession().setLocale(new Locale(en)); add(new Link(enLocale) { public void onClick() { getSession().setLocale(new Locale(en)); } }); add(new Link(daLocale) { public void onClick() { getSession().setLocale(new Locale(da)); } }); Form outerform = new Form(outerform); add(outerform); final TextField txtField = new TextField(txtfield,new Model() { public Object getObject() { return map.get(getSession().getLocale().getLanguage()); } public void setObject(Object o) { map.put(getSession().getLocale().getLanguage(),(String)o); } }); outerform.add(txtField); txtField.setOutputMarkupId(true); Form innerform = new Form(innerform); outerform.add(innerform); AjaxButton editButton= new AjaxButton(pressmeButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); target.addComponent(txtField); } }; innerform.add(editButton); outerform.add(new AjaxButton(submitButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }); } } msteff wrote: Hi, I am having problems using nested forms and changing locale. I have 2 links for changing the locale. It works until i press the AjaxButton in the inner form. Hereafter the txtField's getObject is not called anymore. What am i doing wrong ? Any suggestions ? public class ProblemPage extends WebPage { private MapString, String map = new HashMapString, String(); public ProblemPage() { map.put(en, Hello); map.put(da, Goddag); getSession().setLocale(new Locale(en, EN)); add(new Link(enLocale) { public void onClick() { getSession().setLocale(new Locale(en, EN)); } }); add(new Link(daLocale) { public void onClick() { getSession().setLocale(new Locale(da, DK)); } }); Form outerform = new Form(outerform) { protected void onSubmit() { super.onSubmit(); } }; add(outerform); TextField txtField = new TextField(txtfield,new Model() { public Object getObject() { return map.get(getSession().getLocale().getLanguage()); } public void setObject(Object o) { map.put(getSession().getLocale().getLanguage(),(String)o); } }); outerform.add(txtField); Form innerform = new Form(innerform) { protected void onSubmit() { super.onSubmit(); } }; outerform.add(innerform); AjaxButton editButton= new AjaxButton(pressmeButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }; editButton.add(new SimpleAttributeModifier(value,Press me)); //
Re: nested forms and locale
Could anybody help on this - please ? Or maybe give me a hint as to where to start debugging this. I tried to follow the setLocale() to see what the behaviour of wicket is, but i guess i have to start elsewhere.. Thanks for any answer! msteff wrote: Hi, I am having problems using nested forms and changing locale. I have 2 links for changing the locale. It works until i press the AjaxButton in the inner form. Hereafter the txtField's getObject is not called anymore. What am i doing wrong ? Any suggestions ? public class ProblemPage extends WebPage { private MapString, String map = new HashMapString, String(); public ProblemPage() { map.put(en, Hello); map.put(da, Goddag); getSession().setLocale(new Locale(en, EN)); add(new Link(enLocale) { public void onClick() { getSession().setLocale(new Locale(en, EN)); } }); add(new Link(daLocale) { public void onClick() { getSession().setLocale(new Locale(da, DK)); } }); Form outerform = new Form(outerform) { protected void onSubmit() { super.onSubmit(); } }; add(outerform); TextField txtField = new TextField(txtfield,new Model() { public Object getObject() { return map.get(getSession().getLocale().getLanguage()); } public void setObject(Object o) { map.put(getSession().getLocale().getLanguage(),(String)o); } }); outerform.add(txtField); Form innerform = new Form(innerform) { protected void onSubmit() { super.onSubmit(); } }; outerform.add(innerform); AjaxButton editButton= new AjaxButton(pressmeButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }; editButton.add(new SimpleAttributeModifier(value,Press me)); //editButton.setDefaultFormProcessing(false); innerform.add(editButton); outerform.add(new AjaxButton(submitButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }); } } !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head/head body English Danish form wicket:id=outerform input type=text wicket:id=txtfield/ form wicket:id=innerform input type=button wicket:id=pressmeButton/ /form input type=button value=Save wicket:id=submitButton/ /form /body /html -- Kinds regards, Morten Steffensen - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/nested-forms-and-locale-tp23911537p23936648.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: nested forms and locale
i may be wrong about this because my wicket ajax is still a bit shaky, but try adding the components you wanted updated to the links target. - Brill On 7-Jun-09, at 10:20 AM, Morten Steffensen wrote: Hi, I am having problems using nested forms and changing locale. I have 2 links for changing the locale. It works until i press the AjaxButton in the inner form. Hereafter the txtField's getObject is not called anymore. What am i doing wrong ? Any suggestions ? public class ProblemPage extends WebPage { private MapString, String map = new HashMapString, String(); public ProblemPage() { map.put(en, Hello); map.put(da, Goddag); getSession().setLocale(new Locale(en, EN)); add(new Link(enLocale) { public void onClick() { getSession().setLocale(new Locale(en, EN)); } }); add(new Link(daLocale) { public void onClick() { getSession().setLocale(new Locale(da, DK)); } }); Form outerform = new Form(outerform) { protected void onSubmit() { super.onSubmit(); } }; add(outerform); TextField txtField = new TextField(txtfield,new Model() { public Object getObject() { return map.get(getSession().getLocale().getLanguage()); } public void setObject(Object o) { map.put(getSession().getLocale().getLanguage(), (String)o); } }); outerform.add(txtField); Form innerform = new Form(innerform) { protected void onSubmit() { super.onSubmit(); } }; outerform.add(innerform); AjaxButton editButton= new AjaxButton(pressmeButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }; editButton.add(new SimpleAttributeModifier(value,Press me)); //editButton.setDefaultFormProcessing(false); innerform.add(editButton); outerform.add(new AjaxButton(submitButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }); } } !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head/head body a wicket:id=enLocaleEnglish/a a wicket:id=daLocaleDanish/a form wicket:id=outerform input type=text wicket:id=txtfield/ form wicket:id=innerform input type=button wicket:id=pressmeButton/ /form input type=button value=Save wicket:id=submitButton/ /form /body /html -- Kinds regards, Morten Steffensen - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: nested forms and locale
Well - when I click one of the links for changing the locale, after i hit the Press me button, the onClick method gets called, and the setLocale gets called. Then i thought that the setLocale would mark the session as dirty and in some magic way the models getObject gets called on the items of the page.. hmm. Brill Pappin wrote: i may be wrong about this because my wicket ajax is still a bit shaky, but try adding the components you wanted updated to the links target. - Brill On 7-Jun-09, at 10:20 AM, Morten Steffensen wrote: Hi, I am having problems using nested forms and changing locale. I have 2 links for changing the locale. It works until i press the AjaxButton in the inner form. Hereafter the txtField's getObject is not called anymore. What am i doing wrong ? Any suggestions ? public class ProblemPage extends WebPage { private MapString, String map = new HashMapString, String(); public ProblemPage() { map.put(en, Hello); map.put(da, Goddag); getSession().setLocale(new Locale(en, EN)); add(new Link(enLocale) { public void onClick() { getSession().setLocale(new Locale(en, EN)); } }); add(new Link(daLocale) { public void onClick() { getSession().setLocale(new Locale(da, DK)); } }); Form outerform = new Form(outerform) { protected void onSubmit() { super.onSubmit(); } }; add(outerform); TextField txtField = new TextField(txtfield,new Model() { public Object getObject() { return map.get(getSession().getLocale().getLanguage()); } public void setObject(Object o) { map.put(getSession().getLocale().getLanguage(),(String)o); } }); outerform.add(txtField); Form innerform = new Form(innerform) { protected void onSubmit() { super.onSubmit(); } }; outerform.add(innerform); AjaxButton editButton= new AjaxButton(pressmeButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }; editButton.add(new SimpleAttributeModifier(value,Press me)); //editButton.setDefaultFormProcessing(false); innerform.add(editButton); outerform.add(new AjaxButton(submitButton) { protected void onSubmit(AjaxRequestTarget target, Form form) { super.onSubmit(); } }); } } !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head/head body a wicket:id=enLocaleEnglish/a a wicket:id=daLocaleDanish/a form wicket:id=outerform input type=text wicket:id=txtfield/ form wicket:id=innerform input type=button wicket:id=pressmeButton/ /form input type=button value=Save wicket:id=submitButton/ /form /body /html -- Kinds regards, Morten Steffensen - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Med venlig hilsen / kinds regards, Morten Steffensen Emercos ApS www.emercos.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms : don't process inner form when outer form is submitted
Thanks for the suggestions, but I'm still not sure how to implement it. My innerform implements IFormVisitorParticipant. I override processChildren(), but how do I know which form is getting submitted??? Because when innerform is submitted, i want to return true, otherwise false. Thanks for any help!! Marieke. igor.vaynberg wrote: try letting your inner form implement IFormVisitorParticipant. another way is to override isrequired() and check for the submitting component. -igor On Mon, Feb 9, 2009 at 3:17 AM, Marieke Vandamme ma...@tvh.be wrote: Hello, I've been reading a lot about nested forms and what should happen with the inner forms when the outer form gets submitted. But I didn't found out how you can implement what i'm trying: I have inner form with some RequiredTextFields on it. These are required when the inner form is processed with an AjaxButton, but not when the outer form is submitted. How can I do this? Thanks for any help !!! Marieke. -- View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21910941.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21929547.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms : don't process inner form when outer form is submitted
Have a look at the bottom of this page: http://cwiki.apache.org/WICKET/conditional-validation.html The example shown disables the whole inner form when the outer form is submitted, meaning the inner form won't even be submitted. If you want the inner form to be submitted but just not required, remove the isEnabled override and implement isRequired on your text fields with similar code. jk On Tue, Feb 10, 2009 at 12:33:00AM -0800, Marieke Vandamme wrote: Thanks for the suggestions, but I'm still not sure how to implement it. My innerform implements IFormVisitorParticipant. I override processChildren(), but how do I know which form is getting submitted??? Because when innerform is submitted, i want to return true, otherwise false. Thanks for any help!! Marieke. igor.vaynberg wrote: try letting your inner form implement IFormVisitorParticipant. another way is to override isrequired() and check for the submitting component. -igor On Mon, Feb 9, 2009 at 3:17 AM, Marieke Vandamme ma...@tvh.be wrote: Hello, I've been reading a lot about nested forms and what should happen with the inner forms when the outer form gets submitted. But I didn't found out how you can implement what i'm trying: I have inner form with some RequiredTextFields on it. These are required when the inner form is processed with an AjaxButton, but not when the outer form is submitted. How can I do this? Thanks for any help !!! Marieke. -- View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21910941.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21929547.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms : don't process inner form when outer form is submitted
try letting your inner form implement IFormVisitorParticipant. another way is to override isrequired() and check for the submitting component. -igor On Mon, Feb 9, 2009 at 3:17 AM, Marieke Vandamme ma...@tvh.be wrote: Hello, I've been reading a lot about nested forms and what should happen with the inner forms when the outer form gets submitted. But I didn't found out how you can implement what i'm trying: I have inner form with some RequiredTextFields on it. These are required when the inner form is processed with an AjaxButton, but not when the outer form is submitted. How can I do this? Thanks for any help !!! Marieke. -- View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21910941.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Nested forms and IndicatingAjaxSubmitButton - multiple issues
After spending a day or so on this issue, I finally figured out and found a bug in wicket-ajax.js. I am curious to know why I didnt get any responses from the Wicket developer(s), at least who had originally coded this portion, as I had asked for help couple of times. This will help me (and may be others) in future on if/when/how to get answers to the issues/posts here. Ritesh Trivedi wrote: Hi, I have IndicatingAjaxButton in a form within a panel, panel itself is inside another wrapper form on the enclosing page. Seems like I get really weird behavior based on how many forms I have on the page - even though the ajaxsubmit button's form hierarchy doesnt really change. Condition 1: When there are 2 forms - indicatingajaxbutton - form - panel - form - page In both IE and FF onSubmit() of the indicatingajaxbutton gets called correctly - but entire page gets reloaded instead of just updating the targets added to the ajaxtarget. Even though the containing page in the above hierarchy is bookmarkable page In IE the url changes to wicket:interface::10:2 etc. Condition 2: When there are atleast 3 forms - indicatingajaxbutton - form - panel - form1, form2 (at the same level) - page In FF most of the time it works correctly - although every now and then I do see the loadabledetachable model load method not even called for the updating components In IE 7 - Dont get a call to onSubmit() for indicatingajaxbutton at all but the page reloads and again even though the page is bookmarkable - wicket:interface url shows with the bumped version number Can someone think of any work arounds while this gets looked at? -- View this message in context: http://www.nabble.com/Nested-forms-and-IndicatingAjaxSubmitButton---multiple-issues-tp19190442p19226103.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested forms and IndicatingAjaxSubmitButton - multiple issues
Anyone? Ritesh Trivedi wrote: Hi, I have IndicatingAjaxButton in a form within a panel, panel itself is inside another wrapper form on the enclosing page. Seems like I get really weird behavior based on how many forms I have on the page - even though the ajaxsubmit button's form hierarchy doesnt really change. Condition 1: When there are 2 forms - indicatingajaxbutton - form - panel - form - page In both IE and FF onSubmit() of the indicatingajaxbutton gets called correctly - but entire page gets reloaded instead of just updating the targets added to the ajaxtarget. Even though the containing page in the above hierarchy is bookmarkable page In IE the url changes to wicket:interface::10:2 etc. Condition 2: When there are atleast 3 forms - indicatingajaxbutton - form - panel - form1, form2 (at the same level) - page In FF most of the time it works correctly - although every now and then I do see the loadabledetachable model load method not even called for the updating components In IE 7 - Dont get a call to onSubmit() for indicatingajaxbutton at all but the page reloads and again even though the page is bookmarkable - wicket:interface url shows with the bumped version number Can someone think of any work arounds while this gets looked at? -- View this message in context: http://www.nabble.com/Nested-forms-and-IndicatingAjaxSubmitButton---multiple-issues-tp19190442p19209963.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested forms
On Mon, Aug 18, 2008 at 11:10:29PM +0200, Matej Knopp wrote: Can't you just override isEnabled() on the inner form and return true/false depending on whether the inner form should be processed? Hrm, something like this I suppose? public boolean isEnabled() { return findFormSubmittingButton().getForm() == this; } I'll give it a try. Thanks! jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested forms
On Tue, Aug 19, 2008 at 09:15:55AM -0400, John Krasnay wrote: On Mon, Aug 18, 2008 at 11:10:29PM +0200, Matej Knopp wrote: Can't you just override isEnabled() on the inner form and return true/false depending on whether the inner form should be processed? Hrm, something like this I suppose? public boolean isEnabled() { return findFormSubmittingButton().getForm() == this; } I'll give it a try. Thanks! jk It should be like this... @Override public boolean isEnabled() { return getRootForm().findSubmittingButton().getForm() == this; } ...but it works fine. I've updated the wiki with an example. Thanks again, Matej. jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested forms
Can't you just override isEnabled() on the inner form and return true/false depending on whether the inner form should be processed? -Matej On Mon, Aug 18, 2008 at 10:42 PM, John Krasnay [EMAIL PROTECTED] wrote: Hi folks, I find myself occasionally using nested forms in my Wicket apps. With nested forms, when the outer form is submitted, it triggers a validation and submission of any inner forms as well. In some cases I don't want this behaviour, but instead I want the inner form and outer form to be independent of one another. The way I've approached this is to put a disabled form in between the outer form and the inner form, which effectively blocks the outer form's submission from propagating to the inner form. It works, but it's ugly. Is there a better way to do this? One thought I had was to make this an explicit setting on the Form class (e.g. setIgnoreParentSubmissions(true)), but currently I can't see a better way to do it. jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested forms problem
Hm, it seems like i can get the behaviour I expect by overiding the inner form button's onSubmit method and setting setDefaultFormProcessing(false) on it as in this code. public class Test extends WebPage { public Test() { MandatoryProductsForm outer = new MandatoryProductsForm(outerForm); NewPhoneForm inner = new NewPhoneForm(innerForm); Button innerButton = new Button(innerButton) { public void onSubmit() { ((NewPhoneForm)getForm()).onSubmit(); } }; innerButton.setDefaultFormProcessing(false); inner.add(innerButton); outer.add(new Button(outerButton)); outer.add(inner); add(outer); } class MandatoryProductsForm extends Form { MandatoryProductsForm(String s) { super(s); } protected void onSubmit() { System.err.println(Submit outer form); } } class NewPhoneForm extends Form { NewPhoneForm(String s) { super(s); } protected void onSubmit() { System.err.println(Submit inner form); } } } and this html html body TEST form wicket:id=outerForm form wicket:id=innerForm input type=submit wicket:id=innerButton value=INNER / /form input type=submit wicket:id=outerButton value=OUTER / /form /body /html Is this the way it's supposed to be done ?. My understanding was that this should happen automatically, and i suppose i will have to do my own validation on the inner form now (haven't tested that part). /Steen 2008/1/23, James Carman [EMAIL PROTECTED]: Okay, I stand corrected. We had this question come up on the Tapestry users group and I don't believe Tapestry supports it (at least it didn't). I guess I just assumed Wicket didn't either. There's another reason for me to make the switch! :) I'm going to have to go look into this. Sounds like an interesting feature and I want to see how they do it. On 1/23/08, Steen Larsen [EMAIL PROTECTED] wrote: According to the javadoc for Form it is possible because the inner form gets substituted with span tags. It says: quote Forms can be nested. You can put a form in another form. Since HTML doesn't allow nested form tags, the inner forms will be rendered using the div tag. You have to submit the inner forms using explicit components (like Button or SubmitLink), you can't rely on implicit submit behavior (by using just input type=submit that is not attached to a component). /quote It is mentioned in other threads, I just don't know what I do wrong. /Steen 2008/1/23, James Carman [EMAIL PROTECTED]: http://www.thescripts.com/forum/thread95602.html On 1/23/08, Steen Larsen [EMAIL PROTECTED] wrote: Hi, I have seen that nested forms should be possible in Wicket 1.3, so i have tried to use it in one of my projects, but for some reason when submitting the inner form, only the outer form submit method is run. The code looks something like this: In a WebPage class MandatoryProductsForm form = new MandatoryProductsForm(mandatoryProductsForm); add(form); Order order = getOrder(); form.setModel(new CompoundPropertyModel(order)); NewPhoneForm pForm = new NewPhoneForm(phoneForm); pForm.add(new Button(searchPhone)); form.add(pForm); where the forms are class MandatoryProductsForm extends Form { MandatoryProductsForm(String s) { super(s); } protected void onSubmit() { Order order = (Order) getModelObject(); System.err.println(pn = + order.getNewPhoneNumber()); setOrder(order); setResponsePage(AdditionalProducts.class); } } class NewPhoneForm extends Form { NewPhoneForm(String s) { super(s); } protected void onSubmit() { System.err.println(Submit inner form); } } and the html is form wicket:id=mandatoryProductsForm form wicket:id=phoneForm input type=submit wicket:id=searchPhone value=Soslash;g/ /form input type=submit name=continue value=Videre /form when pressing the searchPhone button I would expect the NewPhoneForm's onSubmit method to be run but that doesn't happen. Anyone know why ? /Steen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested forms problem
http://www.thescripts.com/forum/thread95602.html On 1/23/08, Steen Larsen [EMAIL PROTECTED] wrote: Hi, I have seen that nested forms should be possible in Wicket 1.3, so i have tried to use it in one of my projects, but for some reason when submitting the inner form, only the outer form submit method is run. The code looks something like this: In a WebPage class MandatoryProductsForm form = new MandatoryProductsForm(mandatoryProductsForm); add(form); Order order = getOrder(); form.setModel(new CompoundPropertyModel(order)); NewPhoneForm pForm = new NewPhoneForm(phoneForm); pForm.add(new Button(searchPhone)); form.add(pForm); where the forms are class MandatoryProductsForm extends Form { MandatoryProductsForm(String s) { super(s); } protected void onSubmit() { Order order = (Order) getModelObject(); System.err.println(pn = + order.getNewPhoneNumber()); setOrder(order); setResponsePage(AdditionalProducts.class); } } class NewPhoneForm extends Form { NewPhoneForm(String s) { super(s); } protected void onSubmit() { System.err.println(Submit inner form); } } and the html is form wicket:id=mandatoryProductsForm form wicket:id=phoneForm input type=submit wicket:id=searchPhone value=Soslash;g/ /form input type=submit name=continue value=Videre /form when pressing the searchPhone button I would expect the NewPhoneForm's onSubmit method to be run but that doesn't happen. Anyone know why ? /Steen
Re: Nested forms problem
According to the javadoc for Form it is possible because the inner form gets substituted with span tags. It says: quote Forms can be nested. You can put a form in another form. Since HTML doesn't allow nested form tags, the inner forms will be rendered using the div tag. You have to submit the inner forms using explicit components (like Button or SubmitLink), you can't rely on implicit submit behavior (by using just input type=submit that is not attached to a component). /quote It is mentioned in other threads, I just don't know what I do wrong. /Steen 2008/1/23, James Carman [EMAIL PROTECTED]: http://www.thescripts.com/forum/thread95602.html On 1/23/08, Steen Larsen [EMAIL PROTECTED] wrote: Hi, I have seen that nested forms should be possible in Wicket 1.3, so i have tried to use it in one of my projects, but for some reason when submitting the inner form, only the outer form submit method is run. The code looks something like this: In a WebPage class MandatoryProductsForm form = new MandatoryProductsForm(mandatoryProductsForm); add(form); Order order = getOrder(); form.setModel(new CompoundPropertyModel(order)); NewPhoneForm pForm = new NewPhoneForm(phoneForm); pForm.add(new Button(searchPhone)); form.add(pForm); where the forms are class MandatoryProductsForm extends Form { MandatoryProductsForm(String s) { super(s); } protected void onSubmit() { Order order = (Order) getModelObject(); System.err.println(pn = + order.getNewPhoneNumber()); setOrder(order); setResponsePage(AdditionalProducts.class); } } class NewPhoneForm extends Form { NewPhoneForm(String s) { super(s); } protected void onSubmit() { System.err.println(Submit inner form); } } and the html is form wicket:id=mandatoryProductsForm form wicket:id=phoneForm input type=submit wicket:id=searchPhone value=Soslash;g/ /form input type=submit name=continue value=Videre /form when pressing the searchPhone button I would expect the NewPhoneForm's onSubmit method to be run but that doesn't happen. Anyone know why ? /Steen
Re: Nested forms problem
You seem to have a button in your search phone.input type=submit wicket:id=searchPhone/ The button's onSubmit method should be called. -Matej On Jan 23, 2008 3:38 PM, Steen Larsen [EMAIL PROTECTED] wrote: According to the javadoc for Form it is possible because the inner form gets substituted with span tags. It says: quote Forms can be nested. You can put a form in another form. Since HTML doesn't allow nested form tags, the inner forms will be rendered using the div tag. You have to submit the inner forms using explicit components (like Button or SubmitLink), you can't rely on implicit submit behavior (by using just input type=submit that is not attached to a component). /quote It is mentioned in other threads, I just don't know what I do wrong. /Steen 2008/1/23, James Carman [EMAIL PROTECTED]: http://www.thescripts.com/forum/thread95602.html On 1/23/08, Steen Larsen [EMAIL PROTECTED] wrote: Hi, I have seen that nested forms should be possible in Wicket 1.3, so i have tried to use it in one of my projects, but for some reason when submitting the inner form, only the outer form submit method is run. The code looks something like this: In a WebPage class MandatoryProductsForm form = new MandatoryProductsForm(mandatoryProductsForm); add(form); Order order = getOrder(); form.setModel(new CompoundPropertyModel(order)); NewPhoneForm pForm = new NewPhoneForm(phoneForm); pForm.add(new Button(searchPhone)); form.add(pForm); where the forms are class MandatoryProductsForm extends Form { MandatoryProductsForm(String s) { super(s); } protected void onSubmit() { Order order = (Order) getModelObject(); System.err.println(pn = + order.getNewPhoneNumber()); setOrder(order); setResponsePage(AdditionalProducts.class); } } class NewPhoneForm extends Form { NewPhoneForm(String s) { super(s); } protected void onSubmit() { System.err.println(Submit inner form); } } and the html is form wicket:id=mandatoryProductsForm form wicket:id=phoneForm input type=submit wicket:id=searchPhone value=Soslash;g/ /form input type=submit name=continue value=Videre /form when pressing the searchPhone button I would expect the NewPhoneForm's onSubmit method to be run but that doesn't happen. Anyone know why ? /Steen -- Resizable and reorderable grid components. http://www.inmethod.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested forms problem
The button's onSubmit gets called, but not the form's onSubmit that the button is a part of. That's what i can't figure out as the javadoc says it should only submit the inner form. /Steen 2008/1/23, Matej Knopp [EMAIL PROTECTED]: You seem to have a button in your search phone.input type=submit wicket:id=searchPhone/ The button's onSubmit method should be called. -Matej On Jan 23, 2008 3:38 PM, Steen Larsen [EMAIL PROTECTED] wrote: According to the javadoc for Form it is possible because the inner form gets substituted with span tags. It says: quote Forms can be nested. You can put a form in another form. Since HTML doesn't allow nested form tags, the inner forms will be rendered using the div tag. You have to submit the inner forms using explicit components (like Button or SubmitLink), you can't rely on implicit submit behavior (by using just input type=submit that is not attached to a component). /quote It is mentioned in other threads, I just don't know what I do wrong. /Steen 2008/1/23, James Carman [EMAIL PROTECTED]: http://www.thescripts.com/forum/thread95602.html On 1/23/08, Steen Larsen [EMAIL PROTECTED] wrote: Hi, I have seen that nested forms should be possible in Wicket 1.3, so i have tried to use it in one of my projects, but for some reason when submitting the inner form, only the outer form submit method is run. The code looks something like this: In a WebPage class MandatoryProductsForm form = new MandatoryProductsForm(mandatoryProductsForm); add(form); Order order = getOrder(); form.setModel(new CompoundPropertyModel(order)); NewPhoneForm pForm = new NewPhoneForm(phoneForm); pForm.add(new Button(searchPhone)); form.add(pForm); where the forms are class MandatoryProductsForm extends Form { MandatoryProductsForm(String s) { super(s); } protected void onSubmit() { Order order = (Order) getModelObject(); System.err.println(pn = + order.getNewPhoneNumber()); setOrder(order); setResponsePage(AdditionalProducts.class); } } class NewPhoneForm extends Form { NewPhoneForm(String s) { super(s); } protected void onSubmit() { System.err.println(Submit inner form); } } and the html is form wicket:id=mandatoryProductsForm form wicket:id=phoneForm input type=submit wicket:id=searchPhone value=Soslash;g/ /form input type=submit name=continue value=Videre /form when pressing the searchPhone button I would expect the NewPhoneForm's onSubmit method to be run but that doesn't happen. Anyone know why ? /Steen -- Resizable and reorderable grid components. http://www.inmethod.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested forms problem
Okay, I stand corrected. We had this question come up on the Tapestry users group and I don't believe Tapestry supports it (at least it didn't). I guess I just assumed Wicket didn't either. There's another reason for me to make the switch! :) I'm going to have to go look into this. Sounds like an interesting feature and I want to see how they do it. On 1/23/08, Steen Larsen [EMAIL PROTECTED] wrote: According to the javadoc for Form it is possible because the inner form gets substituted with span tags. It says: quote Forms can be nested. You can put a form in another form. Since HTML doesn't allow nested form tags, the inner forms will be rendered using the div tag. You have to submit the inner forms using explicit components (like Button or SubmitLink), you can't rely on implicit submit behavior (by using just input type=submit that is not attached to a component). /quote It is mentioned in other threads, I just don't know what I do wrong. /Steen 2008/1/23, James Carman [EMAIL PROTECTED]: http://www.thescripts.com/forum/thread95602.html On 1/23/08, Steen Larsen [EMAIL PROTECTED] wrote: Hi, I have seen that nested forms should be possible in Wicket 1.3, so i have tried to use it in one of my projects, but for some reason when submitting the inner form, only the outer form submit method is run. The code looks something like this: In a WebPage class MandatoryProductsForm form = new MandatoryProductsForm(mandatoryProductsForm); add(form); Order order = getOrder(); form.setModel(new CompoundPropertyModel(order)); NewPhoneForm pForm = new NewPhoneForm(phoneForm); pForm.add(new Button(searchPhone)); form.add(pForm); where the forms are class MandatoryProductsForm extends Form { MandatoryProductsForm(String s) { super(s); } protected void onSubmit() { Order order = (Order) getModelObject(); System.err.println(pn = + order.getNewPhoneNumber()); setOrder(order); setResponsePage(AdditionalProducts.class); } } class NewPhoneForm extends Form { NewPhoneForm(String s) { super(s); } protected void onSubmit() { System.err.println(Submit inner form); } } and the html is form wicket:id=mandatoryProductsForm form wicket:id=phoneForm input type=submit wicket:id=searchPhone value=Soslash;g/ /form input type=submit name=continue value=Videre /form when pressing the searchPhone button I would expect the NewPhoneForm's onSubmit method to be run but that doesn't happen. Anyone know why ? /Steen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]