• 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

ajax tags doesn't work properly with xhtml theme

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Would anybody like some fudge? I made it an hour ago. And it goes well with a tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic