You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Quinton McCombs <qm...@nequalsone.com> on 2002/12/03 22:37:16 UTC
Intake problem
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?
Re: Intake problem
Posted by Rodney Schneider <ro...@actf.com.au>.
On Wed, 4 Dec 2002 09:09, you wrote:
> 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
Hi John,
I have raised this issue several times in the past. I am sure I have
sent you patches to fix this problem... we use a homegrown version of
Intake here with those patches integrated and it works fine.
Do you still have the patches or should I dig them up again?
Regards,
-- Rodney
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Intake problem
Posted by Chris K Chew <ch...@fenetics.com>.
It seems to me an implication would be in cases where people have multiple
forms to populate a single object, like in a wizard. I think it might be
nice to have a switch in the <group tag that set
clearAbsentFieldValues="true|false" (false). Intake could then use some
logic to handle what Quinton has in mind, but still takes care of the cases
where people don't want the values of absent fields set to null.
Chris
> -----Original Message-----
> From: John McNally [mailto:jmcnally@collab.net]
> Sent: Tuesday, December 03, 2002 3:10 PM
> To: Turbine Developers List
> Subject: Re: Intake problem
>
>
> 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:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Intake problem
Posted by John McNally <jm...@collab.net>.
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>