| Author |
setting a default value for a drop-down
|
Reshmi Kuttappan
Greenhorn
Joined: May 26, 2009
Posts: 17
|
|
am using a drop-down whose values are retreived from database in ascending order...........this works fine
but now i am faced with the following problem:
on load of the screen i need to set a default value for the dropdown.........
how should i do this???
am using JSP.......
please help.....
|
 |
Praveen Sangolli
Greenhorn
Joined: May 22, 2008
Posts: 28
|
|
Hi,
can you paste the code where you are setting the values to the dropdown
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
|
|
you can do this
This way your second option will be selected by default...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
Reshmi Kuttappan
Greenhorn
Joined: May 26, 2009
Posts: 17
|
|
Hi,
I am designing Struts application and in JSP i have used <html:form>tag and for form data i used <display:table > tag.
Though my form retreives the values it is not displayed in the jsp page. Instead a "No record found" message is being displayed.
Following is the code for reference:
<display:table id="resultList" name="requestScope.resultList" pagesize="10" >
<display:column titleKey="serialno" property="serialNo"/>
</display:table>
here "resultList" contains my list of data to be displayed, "serialNo" is the property within the "resultList".
Please help ASAP.
|
 |
Praveen Sangolli
Greenhorn
Joined: May 22, 2008
Posts: 28
|
|
Try this
<ajax:displayTag ajaxFlag="true" id="displayTagList" baseUrl="SomePage.jsp">
<display:table name="sessionScope.resultList" pagesize="10" htmlId="pagedDisplayTableId" id="histListDisp" class="displaytag" >
<display:column property="serialNo" title="SL No" />
</display:table>
</ajax:displayTag>
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56202
|
|
|
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: setting a default value for a drop-down
|
|
|