Hi,
I have some UI customization that is done based on some data. In order to implement
it in a generic, reusable fashion, I am trying to generate the HTML text (including
struts tags) in a bean (called FETList below).
Scenario1 shown below works. However, Scenario2 is what I am trying to get working
and not succeeding.
Thanks for any help.
Regards
Deepak
Scenario1: Placing the code in the JSP. This works and a droplist shows up fine.
****CODE IN JSP ****
<jsp:setProperty name="FETList" property="currentKey"
value="MEMBER_DETAIL5MEM_FIELD5C5"/>
<bean:define id="dctest" name="FETList" property="myFieldChoiceList" />
<BR> New
<html:select property="contractName">
<html:options collection="dctest" property="value_cd" labelProperty="ext_desc" />
</html:select>
Scenario2: Attempting to invoke the getHTMLString() on the bean from the JSP. This
does not work. Instead of the droplist showing up, I see the actual text showing up
("<bean:define id..) What am I doing wrong? Is there some way that I need to flag an
encoding scheme?
****CODE IN JSP ****
<jsp:setProperty name="FETList" property="currentKey"
value="MEMBER_DETAIL5MEM_FIELD5C5"/>
<BR> <bean:write name="FETList" property="HTMLString" />
****CODE IN BEAN FETList that is invoked ****
public String getHTMLString() {
System.out.println("Entered getHTMLString");
String HTMLString = new String();
HTMLString = "<bean:define id=\"dctest\" name=\"FETList\"
property=\"myFieldChoiceList\" /><BR> New <html:select property=\"contractName\">
<html:options collection=\"dctest\" property=\"value_cd\" labelProperty=\"ext_desc\"
/> </html:select>";
return HTMLString ;
}
******* Confidentiality Notice *******
This email, its electronic document attachments, and the contents of its website
linkages may contain confidential health information. This information is intended
solely for use by the individual or entity to whom it is addressed. If you have
received this information in error, please notify the sender immediately and arrange
for the prompt destruction of the material and any accompanying attachments.