Hi,

On Wed, Jul 30, 2014 at 7:35 PM, suvojit168 <[email protected]> wrote:

> Hi,
>
> Thanks for replying.
>
> My requirement is to clear the textfield on onfocus (although here I was
> trying to set a string in textfield). Unless I add the component to
> ajaxtarget, how will it be updated on UI?
>
>
> Sven Meier wrote
> >>How can I get the value of actual model and not default model.
> >
> > Sorry, I don't understand that.
>
> Sorry for being vague, I wanted to understand why does doing
> *"this.getComponent().setDefaultModelObject("ChangedViaDefaultSetModel");"*
>
> change the textfield value but
> *String thisValue =
>
> this.getComponent().getDefaultModelObjectAsString();
>                                 thisValue = "ChangedNormally";*
>

Yes. You are wrong!
thisValue is just a plain local String variable. It is not connected to the
TextField component anyhow.
By doing component.setDefaultModelObject(anything) you set the new value of
the component model object.


>
> does not? I think after all both means same here. Correct me if I am wrong.
>
> Thanks
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/onfocus-event-getting-called-recursively-in-Apache-wicket-tp4666802p4666807.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to