0 Replies Latest reply on Feb 14, 2011 3:08 AM by nsd1026

    How to calculate the last selected item in a tree node where we can customize the list to the node.




      I'm new to the Flex field. I got a task where i have a tree (TREE is the id) with X and Y as nodes. In X i have got a list of pages(dataprovider is array collection) added dynamically(means User can configure the pages).On selecting last item(last page) in the list of X node, the  view will be presented with a component say Xlast on the right side which is in view stack. In that component , there is button called NEXT which has to be greyed out for the last page. I tried by calling the below code on viewChange event


      if(viewstack.selectedchild == XlastpageId)

      Nextbtn.enabled = false;


      but this will work only when we know XlastpageId is the lastpage for the tree. but how to implement this when we dont know which is the last page of the X node in a Tree.


      I also tried by calculating the children of the tree on tree click event which is


      if (Tree.selectedItem == TREE.numChildren - 1)

      Nextbtn.enabled = false;


      i know this is wrong because we have 2 children for the tree( X and Y) so it is showing 2-1 and the button is greyed out for the first click.


      Please help me out.


      Thanks in Advance,