2007/9/20, Johann Werner <[EMAIL PROTECTED]>:
>
> Hi all,
>
> I have a weird behaviour of takeValuesFromRequest. I have a page with
> a form that has a radio button group having values from 1 to n.
>
>
> <woform>
> <worepetition>
> <radiobutton>
> </worepetition>
> </woform>
>
> with
>
> radiobutton : WORadioButton {
> name = "reportSelect";
> value = counter;
> selection = selectedReport;
> }
>
> gives
>
> <form name="form_0_0_3_25_5" method="post" action="...">
> <input type="radio" value="1" name="reportSelect">
> <input type="radio" value="2" name="reportSelect">
> <input type="radio" value="3" name="reportSelect">
> ...
> <input type="submit" name="0.0.3.25.5.7.0">
> </form>
>
>
> selectedReport is an int variable that is set to 0 in
> appendToResponse. When I select one of the radiobuttons and submit
> the form I get the appropriate value in selectedReport for all radio
> buttons except for the first one. That is if I select the first one
> the value of selectedReport in my form action is 0 and not 1 as I
> would expect.
> I added takeValuesFromRequest to my component and by checking the
> form values in WORequest I can see that the value 1 is there but I
> don't know why just that value is not assigned to the variable. The
> only way I found to make this work is to add
>
> if (aRequest.formValueForKey("reportSelect") != null) {
> selectedReport = new Integer((String)aRequest.formValueForKey
> ("reportSelect")).intValue();
> }
>
> to takeValuesFromRequest to manually assign the value. But it should
> not be necessary to do so! So does anyone have an idea what is going
> wrong or did someone else observe that behaviour?
I could make a mistack but I think radio button take only String value, try
use selectedReport as String
jw
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/ildenae%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
>
--
Daniele Corti
AIM: S0CR4TE5
Messenger: [EMAIL PROTECTED]
--
Computers are like air conditioners -- they stop working properly if you
open
WINDOWS
--
What about the four lusers of the apocalypse? I nominate:
"advertising", "can't log in", "power switch" and "what backup?"
--Alistair Young
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]