• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

forms and tiles

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to include multiple tiles inside of a form?

I have two similiar forms, and would like to avoid repeating the same elements.
Is it possible to put all of the identical elements inside of a tile and then include this tile inside each form?

-Tad
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is possible.

The only catch is that the <html: tags must include the "name" attribute. The problem there is that the your forms probably have different names.
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so inside each separate tile(jsp fragment/document). I need to have the
tag? <html:form
I can't have
<html:form action="xxx">
.
.
.
<tile:insert definition="sharedFormElments"/>
.
.
.
</html:form>
in one document.

And then this in another(sharedFormElements)?
.
.
<html:text property="xy"/>
.
.


or should I use a jsp include tag? or?

-Tad
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tad Dicks:
so inside each separate tile(jsp fragment/document). I need to have the
tag? <html:form
I can't have
<html:form action="xxx">
.
.
.
<tile:insert definition="sharedFormElments"/>
.
.
.
</html:form>
in one document.

And then this in another(sharedFormElements)?
.
.
<html:text property="xy"/>
.
.


or should I use a jsp include tag? or?

-Tad



Using the JSP include tag will only help if you use a static resource, i.e. something doesn't have a ".JSP" extension. Resources that are dynamically included will be translated as a separate servlet. It's just like making a call to a method in a different class. I'm not even sure if specifying the "name" attribute will help since the struts documentation states that most of the html tags need to be nested in a html form tag.

A static include, on the other hand, is translated "in place" just as if you were copying and pasting the included code into your JSP. I usually use an ".inc" extension instead of ".jsp" for files I want to include statically.
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone give me a detailed reply on where else we can use tiles and the advantages of it..
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i'm not quite sure what you are asking but you shoudl be able to do this:

1st page


2nd page
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic