That's not an immutable model.  It's equivalent to new Model<String>("") -
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 <
[email protected]> wrote:

> Sorry but when is the model object update?
> final TextField<String> tagTitle = new TextField<String>("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 <[email protected]
> >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: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>

Reply via email to