• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
values from request question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

values from request question


  • Subject: values from request question
  • From: Johann Werner <email@hidden>
  • Date: Thu, 20 Sep 2007 16:36:55 +0200

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?

jw

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: values from request question
      • From: "Daniele Corti" <email@hidden>
  • Prev by Date: Re: Force Refresh Relation
  • Next by Date: Problems using ERSelenium
  • Previous by thread: Re: Fetching Relation Empty
  • Next by thread: Re: values from request question
  • Index(es):
    • Date
    • Thread