Hello,

  You can have the <html:form>...</html:form> tag in a common tiles ancestor inserting 
sub-tiles. Each sub-tiles can have tags like <html:radio> or <submit>. There is an 
example of
that in tiles documentation (tiles-doc/tutorial/invoice/*.jsp). In this example, 
editInvoice.jsp declare the form, and then insert editAddress.jsp which  use 
<html:text>.

  Hope this help,
       Cedric

Sri Sankaran wrote:

>   I am unable to use a common ancestor because some tags (such as <html:select>, 
><html:radio>) >must< be nested in a form and it doesn't recognize that this is indeed 
>the case:
>
>   Layout-Begin
>     <html:form>
>       ..
>       Body-Tile-Begin
>         <html:radio>
>       Body-Tile-End
>       ..
>       Nav-Tile-Begin
>         Previous-button
>         Next-button
>         ..
>       Nav-Tile-End
>     </html:form>
>   Layout-End
>
>   So, I am >forced< to have the form tag in the Body-Tile.  Even then I am forced to 
>use JavaScript to indicate >which< of the buttons in the Nav-Tile was pressed.
>
>   Could you elaborate on >how< you workaround it?
>
> Sri
>
> -----Original Message-----
> From: Trieu, Danny [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 24, 2002 11:33 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Struts + Tiles: Design Question
>
> Cedric,
>
> You are right on the point.  I been using this strategies over and over
> again to share from amon difference action.  I works well for me, plus I
> really hate having JavaScript or hidden field to indicate which action your
> are intended to submit.   I think this is the right way to do cuz you really
> do separate the controller logic from presentation logic, or you can say ..
> hidding the controller logic by abstracting the presentation.
>
> danny
>
> > -----Original Message-----
> > From: Cedric Dumoulin [SMTP:[EMAIL PROTECTED]]
> > Sent: Friday, May 24, 2002 3:19 AM
> > To:   Struts Users Mailing List
> > Subject:      Re: Struts + Tiles: Design Question
> >
> >
> >
> >   There is several strategies.
> >   Are you sure that you need one single form for navigation and body ?
> >
> >    *   If  navigation and body aren't related, you can put several forms,
> > only one will be selected by browser when submitting.
> >    *   If navigation and body are related, you need a common ancestor in
> > the Tiles philosophy. A common ancestor is a tiles that will insert
> > related sub-tiles. This ancestor contains the form, and sub-tiles contains
> > form's elements.
> >      In your case, you can have an ancestor body playing this role, and
> > inserting the navigation and real body
> >
> >   Hope this help,
> >
> >         Cedric
> >
> > Sri Sankaran wrote:
> >
> > > Struts version: 1.0.2
> > > Servlet engine: Tomcat 4.0.2
> > >
> > > I am trying to build a wizard framework using Tiles.  It follows the
> > standard Windows wizard metaphor with a body panel and navigation buttons
> > below.  I am running into a problem and would like any
> > opinions/suggestions.
> > >
> > > A logical use of Tiles would call for the body and nav buttons to be
> > separate tiles that are combined using the tileDefinitions file.  For
> > example:
> > >
> > >   <definition name="Wizard" path="/wizardLayout.jsp">
> > >     <put name="title"            value="Title.jsp"/>
> > >     <put name="body"          value=""/>
> > >     <put name="navigation"   value="Nav.jsp"/>
> > >   </definition>
> > >
> > >   <!-- Intro page -->
> > >   <definition name="Intro" extends="Wizard">
> > >     <put name="body"            value="workflow/intro/intro.jsp"/>
> > >   </definition>
> > >
> > > Here, the wizardLayout.jsp is solely responsible, as the name suggests,
> > for laying out the various tiles using necessary HTML tags.
> > >
> > > The problem with this strategy is that by separating the body and nav
> > into separate tiles limits the use of the Struts <html:form> tag.
> > Firstly, the begin and end form tag must be in the same JSP.  This
> > prevents the tag from beginning in the 'body' tile and ending in the
> > 'navigation' tile.  There are other complications, even if I'm willing to
> > compromise the design and place the <html:form> tag in the layout page
> > (wizardLayout.jsp above).  This would require some convoluted JavaScript
> > that sets the form's action attribute on each page.
> > >
> > > The only workaround I have found is to have the body & the navigation in
> > the same tile; in other words -- not have a 'navigation' tile at all.
> > This has a serious shortcoming in that it forces every body panel (i.e.
> > every page in the wizard) to have knowledge of layout and therefore
> > responsible for its maintenance.
> > >
> > > I really like the concept of Tiles and would love to use it to its
> > fullest.  Do you have any suggestions?  Am I missing something
> > fundamental?
> > >
> > >
> > > Sri
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to