OK. I am a little bit closer thanks to an email on this list. http://www.mail-archive.com/[EMAIL PROTECTED]/msg72240.html It looks like I need to use the nested tags to make it happen. After having tried to put it together I ended up with the same error as the last post ie java.lang.IllegalArgumentException: No bean specified
I am trying to use a Map. After many permutations my jsp code is as follows. <nested:iterate id="lr" property="propertyMap" type="java.util.Map.Entry" > <bean:define id="ky" name="lr" property="key" type="java.lang.String" /> <bean:define id="vl" name="lr" property="value" type="java.lang.String" /> <tr><td> <nested:write name="lr" property="key" /> </td><td> <% if (ky.endsWith("PWD") | ky.endsWith("PASSWORD")) { %> -----> <nested:password property="value" value="<%= vl%>" /> <% } else { %> -----> <nested:text property="value" value="<%= vl%>" /> <% } %> </td></tr> </nested:iterate> I am trying to use the Map.Entry interface which I have seen being used. Is this the right approach? I know this has been discussed a million times before but no-one has explained a really good Map example. thanks, Ralph -----Original Message----- From: RALPH ROPER [mailto:[EMAIL PROTECTED] Sent: Friday, 12 December 2003 7:16 PM To: '[EMAIL PROTECTED]' Subject: cannot populate input field within iterate tag hi, I have a fairly simple request but after many attempts I am no closer to resolving it. The problem is trying to update a property within a logic:iterate tag. The property is a Collection of PropertyRecords that live on my PropertyForm bean. The PropertyRecord class contains two properties 1) key and 2) value. I want to update the value property that is associated to a key. This key/value comibination is better suited to a Map which I tried to getting working initially but gave up on. The display of the screen works fine. It is when I go to update a value and Submit the form that it does not update the value. It looks like the name in the html:text tag name attribute is incorrect. This is the only reason why I can see that the Collection does not update with the newly entered value. In my JSP Page ITSparamsPropertyEditor.jsp <logic:iterate id="lr" name="propertyForm" property="properties" type="com.cuscal.settlements.redinet.helpClass.utilities.properties.Property Record" > <bean:define id="ky" name="lr" property="key" type="java.lang.String" /> <bean:define id="vl" name="lr" property="value" type="java.lang.String" /> <tr><td> <bean:write name="lr" property="key" /> </td><td> <% if (ky.endsWith("PWD") | ky.endsWith("PASSWORD")) { %> <html:password name="lr" property="propertyKey" value="<%= vl%>" indexed="true" /> <% } else { %> <html:text name="lr" property="key" value="<%= vl%>" indexed="true" /> <% } %> </td></tr> </logic:iterate> The PropertyEditorForm class which has the bean id propertyForm. public class PropertyEditorForm extends ActionForm { private String fileName; private List properties; /** * Returns the fileName. * @return String */ public String getFileName() { return fileName; } /** * Sets the fileName. * @param fileName The fileName to set */ public void setFileName(String fileName) { this.fileName = fileName; } public void reset( ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { fileName = "none"; // properties=null; } /** * @return */ public List getProperties() { return properties; } /** * @param map */ public void setProperties(List properties) { this.properties = properties; } public String getPropertyValue(int index) { return ((PropertyRecord) getProperties().get(index)).getValue(); } public void setPropertyValue(int index, String value) { this.properties.set(index, value); } public String getPropertyKey(int index) { return ((PropertyRecord) getProperties().get(index)).getKey(); } public void setPropertyKey(int index, String key) { this.properties.set(index, key); } } The PropertyRecord class. public class PropertyRecord { private String key; private String value; /** * @return */ public String getKey() { return key; } /** * @return */ public String getValue() { return value; } /** * @param string */ public void setKey(String string) { key = string; } /** * @param string */ public void setValue(String string) { value = string; } } Example of the HTML source that is generated. <tr><td> EXPORT_MONTHLY_FEES_PATH </td><td> <input type="text" name="lr[49].key" value="/oracle/redinet/data/export/monthlyfees/"> </td></tr> Even though I change the value of this imput field it does not update in the Collection on the form bean. Any help would be much appreciated as this is driving me crazy. If anyone knows how to do this as a Map it would be great. thanks, Ralph Roper Senior Analyst/Programmer Business Technology Services (BTS) Credit Union Services Corporation ________________________________________________________ NOTICE The information in this email and or any of the attachments may contain; a. Confidential information of Credit Union Services Corporation (Australia) Limited (CUSCAL) or third parties; and or b. Legally privileged information of CUSCAL or third parties; and or c. Copyright material of CUSCAL or third parties. If you are not an authorised recipient of this email, please contact CUSCAL immediately by return email or by telephone on 61-2-8299 9000 and delete the email from your system. We do not accept any liability in connection with computer virus, data corruption, interruption or any damage generally as a result of transmission of this email. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ________________________________________________________ NOTICE The information in this email and or any of the attachments may contain; a. Confidential information of Credit Union Services Corporation (Australia) Limited (CUSCAL) or third parties; and or b. Legally privileged information of CUSCAL or third parties; and or c. Copyright material of CUSCAL or third parties. If you are not an authorised recipient of this email, please contact CUSCAL immediately by return email or by telephone on 61-2-8299 9000 and delete the email from your system. We do not accept any liability in connection with computer virus, data corruption, interruption or any damage generally as a result of transmission of this email. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]