AW: why is the model empty?
wow. Thank you! That's helped a lot! .getValue() is the key to success if you use setDefaultFormProcessing = false! - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 17:04:57 Uhr Betreff: Re: why is the model empty? Well, don't know what to tell you. It bypasses validation, which is required in order to set the models to their values. If you submitted akj123 in a text field that was an Integer, we could only set it after validation (which in this case means the value could not be set on the field). So, bypassing validation means that you must also bypass getting your models updated. You can call textfield.getValue() (or similar - can't remember exact name) to get the raw submitted value. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 10:00 AM, Peter Arnulf Lustig u...@yahoo.dewrote: mhmhm! I got this design pattern from http://cwiki.apache.org/WICKET/conditional-validation.html - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:56:38 Uhr Betreff: Re: why is the model empty? Did you look at the javadoc? [1] It says: Sets the defaultFormProcessing property. When false (default is true), all validation and form updating is bypassed and the onSubmit method of that button is called directly, and the onSubmit method of the parent form is not called. A common use for this is to create a cancel button. So, yes, that would prevent the model from being updated. [1] http://fisheye6.atlassian.com/browse/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java?r=HEAD#l118 -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:25 AM, Peter Arnulf Lustig u...@yahoo.de wrote: Does it maybe have something to do with my custom validation? I use setDefaultFormProcessing(false); because I have more submit buttons on one form - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:20:09 Uhr Betreff: Re: why is the model empty? How about! creating! a quickstart! and sending it! to us! (Oh, and no need for so many exclamation points. It could be interpreted as shouting) -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:16 AM, Peter Arnulf Lustig u...@yahoo.de wrote: hey martijn -- But there is a string submitted! Actually it must be printed! But it is null. Is the final declaration correct? - Ursprüngliche Mail Von: Martijn Dashorst martijn.dasho...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:06:22 Uhr Betreff: Re: why is the model empty? Wicket makes empty strings null by default. See one of the Application.getSettings() Martijn On Tue, Oct 20, 2009 at 4:04 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Look at the HTTP request - is the value getting submitted? -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 8:17 AM, Peter Arnulf Lustig u...@yahoo.de wrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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.0 - 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
AW: why is the model empty?
yes! I temper the data! And it is posted to the server! - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:04:21 Uhr Betreff: Re: why is the model empty? Look at the HTTP request - is the value getting submitted? -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 8:17 AM, Peter Arnulf Lustig u...@yahoo.dewrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - 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
AW: why is the model empty?
hey martijn -- But there is a string submitted! Actually it must be printed! But it is null. Is the final declaration correct? - Ursprüngliche Mail Von: Martijn Dashorst martijn.dasho...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:06:22 Uhr Betreff: Re: why is the model empty? Wicket makes empty strings null by default. See one of the Application.getSettings() Martijn On Tue, Oct 20, 2009 at 4:04 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Look at the HTTP request - is the value getting submitted? -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 8:17 AM, Peter Arnulf Lustig u...@yahoo.dewrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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.0 - 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
AW: why is the model empty?
Does it maybe have something to do with my custom validation? I use setDefaultFormProcessing(false); because I have more submit buttons on one form - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:20:09 Uhr Betreff: Re: why is the model empty? How about! creating! a quickstart! and sending it! to us! (Oh, and no need for so many exclamation points. It could be interpreted as shouting) -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:16 AM, Peter Arnulf Lustig u...@yahoo.dewrote: hey martijn -- But there is a string submitted! Actually it must be printed! But it is null. Is the final declaration correct? - Ursprüngliche Mail Von: Martijn Dashorst martijn.dasho...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:06:22 Uhr Betreff: Re: why is the model empty? Wicket makes empty strings null by default. See one of the Application.getSettings() Martijn On Tue, Oct 20, 2009 at 4:04 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Look at the HTTP request - is the value getting submitted? -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 8:17 AM, Peter Arnulf Lustig u...@yahoo.de wrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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.0 - 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
AW: why is the model empty?
I tried it also with final IModelString tagTitleModel = Model.of(); (..., tagTitleModel) But it won't work! - Ursprüngliche Mail Von: Ernesto Reinaldo Barreiro reier...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:24:16 Uhr Betreff: Re: why is the model empty? Sorry but when is the model object update? final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); just creates and in-mutable model? Or, am I missing something? Best, Ernesto On Tue, Oct 20, 2009 at 3:17 PM, Peter Arnulf Lustig u...@yahoo.dewrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - 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
AW: why is the model empty?
sets the value of the textfield programmatically on the page, and submits the form, the model should be updated by the time he gets to this onSubmit method. How do you mean that? I think wicket sets the model automaticly because the model is attached to the component. - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:28:31 Uhr Betreff: Re: why is the model empty? That's not an immutable model. It's equivalent to new ModelString() - which is fine for this use. Assuming the text field and the button are within a form, and that he sets the value of the textfield programmatically on the page, and submits the form, the model should be updated by the time he gets to this onSubmit method. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:24 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Sorry but when is the model object update? final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); just creates and in-mutable model? Or, am I missing something? Best, Ernesto On Tue, Oct 20, 2009 at 3:17 PM, Peter Arnulf Lustig u...@yahoo.de wrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - 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
AW: why is the model empty?
I am submitting a textfield in a form to wicket. Just the standard HTTP Post -- And everywhere it functions well -- I just can't get it why it won't function there. And I don't utilize any JS (Ajax etc.) for that task! It's weird. - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:40:45 Uhr Betreff: Re: why is the model empty? Yes - that's what I'm saying. On the webpage, presumably with JS, he is saying that he is setting the value of the text field. Then when it's submitted, Wicket should update the model before he gets to onSubmit -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:31 AM, Peter Arnulf Lustig u...@yahoo.dewrote: sets the value of the textfield programmatically on the page, and submits the form, the model should be updated by the time he gets to this onSubmit method. How do you mean that? I think wicket sets the model automaticly because the model is attached to the component. - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:28:31 Uhr Betreff: Re: why is the model empty? That's not an immutable model. It's equivalent to new ModelString() - which is fine for this use. Assuming the text field and the button are within a form, and that he sets the value of the textfield programmatically on the page, and submits the form, the model should be updated by the time he gets to this onSubmit method. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:24 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Sorry but when is the model object update? final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); just creates and in-mutable model? Or, am I missing something? Best, Ernesto On Tue, Oct 20, 2009 at 3:17 PM, Peter Arnulf Lustig u...@yahoo.de wrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - 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
AW: why is the model empty?
ok! Line 148 is interesting. - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:50:31 Uhr Betreff: Re: why is the model empty? Well, again, the only way for me to help you more is to supply a quickstart that reproduces this. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:49 AM, Peter Arnulf Lustig u...@yahoo.dewrote: I am submitting a textfield in a form to wicket. Just the standard HTTP Post -- And everywhere it functions well -- I just can't get it why it won't function there. And I don't utilize any JS (Ajax etc.) for that task! It's weird. - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:40:45 Uhr Betreff: Re: why is the model empty? Yes - that's what I'm saying. On the webpage, presumably with JS, he is saying that he is setting the value of the text field. Then when it's submitted, Wicket should update the model before he gets to onSubmit -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:31 AM, Peter Arnulf Lustig u...@yahoo.de wrote: sets the value of the textfield programmatically on the page, and submits the form, the model should be updated by the time he gets to this onSubmit method. How do you mean that? I think wicket sets the model automaticly because the model is attached to the component. - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:28:31 Uhr Betreff: Re: why is the model empty? That's not an immutable model. It's equivalent to new ModelString() - which is fine for this use. Assuming the text field and the button are within a form, and that he sets the value of the textfield programmatically on the page, and submits the form, the model should be updated by the time he gets to this onSubmit method. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:24 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Sorry but when is the model object update? final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); just creates and in-mutable model? Or, am I missing something? Best, Ernesto On Tue, Oct 20, 2009 at 3:17 PM, Peter Arnulf Lustig u...@yahoo.de wrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - 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 change this template, choose Tools | Templates * and open the template in the editor. */ package org.omikron.org; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import org.apache.wicket.AttributeModifier; import org.apache.wicket.PageParameters; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.ajax.markup.html.form.AjaxButton; import org.apache.wicket.behavior.SimpleAttributeModifier; import org.apache.wicket.feedback.ContainerFeedbackMessageFilter; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.IChoiceRenderer; import org.apache.wicket.markup.html.form.ListMultipleChoice; import org.apache.wicket.markup.html.form.TextArea; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.link.Link; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import
AW: why is the model empty?
mhmhm! I got this design pattern from http://cwiki.apache.org/WICKET/conditional-validation.html - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:56:38 Uhr Betreff: Re: why is the model empty? Did you look at the javadoc? [1] It says: Sets the defaultFormProcessing property. When false (default is true), all validation and form updating is bypassed and the onSubmit method of that button is called directly, and the onSubmit method of the parent form is not called. A common use for this is to create a cancel button. So, yes, that would prevent the model from being updated. [1] http://fisheye6.atlassian.com/browse/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java?r=HEAD#l118 -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:25 AM, Peter Arnulf Lustig u...@yahoo.dewrote: Does it maybe have something to do with my custom validation? I use setDefaultFormProcessing(false); because I have more submit buttons on one form - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:20:09 Uhr Betreff: Re: why is the model empty? How about! creating! a quickstart! and sending it! to us! (Oh, and no need for so many exclamation points. It could be interpreted as shouting) -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:16 AM, Peter Arnulf Lustig u...@yahoo.de wrote: hey martijn -- But there is a string submitted! Actually it must be printed! But it is null. Is the final declaration correct? - Ursprüngliche Mail Von: Martijn Dashorst martijn.dasho...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:06:22 Uhr Betreff: Re: why is the model empty? Wicket makes empty strings null by default. See one of the Application.getSettings() Martijn On Tue, Oct 20, 2009 at 4:04 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Look at the HTTP request - is the value getting submitted? -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 8:17 AM, Peter Arnulf Lustig u...@yahoo.de wrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- 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.0 - 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