Odd, actually I have to call it in both places in its entirety, then it works
fine. If I call the display from the double click, then fill from the complete,
it misses the selected.
But if I call it from both it works fine.
So if I do this am I always running it twice or just on the first go round then
its "Complete" ??
private function displayLoca():void{
applicationScreens.selectedChild = locaScreen;
locaName.text = locaGrid.selectedItem.NameCol;
locaField.text = locaGrid.selectedItem.FieldCol;
locaSquare.text = locaGrid.selectedItem.SquareCol;
...........etc etc.
Flex is Soooooo coooooool :)
Dan Pride
--- On Sat, 7/19/08, Dan Pride <[EMAIL PROTECTED]> wrote:
> From: Dan Pride <[EMAIL PROTECTED]>
> Subject: Re: [flexcoders] Screen Refresh function??
> To: [email protected]
> Date: Saturday, July 19, 2008, 5:08 AM
> Thanks for the insight into the problem, it helped a great
> deal.
>
> I came up with another solution which seems to work and
> conceptually at least seems a little simpler.
>
> I put the proceedure to fill in the text fields in a
> creation complete event in the Canvas, then called the view
> of the canvas in the double click event.
>
> This Seems to work, but being in my first year of Flex (20
> years in Oracle, 4D et al),... more better insights always
> appreciated.
>
> Dan Pride
>
>
>
> --- On Fri, 7/18/08, shaun <[EMAIL PROTECTED]>
> wrote:
>
> > From: shaun <[EMAIL PROTECTED]>
> > Subject: Re: [flexcoders] Screen Refresh function??
> > To: [email protected]
> > Date: Friday, July 18, 2008, 10:32 AM
> > Dan Pride wrote:
> > > I have a screen with datagrid lists which list
> the
> > basics.
> > > Users double click list items to display and
> enter
> > further data.
> > > The screen does not display the values on the
> first
> > change of the selected child canvas. After the first
> > attempt it always does, but the "first
> > impression" bites. Is there a way to get this to
> > display first and every time???
> > >
> > > Basic function I am using on the doubleclick on
> the
> > datagrid is:
> > >
> > > private function displayLoca():void{
> > > applicationScreens.selectedChild = locaScreen;
> > > locaName.text = locaGrid.selectedItem.NameCol;
> > > locaField.text = locaGrid.selectedItem.FieldCol;
> > > locaSquare.text =
> locaGrid.selectedItem.SquareCol;
> > > }
> > >
> >
> > Maybe your TextInput objects have not been created at
> the
> > time your
> > setting your data.
> >
> > Try this instead:
> >
> > private function displayLoca():void{
> > applicationScreens.selectedChild = locaScreen;
> > locaScreen.selectedItem = locaGrid.selectedItem;
> > }
> >
> >
> > And something like the following in your "edit
> > component":
> >
> > private var _selectedItem:Object;
> >
> > public function set selectedItem(o:Object):void{
> > _selectedItem = o;
> >
> > if (_selectedItem) callLater(updateInputs);
> > }
> >
> > public function get selectedItem():Object{
> > return _selectedItem;
> > }
> >
> > private function updateInputs():void{
> > locaName.text = _selectedItem.NameCol;
> > locaField.text = _selectedItem.FieldCol;
> > locaSquare.text = _selectedItem.SquareCol;
> > }
> >
> >
> > HTH.
> > - shaun