Fórum
Custom field drop down box value
Albert Devarajan, modificado 11 Anos atrás.
Custom field drop down box value
New Member Postagens: 21 Data de Entrada: 12/12/12 Postagens Recentes
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 11 Anos atrás.
RE: Custom field drop down box value
Expert Postagens: 347 Data de Entrada: 12/12/11 Postagens Recentes
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 11 Anos atrás.
RE: Custom field drop down box value
New Member Postagens: 21 Data de Entrada: 12/12/12 Postagens Recentes
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
Anexos:
Juhi Kumari, modificado 11 Anos atrás.
RE: Custom field drop down box value
Expert Postagens: 347 Data de Entrada: 12/12/11 Postagens Recentes
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 11 Anos atrás.
RE: Custom field drop down box value
New Member Postagens: 21 Data de Entrada: 12/12/12 Postagens Recentes
Thanks a lot juhi