[flexcoders] Re: Traverse through a TabNavigator

2008-11-14 Thread livemidnite
You are correct, this is because TabNavigator hides it's children.

What are you trying to do?

Cheers,
 Jesse




--- In flexcoders@yahoogroups.com, timgerr [EMAIL PROTECTED] wrote:

 Hello all, I have a TabNavigator that contains 2 forms:
 mx:TabNavigator x=196 y=160 width=200 height=200 
id=TopTab
  mx:Form id=FormOne label=User
   mx:FormItem label=First Name
  mx:TextInput id=fname/
   /mx:FormItem
   mx:FormItem label=Last Name
  mx:TextInput id=lname/
   /mx:FormItem
   /mx:Form
   
   mx:Form id=FormTwo label=Address
   mx:FormItem label=Address
mx:TextInput id=address/
  /mx:FormItem
  mx:FormItem label=Zip Code
mx:TextInput id=zip/
  /mx:FormItem
   /mx:Form
 /mx:TabNavigator
 
 and I wrote this script to traverse a Form:
 public function Frm(f:Form):void
 {
var a:Array = f.getChildren();
for(var i:int = 0; i  a.length; i++){
   this.FrmI(a[i]);
}  
 }
 
 public function FrmI(f:FormItem):void
 {
var a:Array = f.getChildren();
for(var i:int = 0; i  a.length; i++){
  trace(a[i].id);
}
 }
 
 so the script will take a form object, then see how many childreen 
it
 has then it will send the formitems to FrmI. Frmi will get me the 
name
 of the child objects and that is all.  So the problem is when I run 
init()
 public function init():void
 {
   Frm(FormOne);
   Frm(FormTwo);
 }
 I get this in return:
 fname
 lname
 
 If I just run the 2nd form like this:
 public function init():void
 {  
   Frm(FormTwo);
 }
 
 Nothing is displayed.  I think this has to do with TabNavigator.  It
 looks to only get information from the tab that is on the top.  Is
 that correct, and what do I have to do in order to get all the
 information ?
 
 Thanks,
 timgerr





[flexcoders] Re: Traverse through a TabNavigator

2008-11-13 Thread valdhor
Tim

My current project has a very long form so I decided to break it down
into multiple panes on a TabNavigator.

So, each pane has its own specific form details. When the user clicks
the Next button, it checks all the form fields for data and populates
a value object with this data. It then dispatches a custom event which
contains this value object. I listen for this event at the application
level as well as the container of the TabNavigator. The application
saves the data for later (When it needs to send all the data to the
server). The container disables the current tab and enables the next
tab; It then sets the selected child to the next tab. I also have
Previous buttons to move to the previous tab.

This way, the user can only traverse the tabs as I want them to. They
can move back and forth between tabs and I validate the data each time
they press the Next button.

HTH



Best Regards




Steve

--- In flexcoders@yahoogroups.com, timgerr [EMAIL PROTECTED] wrote:

 Hello all, I have a TabNavigator that contains 2 forms:
 mx:TabNavigator x=196 y=160 width=200 height=200 id=TopTab
  mx:Form id=FormOne label=User
   mx:FormItem label=First Name
  mx:TextInput id=fname/
   /mx:FormItem
   mx:FormItem label=Last Name
  mx:TextInput id=lname/
   /mx:FormItem
   /mx:Form
   
   mx:Form id=FormTwo label=Address
   mx:FormItem label=Address
mx:TextInput id=address/
  /mx:FormItem
  mx:FormItem label=Zip Code
mx:TextInput id=zip/
  /mx:FormItem
   /mx:Form
 /mx:TabNavigator
 
 and I wrote this script to traverse a Form:
 public function Frm(f:Form):void
 {
var a:Array = f.getChildren();
for(var i:int = 0; i  a.length; i++){
   this.FrmI(a[i]);
}  
 }
 
 public function FrmI(f:FormItem):void
 {
var a:Array = f.getChildren();
for(var i:int = 0; i  a.length; i++){
  trace(a[i].id);
}
 }
 
 so the script will take a form object, then see how many childreen it
 has then it will send the formitems to FrmI. Frmi will get me the name
 of the child objects and that is all.  So the problem is when I run
