This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ajax tags doesn't work properly with xhtml theme

 
Björn Wessman
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic