You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin Grigorov <mg...@apache.org> on 2014/08/04 13:02:54 UTC

Re: onfocus event getting called recursively in Apache wicket

Hi,


On Wed, Jul 30, 2014 at 7:35 PM, suvojit168 <su...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>