init()
 public function init():void
 {
   Frm(FormOne);
   Frm(FormTwo);
 }
 I get this in return:
 fname
 lname
 
 If I just run the 2nd form like this:
 public function init():void
 {  
   Frm(FormTwo);
 }
 
 Nothing is displayed.  I think this has to do with TabNavigator.  It
 looks to only get information from the tab that is on the top.  Is
 that correct, and what do I have to do in order to get all the
 information ?
 
 Thanks,
 timgerr





RE: [flexcoders] Re: Traverse through a TabNavigator

2008-11-13 Thread Gregor Kiddie
Usually when we do this, we use a view stack controlled by the next /
back buttons so it looks more like a traditional wizard. Why are you
using the tab navigator? It seems a little clunky.

 

Gk.

Gregor Kiddie
Senior Developer
INPS

Tel:   01382 564343

Registered address: The Bread Factory, 1a Broughton Street, London SW8
3QJ

Registered Number: 1788577

Registered in the UK

Visit our Internet Web site at www.inps.co.uk
blocked::http://www.inps.co.uk/ 

The information in this internet email is confidential and is intended
solely for the addressee. Access, copying or re-use of information in it
by anyone else is not authorised. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
INPS or any of its affiliates. If you are not the intended recipient
please contact [EMAIL PROTECTED]



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of valdhor
Sent: 13 November 2008 14:21
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Traverse through a TabNavigator

 

Tim

My current project has a very long form so I decided to break it down
into multiple panes on a TabNavigator.

So, each pane has its own specific form details. When the user clicks
the Next button, it checks all the form fields for data and populates
a value object with this data. It then dispatches a custom event which
contains this value object. I listen for this event at the application
level as well as the container of the TabNavigator. The application
saves the data for later (When it needs to send all the data to the
server). The container disables the current tab and enables the next
tab; It then sets the selected child to the next tab. I also have
Previous buttons to move to the previous tab.

This way, the user can only traverse the tabs as I want them to. They
can move back and forth between tabs and I validate the data each time
they press the Next button.

HTH

Best Regards

Steve





[flexcoders] Re: Traverse through a TabNavigator

2008-11-13 Thread valdhor
My boss and the users like the way it looks. Unfortunately, I have to
do what they ask me to do.

I put together small examples of the different ways to do it and then
they pick the one they like (Even if it is a little clunky). Then I
complete the full functionality.

Don't you just hate users sometimes ;-}


 Why are you using the tab navigator? It seems a little clunky.




[flexcoders] Re: Traverse through a TabNavigator

2008-11-13 Thread Tim Hoff

Since TabNavigator extends ViewStack, there's really no difference in
the approach.  One advantage of using a TabNavigator for something like
this, is that it shows the user where they are in process of completing
the wizard; similar to an Accordion.

-TH

--- In flexcoders@yahoogroups.com, Gregor Kiddie [EMAIL PROTECTED] wrote:

 Usually when we do this, we use a view stack controlled by the next /
 back buttons so it looks more like a traditional wizard. Why are you
 using the tab navigator? It seems a little clunky.



 Gk.

 Gregor Kiddie
 Senior Developer
 INPS

 Tel: 01382 564343

 Registered address: The Bread Factory, 1a Broughton Street, London SW8
 3QJ

 Registered Number: 1788577

 Registered in the UK

 Visit our Internet Web site at www.inps.co.uk
 blocked::http://www.inps.co.uk/

 The information in this internet email is confidential and is intended
 solely for the addressee. Access, copying or re-use of information in
it
 by anyone else is not authorised. Any views or opinions presented are
 solely those of the author and do not necessarily represent those of
 INPS or any of its affiliates. If you are not the intended recipient
 please contact [EMAIL PROTECTED]

 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
 Behalf Of valdhor
 Sent: 13 November 2008 14:21
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Traverse through a TabNavigator



 Tim

 My current project has a very long form so I decided to break it down
 into multiple panes on a TabNavigator.

 So, each pane has its own specific form details. When the user clicks
 the Next button, it checks all the form fields for data and populates
 a value object with this data. It then dispatches a custom event which
 contains this value object. I listen for this event at the application
 level as well as the container of the TabNavigator. The application
 saves the data for later (When it needs to send all the data to the
 server). The container disables the current tab and enables the next
 tab; It then sets the selected child to the next tab. I also have
 Previous buttons to move to the previous tab.

 This way, the user can only traverse the tabs as I want them to. They
 can move back and forth between tabs and I validate the data each time
 they press the Next button.

 HTH

 Best Regards

 Steve






RE: [flexcoders] Re: Traverse through a TabNavigator

