RE: [flexcoders] Date Fields and Data Binding.
Hi, Did you try the selectedDate attribute of your DateField ? selectedDateproperty selectedDate:Date [read-write] Date as selected in the DateChooser control. Accepts a Date object as a parameter. Selecting the currently selected date in the control deselects it, sets the selectedDate property to null, and then dispatches the change event. The default value is null. This property can be used as the source for data binding. Implementation public function get selectedDate():Date public function set selectedDate(value:Date):void Phil -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jsscardinal Sent: mercredi 6 décembre 2006 20:27 To: flexcoders@yahoogroups.com Subject: [flexcoders] Date Fields and Data Binding. I am attempting to do something I thought was pretty simple. Using the cairngorm model, basically I have a data instance object attached to the model, and it has a Data Object attached to it. So think of it this way. I am running an application that tracks a list of canidates. So there is a CanidateVO actionscript object, and it has a member variable attached to it called interview date, and its of type Date. I am running a java backend retrieving these using spring and hybernate, and the conversion works fine. The problem I am having is with data binding in a grid and details panel. The grid has an array collection which is attached to the model, and that array contains a list of all the canidates, some that have dates and some that dont. All have member variables, but since all instances have not interviewed they may not have a value in the date field, thus those member vars are null. So the problem is that when I have a particular grid object selected, I see the details of that canidate in the details panel, which is just a panel that contains text fields and a dateField component. Well all the other bindings are working fine, but not the dateField binding. I have set the dateFields text bound to the attribute of the object, and that does not work, and I have set the dataProvider and that does not work, and I have even set a data attribute on the dateField and that does not work. Whats happening is, when I am looking at a particular canidate without an interview date, and I select the dateField, then put a date in it and DONT save the record but go to a different instance on the grid, all the fields are updated except the dateField. The dateField text remains there regardless of the fact that the selectedItem has changed, and the new selectedItem has no date in it. Conversly if I select a canidate who does have a date, the date is displayed, but once I go to one without a date, the date stays in the field. Why is data binding not working for dates? Please help. Jeremy.
Re: [flexcoders] Date Fields and Data Binding.
Just a guess here - I just use vanilla Flex Sounds like the field is not being assigned. Since the field starts out as blank in your model, and your selecting another model with a blank field - perhaps Flex is 'short-circuiting' the assignment. I've noticed that for an assignment like "foo = bar", Flex always seems to call the getter for foo, _before_ calling the setter. I can only surmise this it to allow it to short circuit the assignment if foo = bar already. So in your case, blank == blank, and no assignment is done, hence no event fires ? On 12/6/06, jsscardinal <[EMAIL PROTECTED]> wrote: I am attempting to do something I thought was pretty simple. Using the cairngorm model, basically I have a data instance object attached to the model, and it has a Data Object attached to it. So think of it this way. I am running an application that tracks a list of canidates. So there is a CanidateVO actionscript object, and it has a member variable attached to it called interview date, and its of type Date. I am running a java backend retrieving these using spring and hybernate, and the conversion works fine. The problem I am having is with data binding in a grid and details panel. The grid has an array collection which is attached to the model, and that array contains a list of all the canidates, some that have dates and some that dont. All have member variables, but since all instances have not interviewed they may not have a value in the date field, thus those member vars are null. So the problem is that when I have a particular grid object selected, I see the details of that canidate in the details panel, which is just a panel that contains text fields and a dateField component. Well all the other bindings are working fine, but not the dateField binding. I have set the dateFields text bound to the attribute of the object, and that does not work, and I have set the dataProvider and that does not work, and I have even set a data attribute on the dateField and that does not work. Whats happening is, when I am looking at a particular canidate without an interview date, and I select the dateField, then put a date in it and DONT save the record but go to a different instance on the grid, all the fields are updated except the dateField. The dateField text remains there regardless of the fact that the selectedItem has changed, and the new selectedItem has no date in it. Conversly if I select a canidate who does have a date, the date is displayed, but once I go to one without a date, the date stays in the field. Why is data binding not working for dates? Please help. Jeremy.
[flexcoders] Date Fields and Data Binding.
I am attempting to do something I thought was pretty simple. Using the cairngorm model, basically I have a data instance object attached to the model, and it has a Data Object attached to it. So think of it this way. I am running an application that tracks a list of canidates. So there is a CanidateVO actionscript object, and it has a member variable attached to it called interview date, and its of type Date. I am running a java backend retrieving these using spring and hybernate, and the conversion works fine. The problem I am having is with data binding in a grid and details panel. The grid has an array collection which is attached to the model, and that array contains a list of all the canidates, some that have dates and some that dont. All have member variables, but since all instances have not interviewed they may not have a value in the date field, thus those member vars are null. So the problem is that when I have a particular grid object selected, I see the details of that canidate in the details panel, which is just a panel that contains text fields and a dateField component. Well all the other bindings are working fine, but not the dateField binding. I have set the dateFields text bound to the attribute of the object, and that does not work, and I have set the dataProvider and that does not work, and I have even set a data attribute on the dateField and that does not work. Whats happening is, when I am looking at a particular canidate without an interview date, and I select the dateField, then put a date in it and DONT save the record but go to a different instance on the grid, all the fields are updated except the dateField. The dateField text remains there regardless of the fact that the selectedItem has changed, and the new selectedItem has no date in it. Conversly if I select a canidate who does have a date, the date is displayed, but once I go to one without a date, the date stays in the field. Why is data binding not working for dates? Please help. Jeremy.