This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting a default value for a drop-down

 
Reshmi Kuttappan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

can you paste the code where you are setting the values to the dropdown
 
Ankit Garg
Sheriff
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can do this



This way your second option will be selected by default...
 
Reshmi Kuttappan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic