My jsp page display a list using logic iterate. every row displayed has a edit link too. when edit linked clicked Name will be changed to textbox so it can be edited.and sent along with commit link. html:text value i need to send with html:link.
part of my jsp is below,where I have
html:text property=”newId” value=”<%=modId%>”/> I want to pass this property as hashmap with html link as I am sending “/> as param1 Please help. or suggest any other way to do this. Thanks .
####################################################################################
<logic:equal name="mode" value ="1">
<td><bean:write name="display" property="productId"/></td>
<logic:notEqual name="edit" value="1">
<td><bean:write name="display" property="productName" /></td>
</logic:notEqual>
<logic:equal name="edit" value ="1">
<logic:equal name="display" property="productName" value ="<%=modId%>">
<td><html:text property="newId" value="<%=modId%>"/></td>
</logic:equal>
<logic:notEqual name="display" property="productName" value ="<%=modId%>">
<td><bean:write name="display" property="productName" /></td>
</logic:notEqual>
</logic:equal>
<bean:define id="param1" name="display" property="productName"/>
<%
String changedName=request.getParameter("changedName");
System.out.println(" st: " + changedName);
java.util.HashMap params = new java.util.HashMap();
if(param1!=null)
params.put("objectToEdit", param1);
params.put("abc",param1);
pageContext.setAttribute("paramsName", params);
%>
</logic:equal>
#####################################################################################
Same JSP HTML:LINK PArt
#######################################
<html:link action="Manager?edit=1" name="paramsName" onclick="return modify()">
<logic:equal name="edit" value ="1">
<logic:equal name="display" property="productName" value ="<%=modId%>">
<img src="../images/commit.png" border="0" style="background-color:blue" title=" bean:message key="commit.data"/>" >
</logic:equal>
</logic:equal>
</html:link>
Well I did it using java script.
hope my solution help someone