jsp
 <s:set name="list" value="{1, 2, 3, 4, 5}"/>

 <s:radio list="%{#list}" name="list"/>

hth
martin
----------------------------------------------------------
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> Date: Fri, 23 Apr 2010 16:32:48 -0700
> From: ma...@lipinski.tk
> To: user@struts.apache.org
> Subject: Re: Dynamic list of radio buttons
> 
> Hi,
> 
> thank you for your reply.
> Taking your comments I ended with the following jsp code:
> 
> <s:form>
> <s:iterator value="results">
>       <s:property value="id" /><br />
>       <s:property value="value" /><br />
>       <s:property value="method" /><br />
>       <s:property value="doc.title" /><br />
>       <s:radio list="{1, 2, 3, 4, 5}" name="currentResult.rating" />
> </s:iterator>
> <s:submit />
> </s:form>
> 
> Having for example two datasets in results, I can only select one radio 
> button (because the name has no dynamic component in the name).
> I tried something like name="rating[%{id}]" but I fail to get these 
> parameters set in my Action class.
> 
> com.opensymphony.xwork2.ognl.OgnlValueStack  - Error setting expression 
> 'rating[1]' with value '[Ljava.lang.String;@6ae7c6d1'
> ognl.OgnlException: target is null for setProperty(null, "1", 
> [Ljava.lang.String;@6ae7c6d1)
> 
> How do the set-methods for this have to look like?
> 
> I'd prefer having a HashMap<Integer, Integer> with the key set by the id 
> from the result and the value from the radio button.
> 
> Mario
> 
> Am 23.04.10 16:10, schrieb Martin Gainty:
> > <s:radio list="availableLevels" name="currentEmployee.level"/>
> >
> >> Date: Fri, 23 Apr 2010 15:55:52 -0700
> >> From: ma...@lipinski.tk
> >> To: user@struts.apache.org
> >> Subject: Dynamic list of radio buttons
> >>
> >> Hello,
> >>
> >> I am wondering how to create a dynamic form containing a set of radio
> >> buttons.
> >>
> >> So I have an iterable list of database results. Any of the results
> >> should be rated using radio buttons.
> >>
> >> When the form is submitted I want to have a hashmap with an id as the
> >> key and the value selected with the radio buttons as value.
> >>
> >> How can I achieve this using struts2 and jsp?
> >>
> >>
> >> Mario
> 
                                          
_________________________________________________________________
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5

Reply via email to