Hi Quinton,
I get around it by coding a routine for it ...This is the gist what I do:
// Check Extension, if it's an empty String ("") then it's cleared.
Field extensionField = group.get("Extension");
if (extensionField != null) {
String extensionValue = (String)extensionField.getValue();
if ((extensionValue == null) || extensionValue.equals("")) {
contactInfo.setExtension("");
Log.debug(" >> ContactInfoAction.saveContactInfo():"
+" cleared phone extension");
}
}
Where "group" is the intake group object, "Extension" is the name of my
phone extension field in my intake.xml file, and contactInfo is my mapped
object.
Regards,
Dan
On Wed, 4 Dec 2002, Quinton McCombs wrote:
> Suppose you have a form with two fields defined on it. The value of
> those two fields comes from the value of an intake field. The data in
> the intake field came from the attributes of a mapped object (let's call
> it person).
>
> Here are the relevant field names and values on the HTML form:
> FirstName=John
> LastName=
>
> Let's now say that you change the value of the LastName field to "Smith"
> and you clear the contents of the FirstName field. You now sumbit the
> form to an action. The action gets the intake group and sets the value
> of your object with the values from the html form. You would think that
> the result of person.getFirstName() would be null or an empty string and
> that person.getLastName() would be "Smith". You are wrong.
>
> What really happens is person.getLastName() returns "Smith" and
> person.getFirstName() returns "John".
>
> I am hoping that there is a work around to this issue. I would be
> shocked if no one out there using turbine with intake has not run into
> this issue. The way it appears to me, I simply can not use an html form
> to edit data from a persistent object and save it back to the database
> if that change is to remove the value from a field.
>
> This issue exists with T2.1 and T2.2.
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>