I've done this using a combination of things.

I think onClick gets fired if you change the value - even using keyboard,
and believe this works accross browsers.

I had onClick fill in a hidden field, and submit the form.  The validate
method notices this, and throws back a single empty actionerror, and not
continue.  This causes it to get redisplayed with the correct stuff
selected!

Daniel.

> -----Original Message-----
> From: Riedling, Michael [mailto:[EMAIL PROTECTED]
> Sent: 16 December 2004 15:19
> To: [EMAIL PROTECTED]
> Subject: "dynamic" dropdown select list?
>
>
> hello,
>
> 1.)
> I want to create two dynamic dropdown lists to select main- and
> submenus of a navigation in a form.
> I fill both lists with collections, when the User chooses a value
> in the first dropdown menu (e.G. Navigation main menu), the site
> should reload and the related collection of the second dropdown
> menu (e.g. Navigation submenu) have to appear.
>
> I am not sure how to implement that, maybe its very simple and
> have nothing in common with struts. But i need some help with it please :)
>
> Can i do the reload with something like javascript onKeyPress
> etc. or are there usefull struts functions/patterns for it?
>
>
> Thx in advance
>
> Michael
>
>
>
>
>
>
> PS.
> Here is the codefragement of the two simple dropdown lists, i
> have implemented so far:
>
> <html:form action="/new" focus="title">
> <tr>
>       <td><bean:message key="new.page.form.title.label"/>:</td>
>       <td><html:text property="title"/></td>
> </tr>
> <tr>
>       <td><bean:message key="new.page.form.rootNodeId.label"/>:</td>
>       <td><html:select property="rootNodeId">
>                       <html:options collection="rootNodes"
> property="nodeName" labelProperty="nodeName"/>
>               </html:select>
>       </td>
> </tr>
> <tr>
>       <td><bean:message key="new.page.form.subNodeId.label"/>:</td>
>       <td><html:select property="subNodeId">
>               <html:options collection="nodes"
> property="nodeName" labelProperty="nodeName"/>
>               </html:select>
>       </td>
> </tr>
>
> <tr>
>       <td></td>
>       <td><html:submit>
>                       <bean:message key="new.page.form.submit.label"/>
>               </html:submit>
> <html:reset>
>                       <bean:message key="form.reset" />
>               </html:reset>
>       </td>
> </tr>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to