| Author |
Client validation and tiles (nested tags)
|
Henrik Lund
Greenhorn
Joined: Nov 28, 2003
Posts: 9
|
|
Hi! I would like to know if anyone knows how to use Javascript validation in combination with tiles in a easy and maintainable way. Now my solution looks like this: - template.jsp (HTML template containing some <tiles:get name='tile-name'/> - tiles-defs.xml (<tiles-definitions> for all my possible layouts) In order to use client-side validation with Javascript, I include the Struts html:javascript tag in my template.jsp file. This tag needs to know the name of the form to validate (formName) and since this name differs (from page to page), I must pass it in to template.jsp in some way. The only way to do it is to nest two tags, like: ... <html:javascript formName="<tiles:getAsString name='validateform'/>"/> ... But this doesn't work. The attribute 'validateform' is defined in tiles-defs.xml and prints out just fine if only <tiles:getAsString name='validateform'/> is used. Why cannot I nest two tags like above? How can I solve the problem? Regards Henrik
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11945
|
|
Try this: [ May 24, 2004: Message edited by: Lasse Koskela ]
|
Author of Test Driven (Manning Publications, 2007) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
Henrik Lund
Greenhorn
Joined: Nov 28, 2003
Posts: 9
|
|
Thanks. Your solution worked out nicely. Regards Henrik
|
 |
 |
|
|
subject: Client validation and tiles (nested tags)
|
|
|