Re: Partial Form Submit
Re: Partial Form Submit
- Subject: Re: Partial Form Submit
- From: Ricardo Parada <email@hidden>
- Date: Wed, 30 Jan 2008 19:34:28 -0700
If I understand correctly, the check box is not included by the
browser in the form key/value pairs when unchecked. I guess that's
how browsers submit the value for a checkbox and there's nothing you
can do to change that.
However, in my application, when I do a partial submit the javascript
on the client adds an extra key called _partialSubmit to the request.
The value of _partialSubmit is a list of the elements that are part of
the submit.
If would help is WORequest had a method called
elementWasSubmitted(String elementID) which returned true by default.
Then all WO input elements would call this method from
takeValuesFromRequest() to figure out if they should process the form
values or not.
Then I could just subclass WORequest and implement
elementWasSubmitted() and figure out if a given element was submitted
by looking at the extra info in the request.
I think that would be so much easier than subclassing ALL the WO input
elements. ;-)
Ricardo
On Jan 30, 2008, at 5:22 PM, Mike Schrag wrote:
I actually have avoided putting this in Wonder because I'm really
not sure what the side-effects might be in the general case. I've
always felt like the current behavior is wrong, but I feared
changing it in case it introduced some subtle bugs somewhere, or in
case people depended on that wacky behavior. I suspect the original
WO folks made it work like this so that checkbox and the others
would work in a consistent way. The real blame is on the original
design of how unchecked checkboxes submit in HTML, but not much we
can do about that :) It is a bit a conundrum, though ... If you
change it, you always have to lug around the "oh, btw, checkboxes
don't work the same way" note.
ms
On Jan 30, 2008, at 7:17 PM, Mr. Pierre Frisch wrote:
Hi Mike,
Is this something we could fix for a future version of WO? Can you
think of any side effects? I know of the WOCheckBox one that is
pretty nasty, but for other inputs?
Pierre
--
Pierre Frisch
email@hidden
On Jan 30, 2008, at 15:20, Mike Schrag wrote:
It would be nice for example, if the WOTextField did not attempt
to set its value to null when it notices that its elementID is
not included in the form keys submitted in the request. Then
this partial form submit would just work.
IIRC, Mike said that he had problems with partial submits in the
Wonder code too.
Yeah, you have to wrap all of the WO input components and manually
make them ignore takeValuesFromRequest if its key is not in the
request. The problem here is that WOCheckBox has to work this
way, so it will never work quite right for checkboxes without
doing a bunch of trickery. You could make a custom checkbox with
a hidden field + javascript to turn the checkbox into a hidden "1"
or "0", I guess.
ms
_______________________________________________
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
_______________________________________________
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