wood burning stoves 2.0*
The moose likes Struts and the fly likes ajax tags doesn't work properly with xhtml theme Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ajax tags doesn Watch "ajax tags doesn New topic
Author

ajax tags doesn't work properly with xhtml theme

Björn Wessman
Greenhorn

Joined: Jun 01, 2009
Posts: 21
Hi,

Since the ajax theme was removed in struts 2.1, I'm trying to use the dojo plugin with the xhtml theme. The problem is that the xhtml theme doesn't recognize the dojo tags as elements to be put in the table layout.

Here's an example of what I'm trying to do:

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<html>
<head><sx:head/></head>
<body><s:actionerror/>
<s:form action="HelloWorld" theme="xhtml" validate="true">
<s:textfield label="name" name="name" required="true"/>
<s:textfield label="age" name="age" required="true"/>
<sx:datetimepicker name="date"></sx:datetimepicker>
<s:submit method="update"/>
</s:form>
</body>
</html>

This places the datetimepicker in a div instead of a <tr><td> in the table. Isn't there any way to combine regular struts tags and dojo tags within the same theme? With the ajax theme in struts 2.0.x, this was done automatically since the ajax theme extended the xhtml theme... In order to achieve the same layout now, I would have to modify the above code and add some unwanted html tags, like this:

<s:form action="HelloWorld" theme="xhtml" validate="true">
<s:textfield label="name" name="name" required="true"/>
<s:textfield label="age" name="age" required="true"/>
<tr><td>
<sx:datetimepicker name="date"></sx:datetimepicker>
</td></tr>
<s:submit method="update"/>
</s:form>


Does anyone have a clue on how to make regular struts tags and the ajax plugin tags use the same layout theme?

BR
Björn

Beppe Catanese
Greenhorn

Joined: Nov 07, 2006
Posts: 27
Hi Björn ,
there is no <tr><td> tags in the datetimepicker.ftl (Struts2 dojo), I guess they have placed the widget in a DIV with the
idea that everybody can put/use it wherever without making an assumption that an html table is being used.
Similarly to the css_xhtml theme where each tag goes into a DIV.

You can extend a Struts theme to define your specific behavior (html code within the tags for instance).

Hope it helps.

Ciao
Beppe
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ajax tags doesn't work properly with xhtml theme
 
Similar Threads
problems validation.xml in struts 2
Dojo datetimepicker issue in Struts2.2.3.1
How to use, struts 1-- struts-config.xml and struts 2 -- struts.xml together?
Combobox question.
How the The WEB-INF/decorators.xml is linked to a jsp page made up of Struts Tags.