aspose file tools*
The moose likes Struts and the fly likes Client validation and tiles (nested tags) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Client validation and tiles (nested tags)" Watch "Client validation and tiles (nested tags)" New topic
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: 11962
    
    5
Try this:

[ May 24, 2004: Message edited by: Lasse Koskela ]

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Henrik Lund
Greenhorn

Joined: Nov 28, 2003
Posts: 9
Thanks. Your solution worked out nicely.

Regards
Henrik
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Client validation and tiles (nested tags)