Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with displaytags and validations

 
Henrik Samuelsson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I looked through the topics about displaytags on this forum and on other forums but still havent found the answer to my problem. Of course I tried to solve it myself.

I use displaytags in an application and it works as it should with one mayor issue, the export to excel and pdf dont work. Displaytags doesnt work with my regex validations. I want the swedish letter �, � and � to be allowed. But when I put the displaytag filter first in web.xml the validation dont accept �,� and �, but otherwise it runs as wanted.

And if I put the displaytag after the action2-cleanup filter most of the exports dont work, but the reg ex work so I can write �, � and �.

The validations is the opensymphony validations. Here is a sample of the actionclass code and some jsp.

Action class:

@Validations(regexFields = {@RegexFieldValidator(fieldName = "firstname", message = "Ogiltigt tecken")},

JSP:

<display:table name="students" id="studentrow" class="dataTable" cellspacing="0" export="true" requestURI="" defaultsort="1">
<s:set name="myrow" value="#attr.studentrow"/>
<display:column property="id" title="Id" sortable="true"/>
<display:column property="firstname" title="F�rnamn" sortable="true" />
<display:column property="lastname" title="Efternamn" sortable="true" />
<display:column property="streetaddress" title="Gatuadress" sortable="true"/>
<display:column property="zipcode.zipcode" title="Postnr" sortable="true"/>
<display:column property="zipcode.ziparea.name" title="Postort" sortable="true"/>
<s:if test="displayInactive">
<display:column property="activestate" title="Status" sortable="true"/>
</s:if>
</display:table>

Hope you understand what I mean and that someone has an idea how to solve it.

Thanks in advance!
 
Nyanas Kandhan
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To Export the data grid to Excel and Pdf you can use display tag. You can download a sample example here. Export To Excel And PDF Using Display Tag
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic