Re: takeFormValuesFromRequest problem
Re: takeFormValuesFromRequest problem
- Subject: Re: takeFormValuesFromRequest problem
- From: Stephane Guyot <email@hidden>
- Date: Wed, 14 May 2008 09:20:03 +0200
Lachlan,
your trouble comes from the bias you create between the server state
and the client state.
When you modify the UI via javascript, when you add the company name
on the client side and show the company name, the server side doesn't
know that there's a new value ?
There's no elementID in the tree of component on the server side for
companyName and WebObjects doesn't know he should extract a form
value for that unknown key.
The better thing thing to do is to extract value by hand and set it
in your EO in takeValuesFromRequest ?
The same sort of trouble arise when you put an action in
conditionnal, changing the condition may impact the action call,
Chuck explanes that very well in his book.
If you remove the condition, (just for test) under Compnay Name and
show/hide the field in javascript everything works better ?
HTH,
Stephane
Le 14 mai 08 à 07:32, Lachlan Deck a écrit :
Hi Andrew,
On 14/05/2008, at 3:16 PM, Andrew Lindesay wrote:
I tend to keep the state of the toggle in the component controller
rather than the EO
It already is :-) Don't let the form value names fool you.
and then take action on the state of the toggle in a
takeValuesFromRequest(..) override.
In takeValuesFromRequest I'm simply clearing any previous errors
and calling super. I've got various validateKey methods. Strangely
the keys in question receive null when iscompany is ticked in the gui.
cheers.
got a login form that allows either a company or person to login.
The form looks like so:
[ ] is company
Company Name: [........]
First Name: [........]
Last Name: [........]
Email: [........]
Password: [........]
company name is initially hidden. Javascript toggles the
visibility of companyName vs first/lastName.
Okay - the problem:
when the form is submitted if iscompany is ticked, the company
name is set to null. i.e., validateTakeValueForKey is given null
- even though I can see that the value is there in the request's
formValues.
How do we debug this again?
___
Andrew Lindesay
www.lindesay.co.nz
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
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