You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniel Wu <da...@gmail.com> on 2007/12/13 19:18:55 UTC

Keep state of values between AjaxTabbedPanel tab change

Hi,
How can I keep the state of the fields of a tab (DropDownChoice and
TextField fields) when I switch tabs? I've already read the topic
http://www.nabble.com/How-to-save-page-values-between-AjaxTabbedPanel-tab-change--td12638034.html#a12638407
but I couldn't find a newtablink method to be overridden.

I have a class that extends AjaxTabbedPanel and overrides the method
newLink(), returning a AjaxFallbackLink, which I override the onClick()
method, because I need the AjaxRequestTarget object:

protected WebMarkupContainer newLink(String linkId, final int index) {
  return new AjaxFallbackLink(linkId) {
    public void onClick(AjaxRequestTarget target) {
      //--- Do stuff here
    }
  }
}

Can anyone help me to keep the state of the fields?

Thanks!
-- 
View this message in context: http://www.nabble.com/Keep-state-of-values-between-AjaxTabbedPanel-tab-change-tp14321715p14321715.html
Sent from the Wicket - User 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


Re: Keep state of values between AjaxTabbedPanel tab change

Posted by KennyS <ke...@gmail.com>.
I am trying to preserve user mods between tab selections without submitting
(as I have an AjaxTabbedPanel embedded within a single form).  My use case
is:  system displays tabbed panel with 3 tabs... user makes necessary
modifications to any of the three tabs... user submits the changes.

I am able to achieve this to some degree using a tip from this post:
http://javathoughts.capesugarbird.com/2007/06/embedding-form-inside-wicket.html,
but it does not seem to work with components backed by a detachable model.

I could actually use a solution where there is no Ajax involved... each tab
selected simple "unhides" the data already on the page, in which all data is
part of the same form.  This is probably what you mean when you said "...use
javascript tabs", but not sure how to specify javascript vs. serverside tabs
in Wicket.



igor.vaynberg wrote:
> 
> instead of returning ajaxfallbacklink return ajaxsubmitlink
> 
> or use javascript tabs rather then serverside tabs
> 
> -igor
> 
> 
> On Dec 13, 2007 10:18 AM, Daniel Wu <da...@gmail.com> wrote:
>>
>> Hi,
>> How can I keep the state of the fields of a tab (DropDownChoice and
>> TextField fields) when I switch tabs?...
> 

-- 
View this message in context: http://www.nabble.com/Keep-state-of-values-between-AjaxTabbedPanel-tab-change-tp14321715p16144951.html
Sent from the Wicket - User 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


Re: Keep state of values between AjaxTabbedPanel tab change

Posted by Daniel Wu <da...@gmail.com>.
Thanks very much!

On Dec 13, 2007 4:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:

> instead of returning ajaxfallbacklink return ajaxsubmitlink
>
> or use javascript tabs rather then serverside tabs
>
> -igor
>
>
> On Dec 13, 2007 10:18 AM, Daniel Wu <da...@gmail.com> wrote:
> >
> > Hi,
> > How can I keep the state of the fields of a tab (DropDownChoice and
> > TextField fields) when I switch tabs? I've already read the topic
> >
> http://www.nabble.com/How-to-save-page-values-between-AjaxTabbedPanel-tab-change--td12638034.html#a12638407
> > but I couldn't find a newtablink method to be overridden.
> >
> > I have a class that extends AjaxTabbedPanel and overrides the method
> > newLink(), returning a AjaxFallbackLink, which I override the onClick()
> > method, because I need the AjaxRequestTarget object:
> >
> > protected WebMarkupContainer newLink(String linkId, final int index) {
> >   return new AjaxFallbackLink(linkId) {
> >     public void onClick(AjaxRequestTarget target) {
> >       //--- Do stuff here
> >     }
> >   }
> > }
> >
> > Can anyone help me to keep the state of the fields?
> >
> > Thanks!
> > --
> > View this message in context:
> http://www.nabble.com/Keep-state-of-values-between-AjaxTabbedPanel-tab-change-tp14321715p14321715.html
> > Sent from the Wicket - User 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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Keep state of values between AjaxTabbedPanel tab change

Posted by Igor Vaynberg <ig...@gmail.com>.
instead of returning ajaxfallbacklink return ajaxsubmitlink

or use javascript tabs rather then serverside tabs

-igor


On Dec 13, 2007 10:18 AM, Daniel Wu <da...@gmail.com> wrote:
>
> Hi,
> How can I keep the state of the fields of a tab (DropDownChoice and
> TextField fields) when I switch tabs? I've already read the topic
> http://www.nabble.com/How-to-save-page-values-between-AjaxTabbedPanel-tab-change--td12638034.html#a12638407
> but I couldn't find a newtablink method to be overridden.
>
> I have a class that extends AjaxTabbedPanel and overrides the method
> newLink(), returning a AjaxFallbackLink, which I override the onClick()
> method, because I need the AjaxRequestTarget object:
>
> protected WebMarkupContainer newLink(String linkId, final int index) {
>   return new AjaxFallbackLink(linkId) {
>     public void onClick(AjaxRequestTarget target) {
>       //--- Do stuff here
>     }
>   }
> }
>
> Can anyone help me to keep the state of the fields?
>
> Thanks!
> --
> View this message in context: http://www.nabble.com/Keep-state-of-values-between-AjaxTabbedPanel-tab-change-tp14321715p14321715.html
> Sent from the Wicket - User 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
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org