Adobe Dreamweaver Forums



Last 10 THreads :         can't convert wmv files (Last Post : scrytser - Replies : 3 - Views : 18 )           »          Need assistance converting some AS2 code to AS3 (Last Post : NedWebs - Replies : 1 - Views : 2 )           »          Creating form element from within a component (Last Post : jim1234 - Replies : 0 - Views : 1 )           »          Re: MIDI commands? (Last Post : rtalton - Replies : 0 - Views : 1 )           »          I need some help (Last Post : GradStudent07 - Replies : 0 - Views : 1 )           »          Suddenly can't see files on remote server (Last Post : Alan - Replies : 6 - Views : 7 )           »          CS4 trials expired too early (Last Post : Wodehouse - Replies : 7 - Views : 8 )           »          need check of site in IE7 please. (Last Post : yankeestonk - Replies : 9 - Views : 10 )           »          FLV problem (Last Post : TezS56 - Replies : 0 - Views : 1 )           »          movieclip (Last Post : ceyesuma - Replies : 0 - Views : 1 )           »         


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 08-26-2008, 05:47 PM
ericbelair
 
Posts: n/a
Diggs:
Default Getting Tree Item Editor to show on an Event other thanitemClick

I have a Tree Component with a dynamic Array Collection as its dataProvider. I
want to be able to edit the labels right in the Tree, and thereby edit the
underlying data. However, I do not want to use the default Tree itemEditor
functionality, which opens the editor on the itemClick Event. I want to be able
to trigger the editor showing with my own custom Event. What is the easiest way
to do this? I tried creating a custom itemRenderer, by extending the
TreeItemRenderer Class, and setting the rendererIsEditor property to "true",
but I could not get it to work correctly. If someone could point me in the
right direction it would be greatly appreciated.

Thank you.



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-28-2008, 07:20 AM
adobenewsbot
 
Posts: n/a
Diggs:
Default Re: Getting Tree Item Editor to show on an Event other than itemClick

Adobe Newsbot hopes that the following resources helps you. NewsBot is experimental and any feedback (reply to this post) on its utility will be appreciated:

Flex 3 - List control:
You can pass a label function to the List control to provide logic that determines .... When you use an MXML component as a item renderer, it can contain

Link: http://livedocs.adobe.com/flex/3/html/dpcontrols_2.html

Flex 2.0 ItemRenderers:
Jan 19, 2007 ... You'll see three items in the list with the text of the label property from your Array component. This view is the default view of a List

Link: http://www.actionscript.org/resource...ers/Page1.html

mx.controls.Label (Flex 3):
When a component is used as a drop-in item renderer or drop-in item editor, Flex initializes the listData property of the component with the appropriate

Link: http://livedocs.adobe.com/flex/3/lan...ols/Label.html

Using a Slider control as a DataGrid column item renderer in Flex:
The following example shows how you can use an HSlider control as an item renderer in a Flex DataGrid control. Full code after the jump.

Link: http://blog.flexexamples.com/2008/05...derer-in-flex/

Using a custom item renderer -- Flex 2.01:
When you use an MXML component as a item renderer, it can contain multiple levels ... iconField=&quot;myIcon&quot;> <mx:dataProvider> <mx:Array> <mx:Object label=&quot;AL&quot;

Link: http://livedocs.adobe.com/flex/201/h...ls_062_04.html



Disclaimer: This response is generated automatically by the Adobe NewsBot based on Adobe [L=Community Engine]http://community.adobe.com/ion/search.html[/L].
Reply With Quote
  #3 (permalink)  
Old 08-28-2008, 03:43 PM
ericbelair
 
Posts: n/a
Diggs:
Default Re: Getting Tree Item Editor to show on an Event otherthan itemClick

I found a good workaround that didn't require too much code. I added an Event
Listener for the itemEditBeginning event. In the Event Handler, I have a
condition that checks for a custom "reason" on the event. In the default event
dispatched by the Tree, this reason is null, so all I have to do is dispatch an
event manually in ActionScript (my function is triggered by a ContextMenu
selection) with a reason that I specify, and if the reason is not the one I
specify, I stop the Event from propogating. Hope this helps someone else
someday...

<?xml version="1.0" encoding="utf-8"?>
<mx:Tree xmlns:mx="http://www.adobe.com/2006/mxml"
editable="true" dataProvider="{myDP}"
itemEditBeginning="reportsTree_itemEditBeginningHa ndler(event);"
creationComplete="creationCompleteHandler();">
<mx:Script>
<![CDATA[
import mx.events.ListEvent;

private function creationCompleteHandler():void
{
var contextMenu:ContextMenu = new ContextMenu();

contextMenu.hideBuiltInItems();

contextMenu.addEventListener(ContextMenuEvent.MENU _SELECT,
contextMenu_menuSelectHandler);

this.contextMenu = contextMenu;
}

private function
contextMenu_menuSelectHandler(event:ContextMenuEve nt):void
{
this.contextMenu.customItems = [];

var editMenuItem:ContextMenuItem = new
ContextMenuItem("Edit...", false, true);


editMenuItem.addEventListener(ContextMenuEvent.MEN U_ITEM_SELECT,
editMenuItemSelectHandler);

this.contextMenu.customItems.push(renameMenuItem);
}

private function
editMenuItemSelectHandler(event:ContextMenuEvent): void
{
var event:ListEvent = new
ListEvent(ListEvent.ITEM_EDIT_BEGINNING,
false,
false, 0,

this.selectedIndex,

"myCustomReason");

this.dispatchEvent(event);
}
private function itemEditBeginningHandler(event:ListEvent):void
{
if (event.reason != "myCustomReason")
event.preventDefault();
}
]]>
</mx:Script>
</mx:Tree>

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:36 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