Textfield to keep the value after being refreshed

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Textfield to keep the value after being refreshed

Anna Simbirtsev
Hi,

I refresh the page using target.addComponent(fieldName);
The value that was entered in the text field is cleared. How can I get it to
keep the value?

Thanks
Anna
Reply | Threaded
Open this post in threaded view
|

Re: Textfield to keep the value after being refreshed

Pedro Santos
Hi Anna, use an submit component like AjaxLink or AjaxButton to
interact with server. Even if you skip the default form processing by
set submitComponent.setDefaultFormProcessing(false) the input in the
fieldName will be kept.

On Wed, Jul 20, 2011 at 11:37 AM, Anna Simbirtsev <[hidden email]> wrote:
> Hi,
>
> I refresh the page using target.addComponent(fieldName);
> The value that was entered in the text field is cleared. How can I get it to
> keep the value?
>
> Thanks
> Anna
>



--
Pedro Henrique Oliveira dos Santos

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Textfield to keep the value after being refreshed

Anna Simbirtsev
I can't, because target.addComponent is called in the
AjaxFormComponentUpdatingBehavior on one of the field. But I already found a
solution. I added AjaxFormComponentUpdatingBehavior to the text field, so
that the value is kept on the server.
Thanks

On Wed, Jul 20, 2011 at 10:51 AM, Pedro Santos <[hidden email]> wrote:

> Hi Anna, use an submit component like AjaxLink or AjaxButton to
> interact with server. Even if you skip the default form processing by
> set submitComponent.setDefaultFormProcessing(false) the input in the
> fieldName will be kept.
>
> On Wed, Jul 20, 2011 at 11:37 AM, Anna Simbirtsev <[hidden email]>
> wrote:
> > Hi,
> >
> > I refresh the page using target.addComponent(fieldName);
> > The value that was entered in the text field is cleared. How can I get it
> to
> > keep the value?
> >
> > Thanks
> > Anna
> >
>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Anna Simbirtsev
(416) 729-7331
Reply | Threaded
Open this post in threaded view
|

Re: Textfield to keep the value after being refreshed

Andrea Del Bene
In reply to this post by Anna Simbirtsev
Hi,

which AJAX component are you using? is likely that your field's form is
not submitted,  hence field's model is not updated
> Hi,
>
> I refresh the page using target.addComponent(fieldName);
> The value that was entered in the text field is cleared. How can I get it to
> keep the value?
>
> Thanks
> Anna
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Textfield to keep the value after being refreshed

hariharansrc
You can use the keyword static to make the textfield's value remain after refresh or if you use any persistent frameworks the object state will be available until you destroy it.