Did you look at my second point?  I think that's probably where you're
getting caught.  I only mentioned the first point (about nullable) because
it was an obvious logic problem.

To try to be clearer about the second point, you need to take a look at the
logic that is being used to populate your object from that form data.  My
guess is that you're looking at what was submitted by the user (i.e., the
form scope) and then trying to find matching setters and calling them.  The
problem with checkboxes is that nothing is passed in the form scope when
they are left unchecked, so if my assumption above is correct, your code
isn't finding the isactive field in the form scope, and therefore is not
updating your object.  Therefore if your object has a 1 in the isactive
field prior, there will still be a 1 because the getter is never being
called.

Does that make sense?

On Fri, May 1, 2009 at 9:15 AM, Devon Burriss <de...@nervstudios.co.za>wrote:

>
> I did try it with nullable="true" and didn't get any loving from that.
> I was hoping that refresh-update="true" would force a new value, even
> if the checkbox is uncheck (ie isactive is null), and then the
> nullvalue="0" would come into effect.
> Am I missing something or could this be a bug?
>
> On May 1, 2:31 pm, Bob Silverberg <bob.silverb...@gmail.com> wrote:
> > A couple of things:
> >
> > 1. You've specified nullable="false", as well as nullvalue="0".  I
> believe
> > that the nullable="false" will make Transfer ignore the nullvalue="0", so
> > either you need to change nullable to "true", or forget about the
> nullvalue
> > as it isn't going to do anything.
> >
> > 2. Lovely checkboxes in html forms ;-)  As we all know, if a checkbox is
> > left unchecked, no value is passed through in the form scope, so I'm
> > guessing that the code that you use to populate your object isn't taking
> > that into account.  The current value (which you said is 1) is probably
> > being left unchanged when the checkbox is left unchecked.
> >
> > Bob
> >
> > On Fri, May 1, 2009 at 5:15 AM, Devon Burriss <de...@nervstudios.co.za
> >wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Is it possible to handle the occurrence of a null value purely in the
> > > config xml? I hope so as currently I have a save method in an extended
> > > cfc which populates the transfer object and does the save without me
> > > having to write any extra code, except for validation.
> >
> > > I was sure something like this would force a 0 in the column if the
> > > 'isactive' field/property/column is blank
> >
> > > <property name="isactive" type="numeric" nullable="false"
> > > nullvalue="0" refresh-update="true"/>
> >
> > > but I guess I am missing something, since no matter what I do it won't
> > > update from 1 to 0 when i edit the record and leave the checkbox blank
> > > for the edit.
> >
> > --
> > Bob Silverbergwww.silverwareconsulting.com
> >
>


-- 
Bob Silverberg
www.silverwareconsulting.com

--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to transfer-dev@googlegroups.com
To unsubscribe from this group, send email to 
transfer-dev-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to