well i think it is a bug but the way to get over it is to add a deactivate and 
an activate listener on the tree or the App itself and in deactivate just do 
editable=false, activate editable=true or just remove the focus from the tree 
by setting it on the App it self from focus manager one there is a deactivate 
which means that user minimzed, swtiched tab whatever.



----- Original Message ----
From: Rafael Faria <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, March 3, 2008 9:51:08 PM
Subject: [flexcoders] Re: Tree Bug?

Hi sherif... Please check this

http://www.enilsson .com/assets/ examples/ menuTree. html

Select some items, and than change tabs, than come back to the menu...
you will see that it automatically start editing an item. And it
doesnt listen to the listeners. Just start editing from nowhere.

I tried Alex suggestion 

addEventListener( FocusEvent. FOCUS_IN, handleItemFocusIn) ;

and on handleItemFocusIn function i put

editedItemPosition = null;

i have a listening to the begginingedit too

private function handleItemEditBegin ning(event: ListEvent) :void
{
event.preventDefaul t(); 
}

but it doesnt seems to work either.

but it didnt change anything on FF but it throws an error on Safari.

Also note that if you start editing (to start editing it works like
mac, click once, and than click again) and you double click at the
textinput it will jump to the native editor...

those 2 issues are making me lost some nights of work... doesnt matter
what i do, it just don't fix it.

This is what my listeners handle...

addEventListener( ListEvent. ITEM_EDIT_ BEGINNING, handleItemEditBe ginning);
addEventListener( ListEvent. ITEM_EDIT_ END,handleItemEd itEnd);
addEventListener( ListEvent. ITEM_CLICK, handleItemEdit) ;

/**
* Action taken when you start editing the item
**/
private function handleItemEditBegin ning(event: ListEvent) :void
{
event.preventDefaul t(); 
}


/**
* Action taken when you finish editing the item
**/
private function handleItemEditEnd( event:ListEvent) :void
{
_tmpSelectedItem = null;

}

/**
* Action taken when you edit a item
**/
private var _tmpSelectedItem: Object;
private var editTimer:Timer = new Timer(1500,1) ;
private function handleItemEdit( event:ListEvent) :void
{

if ((_tmpSelectedItem == selectedItem) && (editable)) {
// Edit
editedItemPosition = event;

} else {
// not edit
event.preventDefaul t(); 
}

editTimer.removeEve ntListener( TimerEvent. TIMER_COMPLETE,
clearSelectedItem) ;

editTimer.addEventL istener(TimerEve nt.TIMER_ COMPLETE, clearSelectedIte m);
editTimer.start( );

_tmpSelectedItem = selectedItem;

}

private function clearSelectedItem( event:TimerEvent ):void
{
_tmpSelectedItem = null;
editTimer.removeEve ntListener( TimerEvent. TIMER_COMPLETE,
clearSelectedItem) ; 
}

--- In [EMAIL PROTECTED] ups.com, Sherif Abdou <[EMAIL PROTECTED] ..> wrote:
>
> u have a link or a bit of source code? try removing focus on the
editing by listeneing to the stage leave
> 
> 
> 
> ----- Original Message ----
> From: Rafael Faria <rafaelfaria. [EMAIL PROTECTED] .>
> To: [EMAIL PROTECTED] ups.com
> Sent: Sunday, March 2, 2008 10:12:00 PM
> Subject: [flexcoders] Re: Tree Bug?
> 
> anyone?
> 
> --- In [EMAIL PROTECTED] ups.com, "Rafael Faria"
> <rafaelfaria. grupos@ .> wrote:
> >
> > I'm almost finished with my Tree custom component. 
> > 
> > Just 2 things are bugging me a lot.
> > 
> > Firstly, when i select a node (not editing), change tab on my firefox,
> > and come back, it enters to editing mode without touching anything.
> > 
> > Secondly, when i'm in the editing a node, and double click inside the
> > custom texteditor i created, it just jump back to the native editor.
> > 
> > Anyone knows how to prevent both of those things to happen?
> > 
> > thanks
> > raf
> >
> 
> 
> 
> 
> 
> 
____________ _________ _________ _________ _________ _________ _
> Looking for last minute shopping deals? 
> Find them fast with Yahoo! Search. 
http://tools. search.yahoo. com/newsearch/ category. php?category= shopping
>


 


      
____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

Reply via email to