2008-11-13 Thread Gregor Kiddie
I think my point was, it's a bit clunky trying to suborn the TabBar for
showing progress through a wizard, rather than rolling your own. Trying
to shoehorn the TabBar behaviour surely takes longer and will be more
buggy than making your own Wizard progress bar...

 

Gk.

Gregor Kiddie
Senior Developer
INPS

Tel:   01382 564343

Registered address: The Bread Factory, 1a Broughton Street, London SW8
3QJ

Registered Number: 1788577

Registered in the UK

Visit our Internet Web site at www.inps.co.uk
blocked::http://www.inps.co.uk/ 

The information in this internet email is confidential and is intended
solely for the addressee. Access, copying or re-use of information in it
by anyone else is not authorised. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
INPS or any of its affiliates. If you are not the intended recipient
please contact [EMAIL PROTECTED]



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tim Hoff
Sent: 13 November 2008 17:50
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Traverse through a TabNavigator

 


Since TabNavigator extends ViewStack, there's really no difference in
the approach. One advantage of using a TabNavigator for something like
this, is that it shows the user where they are in process of completing
the wizard; similar to an Accordion.

-TH





[flexcoders] Re: Traverse through a TabNavigator

2008-11-12 Thread Tim Hoff

It's not bad per se, depending on the use case.   But, the navigator
containers only instantiate the first child, and then the other children
as needed (deferred instantiation); to cut down on the application load
time.  If your TabNavigator only has two children, you're not going to
see much of a difference.  And really, if you know that all of the forms
will be needed it's just a matter of preference; make the user wait at
the beginning or when a new child is needed.  However, deferred
instantiation is beneficial, if there are children that may never be
needed.

-TH

--- In flexcoders@yahoogroups.com, timgerr [EMAIL PROTECTED] wrote:

 Thanks for the comment, if creationPolicy is bad, what do other people
 do and why is it bad?

 Thanks,
 timgerr

 --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote:
 
 
  Hi Tim,
 
  The problem is that only the first child of a TabNavigator is
  instantiated initially. Not best practice, but you can set
  creationPolicy=All for the TabNavigator; in order to reference the
  other children on init.
 
  -TH
 
  --- In flexcoders@yahoogroups.com, timgerr tgallagher@ wrote:
  
   Hello all, I have a TabNavigator that contains 2 forms:
   mx:TabNavigator x=196 y=160 width=200 height=200
id=TopTab
   mx:Form id=FormOne label=User
   mx:FormItem label=First Name
   mx:TextInput id=fname/
   /mx:FormItem
   mx:FormItem label=Last Name
   mx:TextInput id=lname/
   /mx:FormItem
   /mx:Form
  
   mx:Form id=FormTwo label=Address
   mx:FormItem label=Address
   mx:TextInput id=address/
   /mx:FormItem
   mx:FormItem label=Zip Code
   mx:TextInput id=zip/
   /mx:FormItem
   /mx:Form
   /mx:TabNavigator
  
   and I wrote this script to traverse a Form:
   public function Frm(f:Form):void
   {
   var a:Array = f.getChildren();
   for(var i:int = 0; i  a.length; i++){
   this.FrmI(a[i]);
   }
   }
  
   public function FrmI(f:FormItem):void
   {
   var a:Array = f.getChildren();
   for(var i:int = 0; i  a.length; i++){
   trace(a[i].id);
   }
   }
  
   so the script will take a form object, then see how many childreen
it
   has then it will send the formitems to FrmI. Frmi will get me the
name
   of the child objects and that is all. So the problem is when I run
  init()
   public function init():void
   {
   Frm(FormOne);
   Frm(FormTwo);
   }
   I get this in return:
   fname
   lname
  
   If I just run the 2nd form like this:
   public function init():void
   {
   Frm(FormTwo);
   }
  
   Nothing is displayed. I think this has to do with TabNavigator. It
   looks to only get information from the tab that is on the top. Is
   that correct, and what do I have to do in order to get all the
   information ?
  
   Thanks,
   timgerr
  
 






[flexcoders] Re: Traverse through a TabNavigator

2008-11-12 Thread Tim Hoff

Hi Tim,

The problem is that only the first child of a TabNavigator is
instantiated initially.  Not best practice, but you can set
creationPolicy=All for the TabNavigator; in order to reference the
other children on init.

-TH

