|
|
Show Posts
|
Pages: [1]
|
1
|
Announcements and General Discussion / Getting Started / Re: Flex Tree control, Proxy and VOs
|
on: May 26, 2008, 02:37:33
|
Following this post about Tree control, I have a question.
Here is a piece of code from CodePeek AIR app. Mediator method triggered when the user clicks on any item of the search Tree :
protected function onTreeItemSelect( event:Event ):void { if ( app.tree.selectedItem.@url == undefined ) { sendNotification( ApplicationFacade.SEARCH_TYPE_SELECTED, app.tree.selectedItem ); } else { sendNotification( ApplicationFacade.SEARCH_SELECTED,[ app.tree.getParentItem( app.tree.selectedItem ), app.tree.selectedItem ] ); app.browser.location = app.tree.selectedItem.@url; } } To know if the user clicked (in the search tree) on a Language or a Search keyword, CodePeek looks for a "url" attribute in the item : if no url attribute is found, it means that a Language (folder) was clicked...
Is there another way of doing this ?
How can I know the name of the XML tag of the clicked item ?
thanks in advance,
-- Mat
|
|
|
3
|
Announcements and General Discussion / Getting Started / Flex Tree control, Proxy and VOs
|
on: May 24, 2008, 05:37:07
|
Hi,
I am building my first Flex/PureMVC application to get a nice picture of the framework.
I don't find simple information about how I could represent a tree structure in my model...
I found examples of proxies manipulating simple VO as their "data", or ArrayCollection, but how could I manipulate (in proxy I suppose) and store (in proxy's data) a tree of objects.
My sample is quite simple: represent a shop, with products arranged in categories. The tree is a set of categories, each category can contain subcategories and/or products.
[DVD] [Drama] .National treasure .The walker [Animation] .Toy story [Books] .Learning AS3 .Design Patterns
I suppose my Proxy would expose methods like getCategories, getProductsForCategory, etc... These methods returning stuff from the data var of the proxy.
Last but not least, I have a Tree control in my view component. How can I use Bindable to fill my Tree control with the data retreived by the mediator (through a notification sent by my proxy) ?
(don't forget I am not yet familiar with the framework)
Thanks for any response,
-- Mathieu
|
|
|
|
|