• 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
Re: values from request question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: values from request question


  • Subject: Re: values from request question
  • From: "Daniele Corti" <email@hidden>
  • Date: Thu, 20 Sep 2007 17:37:35 +0200



2007/9/20, Johann Werner <email@hidden>:
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.
AIM: S0CR4TE5
Messenger: email@hidden

--
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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: values from request question
      • From: Johann Werner <email@hidden>
References: 
 >values from request question (From: Johann Werner <email@hidden>)

  • Prev by Date: Strange Behavior with EOModelGroup
  • Next by Date: Re: Wonder How to get it running?
  • Previous by thread: values from request question
  • Next by thread: Re: values from request question
  • Index(es):
    • Date
    • Thread