--- In flexcoders@yahoogroups.com, timgerr [EMAIL PROTECTED] wrote:

 Hello all, I have a TabNavigator that contains 2 forms:
 mx:TabNavigator x=196 y=160 width=200 height=200 id=TopTab
 mx:Form id=FormOne label=User
 mx:FormItem label=First Name
 mx:TextInput id=fname/
 /mx:FormItem
 mx:FormItem label=Last Name
 mx:TextInput id=lname/
 /mx:FormItem
 /mx:Form

 mx:Form id=FormTwo label=Address
 mx:FormItem label=Address
 mx:TextInput id=address/
 /mx:FormItem
 mx:FormItem label=Zip Code
 mx:TextInput id=zip/
 /mx:FormItem
 /mx:Form
 /mx:TabNavigator

 and I wrote this script to traverse a Form:
 public function Frm(f:Form):void
 {
 var a:Array = f.getChildren();
 for(var i:int = 0; i  a.length; i++){
 this.FrmI(a[i]);
 }
 }

 public function FrmI(f:FormItem):void
 {
 var a:Array = f.getChildren();
 for(var i:int = 0; i  a.length; i++){
 trace(a[i].id);
 }
 }

 so the script will take a form object, then see how many childreen it
 has then it will send the formitems to FrmI. Frmi will get me the name
 of the child objects and that is all. So the problem is when I run
init()
 public function init():void
 {
 Frm(FormOne);
 Frm(FormTwo);
 }
 I get this in return:
 fname
 lname

 If I just run the 2nd form like this:
 public function init():void
 {
 Frm(FormTwo);
 }

 Nothing is displayed. I think this has to do with TabNavigator. It
 looks to only get information from the tab that is on the top. Is
 that correct, and what do I have to do in order to get all the
 information ?

 Thanks,
 timgerr






[flexcoders] Re: Traverse through a TabNavigator

2008-11-12 Thread Amy
--- In flexcoders@yahoogroups.com, timgerr [EMAIL PROTECTED] wrote:

 Thanks for the comment, if creationPolicy is bad, what do other people
 do and why is it bad?

You may want to look at Q5
http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf



[flexcoders] Re: Traverse through a TabNavigator

2008-11-12 Thread timgerr
Thanks for the comment, if creationPolicy is bad, what do other people
do and why is it bad?

Thanks,
timgerr

--- In flexcoders@yahoogroups.com, Tim Hoff [EMAIL PROTECTED] wrote:

 
 Hi Tim,
 
 The problem is that only the first child of a TabNavigator is
 instantiated initially.  Not best practice, but you can set
 creationPolicy=All for the TabNavigator; in order to reference the
 other children on init.
 
 -TH
 
 --- In flexcoders@yahoogroups.com, timgerr tgallagher@ wrote:
 
  Hello all, I have a TabNavigator that contains 2 forms:
  mx:TabNavigator x=196 y=160 width=200 height=200 id=TopTab
  mx:Form id=FormOne label=User
  mx:FormItem label=First Name
  mx:TextInput id=fname/
  /mx:FormItem
  mx:FormItem label=Last Name
  mx:TextInput id=lname/
  /mx:FormItem
  /mx:Form
 
  mx:Form id=FormTwo label=Address
  mx:FormItem label=Address
  mx:TextInput id=address/
  /mx:FormItem
  mx:FormItem label=Zip Code
  mx:TextInput id=zip/
  /mx:FormItem
  /mx:Form
  /mx:TabNavigator
 
  and I wrote this script to traverse a Form:
  public function Frm(f:Form):void
  {
  var a:Array = f.getChildren();
  for(var i:int = 0; i  a.length; i++){
  this.FrmI(a[i]);
  }
  }
 
  public function FrmI(f:FormItem):void
  {
  var a:Array = f.getChildren();
  for(var i:int = 0; i  a.length; i++){
  trace(a[i].id);
  }
  }
 
  so the script will take a form object, then see how many childreen it
  has then it will send the formitems to FrmI. Frmi will get me the name
  of the child objects and that is all. So the problem is when I run
 init()
  public function init():void
  {
  Frm(FormOne);
  Frm(FormTwo);
  }
  I get this in return:
  fname
  lname
 
  If I just run the 2nd form like this:
  public function init():void
  {
  Frm(FormTwo);
  }
 
  Nothing is displayed. I think this has to do with TabNavigator. It
  looks to only get information from the tab that is on the top. Is
  that correct, and what do I have to do in order to get all the
  information ?
 
  Thanks,
  timgerr