Ah, sorry I had no idea that you were looking at refresh-update to do that. refresh-update simply tells Transfer to query the database after an update has been done and refresh the value in the object from the database. This can be useful if you have a trigger in your database, and you want to keep your object's data in synch with the in the database.
On Fri, May 1, 2009 at 9:54 AM, Devon Burriss <[email protected]>wrote: > > You are correct about looping through the form scope. > I did realise that is the problem but I think I have misunderstood > what refresh-update="true" does. > I guess I was hoping that it would force a check for a value, and > sincce that doesn't exist it would then use the nullable value. > It's a pity as it would b a neat way of handling it. > It would probably have other ramifications though, so I guess it's > like that by design. > > Thanks for clearing up what the property options do. > > On May 1, 3:34 pm, Bob Silverberg <[email protected]> wrote: > > 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 <[email protected] > >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 <[email protected]> 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 < > [email protected] > > > >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 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en -~----------~----~----~----~------~----~------~--~---
