This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes create a custom tripleselect Struts 2 UI Component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "create a custom tripleselect Struts 2 UI Component" Watch "create a custom tripleselect Struts 2 UI Component" New topic

create a custom tripleselect Struts 2 UI Component

Hernan Amaya

Joined: Jul 01, 2010
Posts: 7
Hi there I need to create a struts 2 UI component, particularly, I need to create a tripleselect UI component that is to say, I need a dropdown box to select a country then another to select a state and the last one to select a city... I'm using freemarker as a view technology but I would like to create this custom tag for using it also with JSP. As far as I know I have to extend org.apache.struts2.components.DoubleListUIBean, with a class called for example TripleListUIBean and then extend this last one with a class for example called TripleSelect. Besides I have to extend org.apache.struts2.views.jsp.ui.AbstractDoubleListTag with for example AbstractTripleListTag and then extend this one with for example TripleListTag as this tag is similar to the doubleselect tag I'm based on the logic of the super classes to develop the subclasses, in the case of freemarker I imagine I have to extend org.apache.struts2.views.freemarker.tags.DoubleSelectModel... Then I have to create a Theme on the folder WebContent for example /WebContent/template/myTheme/ and add a file that must have this line inside: parent=simple and then add a file named tripleselect.ftl, there I have to do the magic but as far as I know is very similar to the doubleselect.ftl so I take advantage of that. I was forgetting I also have to add this line in struts.ui.theme=myTheme. I have read somewhere that I have to create a TDL file for the JSP tag but I'm not sure about this. After that I'm supposed to use the tag in the following way in freemarker:

Is everything I have written right? I am missing any step? Can you give me any advise I may need to solve this problem? Thanks in advance.
I agree. Here's the link:
subject: create a custom tripleselect Struts 2 UI Component
jQuery in Action, 3rd edition