turbine-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John McNally <jmcna...@collab.net>
Subject Re: Intake problem
Date Tue, 03 Dec 2002 22:09:41 GMT
It is a problem with the fact that intake treats an empty string as an
unset value.  I'm not sure the implications of changing this behavior.

john mcnally

On Tue, 2002-12-03 at 13:37, Quinton McCombs wrote:
> I have noticed a small problem with intake after migrating to T2.2 RC2.
> It appears that I can not set a string field to null if it already had a
> value.  Here are a few snippets from my configuration files....
>  
> intake.xml - 
>  
>     <group name="Person" key="per" mapToObject="Person">
> 
>         <field name="FirstName" key="perfn" type="String">
>             <rule name="maxlength" value="50">Maximum Length is
> 50</rule>
>             <rule name="mask" value="^[a-zA-Z\s\-]+$">Alphabetic Value
> Required</rule>
>         </field>
> 
>     </group>
> 
> schema.xml - 
>  
>     <table name="PERSON">
> 
>         <column name="FIRST_NAME" size="20" type="VARCHAR"/>
> 
>     </table>
> 
>  
> My form is initially populated with data from the Person object.  The
> field "FirstName" has a value.  I then delete the value from the field
> and submit the form.
>  
> After I get the intake tool and retreive the group, I look at the value
> of group.get("FirstName").getValue().  It is null.  I load my object
> (person) from database to make modifications to it.  The value of
> person.getFirstName() is "John".  All is well so far.
>  
> This line of code executes to update my persistent object with data from
> the group:          group.setProperties(person);
>  
> After this line of code executes, person.getFirstName() is "John".   
>  
> Other fields that were changed to non-null values were set properly
> during the execution of the method.  
>  
> After looking through the code a little, I found that
> Field.setProperty(Object) will nto eexcute the setter method unless
> Field.isSet() returns true.  Is this a defect or is there something that
> I need to change in the way I am using intake?
> 



--
To unsubscribe, e-mail:   <mailto:turbine-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-dev-help@jakarta.apache.org>


Mime
View raw message