create a custom tripleselect Struts 2 UI Component
posted 5 years ago
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 theme.properties 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.properties: 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.