Foros de discusión
Custom field drop down box value
Albert Devarajan, modificado hace 11 años.
Custom field drop down box value
New Member Mensajes: 21 Fecha de incorporación: 12/12/12 Mensajes recientes
I have developed a dropdown using custom field with some options such as A,B and C ..when I select B and save it, the value should be displayed as the selected one after i clicked the save button..How can i do that can anyone please help me??
Juhi Kumari, modificado hace 11 años.
RE: Custom field drop down box value
Expert Mensajes: 347 Fecha de incorporación: 12/12/11 Mensajes recientes
Hi,
Set that value in request in your java class and again get that value from request in your jsp ans set as selected.
Regards
Juhi
Set that value in request in your java class and again get that value from request in your jsp ans set as selected.
Regards
Juhi
Albert Devarajan, modificado hace 11 años.
RE: Custom field drop down box value
New Member Mensajes: 21 Fecha de incorporación: 12/12/12 Mensajes recientes
Hi juhi,
I followed your steps but I am not getting the result. My requirement is as below
I am having a drop down field as and when i m selecting another value it should be displayed after i clicked save button
I followed your steps but I am not getting the result. My requirement is as below
I am having a drop down field as and when i m selecting another value it should be displayed after i clicked save button
Archivos adjuntos:
Juhi Kumari, modificado hace 11 años.
RE: Custom field drop down box value
Expert Mensajes: 347 Fecha de incorporación: 12/12/11 Mensajes recientes
Hi,
For ex.
In jsp
In processAction
again in diView
and when come back to jsp
Try like this.
Regards
Juhi
For ex.
In jsp
<select name="name">
<option value="value1">Value1</option>
<option value="value2">Value2</option>
</select>
In processAction
String val = request.getParamater("name");
request.setAttribute("name",name);
again in diView
request.setAttribute("name",request.getAttribute("name"));
and when come back to jsp
<%
String name = (String)request.getAttribute("name");
%>
<select name="name">
<option value="value1" <%="(name.equalsIgnoreCase("value1"))" ? "selected" : "" %>>Value1</option>
<option value="value2" <%="(name.equalsIgnoreCase("value2"))" ? "selected" : "" %>>Value2</option>
</select>
Try like this.
Regards
Juhi
Albert Devarajan, modificado hace 11 años.
RE: Custom field drop down box value
New Member Mensajes: 21 Fecha de incorporación: 12/12/12 Mensajes recientes
Thanks a lot juhi