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 <uuuuu...@yahoo.de>wrote:

> 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 <uuuuu...@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 <uuuuu...@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.get****Settings()
> > >
> > > 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 <
> > uuuuu...@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 TextField<String> tagTitle = new TextField<String>("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
>
>

Reply via email to