You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Christopher Willingham <su...@maine.rr.com> on 2003/05/09 04:35:11 UTC

link vs post with tiles with tabs

Hello,

 

Using tiles & tabs, I've got a multi tab entry screen scenario where all
the tabs together constitute one unit of work.  That is, all edits apply
across all tabs and the submit button on every page goes to the same
dispatch action to update all 5 tabs together in one transaction to the
database.  It doesn't matter what tab you're on, you'll get the same
error list (each error message is prefixed by the tab name).  So I have
one form bean, one action.  But tabsLayout with tiles can't cut it here
because it uses links.  I would enter data on one tab, then tab to the
next, and then go back.  On return the first tab entered data was lost,
never getting to form in session.  This is because the tabs switch by
link not a submit, right, no data posted?  So I had to include the tabs
along with the data entry area in the same html:form by using further
tiles and then I changed tabsLayout to use html:submit by adding a few
extra parms to the tabList defines in the tiles def.  This worked, as I
switched back and forth between tabs the data posted and was saved to my
form residing in session and data changes were preserved across tabs.
But then when I switched tabs, since I was going to the same action, the
validator would run, which I didn't want.  Instead it should provide
error feedback only when the 'real'  submit button on the bottom of the
screen was hit.  So I then changed the html:submit in tabsLayout to
html:cancel so the validator wouldn't run on tabs switches.  Now
everything works very quite well thanks mostly to struts.

 

This seems ok but maybe someone knows of a cleaner way to meet this
multi-tab unit of work requirement while using tiles & tabs?  Perhaps
I'm missing something and have over-complicated things.  Any feedback
would be most appreciated.  

 

-Chris