Re: The order in which formelements are processed
Re: The order in which formelements are processed
- Subject: Re: The order in which formelements are processed
- From: Chuck Hill <email@hidden>
- Date: Mon, 21 Apr 2003 11:52:25 -0700
There is nothing you can do with the form values that will affect this.
Each element reads its form value (by name) when
takeValuesFromRequest(WORequest, WOContext) is called on it.
takeValuesFromRequest is called on an element based on it location in the
tree of elements on the page. There is no connection between form value
ordering and the order that takeValuesFromRequest is called. IIRC, the
http standard makes no assurances about the order of form values in the
GET/POST, merely that they will appear.
The correct, IMHO, way of handling this need is as Kaj posted later: don't
do it in the set... method.
Chuck
At 11:45 AM 21/04/2003 -0500, Jonathan Rochkind wrote:
>I don't know if there's any way you can do this except making sure the
>popup button is in the form BEFORE the WOFileUpload. I'm pretty sure that
>earlier inputs get their values first.
>
>This is annoying though. What if you wanted the popup to be lower on the
>page, but still processed first? There ought to be some way to do this. But
>I'm not sure what it is. You could try looking at the
>request.formValues() stuff yourself manually, but I'm not sure how to do
>this in a useful way. It might be easier in a session-less DirectAction
>situation. And with streaming uploads, you need to be careful with the
>formValues method, if you don't deal with it right you can find the entire
>upload in memory even though you meant to stream it. I don't entirely
>understand, the whole thing is kind of confusing to me. But doing something
>tricky with request.formValues manually is the only way I can think of to
>alter the order that the elements get their values from the request.
>
>--Jonathan
>
>At 04:46 PM 4/20/2003 +0200, Kaj Hejer wrote:
>>Hi!
>>
>>In a form I have two attributes, a WOFileupload and a WOPopUpButton.
>>
>>In the WOPopUpButton you can select some metadata about the file you
uppload.
>>
>>I have bound the data binding for the WOFileupload to selectedFile.fileData.
>>
>>In the setFileData method I can do a few different things, depending on
>>what the user select in the WOPopUpButton.
>>
>> From what I can see I need the WOPopUpButton to be processed first and
>> then the WOFileupload. I have never played with the order which
>> formelemens are processed, but takeValueFromReqest seems like the right
>> place to do this.
>>
>>Has any of you any ideas on how I can controll the order my formelemens
>>are processed?
>>
>>TIA!
>>
>>
>>-Kaj :)
>>_______________________________________________
>>webobjects-dev mailing list | email@hidden
>>Help/Unsubscribe/Archives:
>>http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>>Do not post admin requests to the list. They will be ignored.
>_______________________________________________
>webobjects-dev mailing list | email@hidden
>Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>Do not post admin requests to the list. They will be ignored.
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.