Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

Struts help

Thread view: 
danparker276@yahoo.com - 14 Mar 2006 20:43 GMT
I want to set the value of my select box, but can't get the value in
there.

The following, works perfect:
<html:select  property="selectedShortCodeL"  value="400">
     <html:optionsCollection name="ctform" property="shortCodeList"
label="name" value="name"/>
    </html:select>

But I want to make value dynamic.
<bean:write name="ctform" property="scSet"/>  This value is 400, but
how do I put it in the select property?

This doesn't work:
<html:select  property="selectedShortCodeL"  value="scSet">
     <html:optionsCollection name="ctform" property="shortCodeList"
label="name" value="name"/>
    </html:select>

------------------
This doesn't work:
<html:select  property="selectedShortCodeL"  name="ctform"
value="scSet">

------------------
This doesn't work (I set selectedShortCodeL=400) :
<html:select  property="selectedShortCodeL"  name="ctform"
value="selectedShortCodeL">

------------------
This doesn't work:
<html:select  property="selectedShortCodeL"   value="<bean:write
name="ctform" property="scSet"/>">
Tim Slattery - 14 Mar 2006 22:16 GMT
>I want to set the value of my select box, but can't get the value in
>there.
[quoted text clipped - 19 lines]
><html:select  property="selectedShortCodeL"  name="ctform"
>value="scSet">

Use the EL version of the tag:

<html-el:select property="selectedShortCodeL" name="ctform"
   value="${ctform.scSet}" />

--  
Tim Slattery
Slattery_T@bls.gov
Tim B - 15 Mar 2006 07:48 GMT
> I want to set the value of my select box, but can't get the value in
> there.
[quoted text clipped - 29 lines]
> <html:select  property="selectedShortCodeL"   value="<bean:write
> name="ctform" property="scSet"/>">

initialize the property "selectedShortCodeL" in your form bean to the
desired value. This can be done in initializer action or in the form bean's
reset method


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.