struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject RE: html:option - is there a selected option attribute?
Date Mon, 23 Jun 2003 14:04:31 GMT
Natalie wrote:
> I will use the selectedId from the OptionsBean to set the selected option
in the list. 
> How do I do this??   I don't think the overriding the reset method is the

In the Action's execute method, set the value of that Form bean property to
whatever you want it to be.  Struts will automatically mark that value
selected when the HTML is rendered.

Here's a snippet where I set a dynamic form property to the empty String:
( (DynaActionForm) form ).set( "accompaniedByNameOrId", "" );

Wendy Smoak
Applications Systems Analyst, Sr.
Public Affairs, Information Resources Management
Arizona State University, Tempe AZ 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message