Adobe Dreamweaver Forums



Last 10 THreads :         IE doesn't like my Liquid Page (Last Post : TH1995 - Replies : 0 - Views : 1 )           »          div background not appearing - fresh eyes needed (Last Post : courtney (n h c) - Replies : 1 - Views : 2 )           »          how do I get back the "upload dependent files?" popup? (Last Post : Alan - Replies : 1 - Views : 2 )           »          how do I get back the "upload dependent files?" popup? (Last Post : jamieschmid - Replies : 0 - Views : 1 )           »          remove editable region (Last Post : Alan - Replies : 1 - Views : 2 )           »          CS4 trials expired too early (Last Post : walla walla - Replies : 10 - Views : 11 )           »          Cotrolling Separate Movie Files (Last Post : aquachong - Replies : 3 - Views : 4 )           »          Fill graphics (Last Post : rtalton - Replies : 1 - Views : 2 )           »          CFPDF action="addWatermark" ISSUE/BUG (Last Post : -==cfSearching==- - Replies : 9 - Views : 13 )           »          While executing error (Last Post : TedMoore - Replies : 2 - Views : 3 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags: , ,



Reply
  #1 (permalink)  
Old 06-03-2008, 07:55 AM
John Hall
 
Posts: n/a
Diggs:
Default tabNavigator selectedIndex not working

I have reduced a problem I'm having to a very simple example. I'm using the
routine in a validation of form, trying to make sure they don't leave the
current tab index if a form is 'open.' It works the first time but after that,
does not work every other time. Suggestions?



<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function resetTab():void{
tabNav.selectedIndex = 0;
Alert.show("selected child should be tab1 but it's " +
tabNav.selectedChild);
}
]]>
</mx:Script>
<mx:TabNavigator id="tabNav" x="48" y="35" width="200" height="200"
change="resetTab();">
<mx:Canvas label="Tab 1" width="100%" height="100%" id="tab1">
</mx:Canvas>
<mx:Canvas label="Tab 2" width="100%" height="100%" id="tab2">
</mx:Canvas>
</mx:TabNavigator>
</mx:Application>



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-03-2008, 03:38 PM
ericbelair
 
Posts: n/a
Diggs:
Default Re: tabNavigator selectedIndex not working

Perhaps try adding the following line after setting the selected index:

tabNav.validateNow();
Reply With Quote
  #3 (permalink)  
Old 06-06-2008, 10:49 PM
Redden96
 
Posts: n/a
Diggs:
Default Re: tabNavigator selectedIndex not working

On Jun 3, 1:37 am, "John Hall" <webforumsu...@macromedia.com> wrote:
> I have reduced a problem I'm having to a very simple example. I'm using the
> routine in a validation of form, trying to make sure they don't leave the
> current tab index if a form is 'open.' It works the first time but after that,
> does not work every other time. Suggestions?
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
> <mx:Script>
> <![CDATA[
> import mx.controls.Alert;
> private function resetTab():void{
> tabNav.selectedIndex= 0;
> Alert.show("selected child should be tab1 but it's " +
> tabNav.selectedChild);
> }
> ]]>
> </mx:Script>
> <mx:TabNavigatorid="tabNav" x="48" y="35" width="200" height="200"
> change="resetTab();">
> <mx:Canvas label="Tab 1" width="100%" height="100%" id="tab1">
> </mx:Canvas>
> <mx:Canvas label="Tab 2" width="100%" height="100%" id="tab2">
> </mx:Canvas>
> </mx:TabNavigator>
> </mx:Application>


I'm having the same issue and have yet to find a solution. It is
slightly comforting to see that I'm not alone in my frustration.
Reply With Quote


  #4 (permalink)  
Old 07-09-2008, 02:33 PM
umarcheeta
 
Posts: n/a
Diggs:
Default Re: tabNavigator selectedIndex not working

me having same problems just wasted 5 hours yesterday on this issue.........use
the validateProperties()..........the logic behind it might be that tabNaigator
object has a property selectedIndex which is forcefully committed by this
function

Reply With Quote
  #5 (permalink)  
Old 07-09-2008, 02:33 PM
doug777
 
Posts: n/a
Diggs:
Default Re: tabNavigator selectedIndex not working

Try using the callLater method.

Instead of tabNav.selectedIndex = 0;

tabNav.callLater(setTab);

then

private function setTab():void{
tabNav.selectedIndex = 0;
}

Doug
Reply With Quote
  #6 (permalink)  
Old 07-09-2008, 03:50 PM
ericbelair
 
Posts: n/a
Diggs:
Default Re: tabNavigator selectedIndex not working

I ran into a similar problem where the correct tab was not always being
selected when the ViewStack selectedIndex changed. This is a bug in Flex, which
I have reported and submitted a patch for.

In the meantime, you can use the attached Custom Class, and this should fix
your problem....

package
{

//--------------------------------------------------------------------------
//
// Import all necessary classes
//

//--------------------------------------------------------------------------

//----------------------------------
// Import necessary non-core Flex classes
//----------------------------------

import mx.containers.TabNavigator;

public class CustomTabNavigator extends TabNavigator
{

//--------------------------------------------------------------------------
//
// Methods
//

//--------------------------------------------------------------------------

// Constructor
public function CustomTabNavigator()
{
super();
}

override protected function commitSelectedIndex(newIndex:int):void
{
super.commitSelectedIndex(newIndex);

// Select the corresponding Tab in the Tab Bar (this fixes a bug
in Flex)
tabBar.selectedIndex = newIndex;
}
}
}

Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 08:52 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk