On 3/13/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:

if elements are not visible they are not validated

so what you have to do is not allow the user to switch between tabs unless
everything on that tab has validated. you can do this by overriding the
linkfactory on the tabbed panel, using a submitlink, and only calling
setactivetab on the panel if everything has passed validation

if that is unacceptable - you want the user to roam freely from tab totab:

a better option for these situations imho is to not to use a serverside
tabpanel, but a clientside one. that way your entire form is written out
and the submit button submits the entire thing. a js lib like this makes
it trivial: http://www.stilbuero.de/jquery/tabs/


FYI, for others looking for a way to deal with tabbed panels and forms and
finding this very good option, I've written a small component using the
jquery tabs plugin pointed by igor. It can be used as drop in replacement of
wicket TabbedPanel where you want a client side one instead. I haven't
packaged it outside of my project for the moment, but it's open source and
available under an ASL v2 license, so feel free to use and adapt it to your
own requirements if you need.
Details are available here:
http://xhab.blogspot.com/2007/06/wicket-jquery-tab-component.html

HTH,

Xavier

-igor


On 3/13/07, Thomas R. Corbin < [EMAIL PROTECTED]> wrote:
>
> On Monday, 12 March 2007 04:37 pm, Jean-Baptiste Quenot escreveu:
> > * Thomas R. Corbin:
> > > or do you need to have each tab have it's own form?
> > >
> > > And if each  tab has it's own  form, does the user  need to save
> > > their data before switching tabs?
> > >
> > > Would the submit button be on each form, on each tab, or outside
> > > the tabs entirely?
> >
> > If all the  tab's contents are generated in the  page, you can put
> > the form around all the tabs,  so that each tab can contribute its
> > respective  input fields.   Otherwise,  if tab  contents are  only
> > rendered after  an Ajax  callback, you'd be  safer putting  a form
> > inside every tab.
>
>         How do you get all the tabs generated in one page?
>
>         The problem I'm having is that only the current tab's stuff is
> there, so I'm
> not sure how to do all the validation.
>
>         I guess I would need a form validator that validates all the
> fields of the
> object that the form allows the user to edit.
>
>         I have required fields on several different tabs, but if the
> elements of
> another tab are not visible, I'm not sure how to validate against that.
>
>         Thanks!
>
> >
> > That depends on your code actually.
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net 's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
>
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




--
Xavier Hanin - Independent Java Consultant
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to