• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

setting a default value for a drop-down

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.....
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

can you paste the code where you are setting the values to the dropdown
 
Sheriff
Posts: 9697
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Sheriff
Posts: 67663
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
 
What is that? Is that a mongol hoarde? Can we fend them off with this tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic