Hi,

i have a problem with handling my DynaActionsForm (Struts 1.1)and
radio-buttons.

In the JSP is a iteration over a bean (bookingPaymentTickets) that creates
radio-options.

<logic:iterate id="tickets" name="bookingPaymentTickets" scope="request">
        Price 1<html:radio property="price" value="1" styleClass="radiobutton"
indexed="true" />
        Price 2<html:radio property="price" value="2" styleClass="radiobutton"
indexed="true" />
        Price 3<html:radio property="price" value="3" styleClass="radiobutton"
indexed="true" />
        <br>
</logic:iterate>

so, for every iteration there are 3 radio-fields.

In my struts-config.xml the form is declared as following:

<form-bean name="bookingPaymentEditForm"
type="org.apache.struts.validator.DynaValidatorForm" dynamic="true">
                        <form-property name="price" type="java.lang.String[]" 
initial="1" />
</form-bean>

When I look at the HTTP-Monitor after sending the form, i see:

org.apache.struts.taglib.html.BEAN[1].price             1
org.apache.struts.taglib.html.BEAN[0].price             2

No, i want to read the values of the checkboxes in my action:

DynaActionForm form = (DynaActionForm)actionForm;
String price1 = (String) form.get("price",0);
String price2 = (String) form.get("price",1);
...

But that doesn't work :-(
I get the following StackTrace:
java.lang.ArrayIndexOutOfBoundsException
        at java.lang.reflect.Array.get(Native Method)
        at
org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:296)
        at
ticketmaker.actions.booking.bookingPaymentEditAction.execute(bookingPaymentE
ditAction.java:40)
        at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:484)
....

Anybody know where the problem is?
Does anybody know a better way to solve the problem of having mutliple lines
of radio-buttons?

Thnx

d.bieberstein


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

Reply via email to