Hi Rick, Graham,

>From an MVC point of view, you should really be updating your model, and
the tree should detect those updates and display them (via binding).
However, there are two known bugs in beta 3 that may cause you problems:

1) The tree does not respond correctly to update events from the
collection classes.
2) The collection classes are not detecting changes to objects they
contain even if the objects are Bindable.

I think you will need some representation of your server-side data model
on the client (accessible via ModelLocator), but it is your choice
whether you use XML or a hierarchical collection of bindable
ActionScript objects.

Whichever you choose, you should be able to manipulate your model or
refresh it from the server and the tree should update itself
automatically (once the above issues are resolved).

My colleague, Peter Martin has recently blogged about automatically
generating ActionScript VOs from Java classes using XDoclet2. You may
find this useful:

http://weblogs.macromedia.com/pmartin/archives/2006/04/xdoclet_woes.cfm

I hope this helps,

Paul

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Rick Schmitty
Sent: Wednesday, May 24, 2006 4:25 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Cairngorm best practice with Tree data [f2b3]

I would also be interested and appreciate advice on this topic

On 5/23/06, Graham Weldon <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm messing with Cairngorm 2.0 beta, and Flex 2.0 beta 3. I've got a
> <mx:Tree /> that contains a structured set of data. This data can be
> subjected to an insert at any point. I have correctly setup the
events,
> commands and delegate to deal with the insertion, and I process the
> logical insertion on the server side of this application without
issues.
> The trouble I am having now is the graphical insertion of the new item
> into the existing model.
>
> Currently the data is XML based. The Tree is directly data bound to an
> XMLListCollection object.
>
> One thought I had was to model the entire tree as ValueObjects, so
that
> I could traverse the tree and 'addChild()' where necessary, but this
> would be a complete replication of my Server-Side java code on the
> client side, just for insertion. Additionally, I am not sure how i
would
> use a complex set of chained Value Objects as a data source for a Tree
> GUI component.
>
> Any information about this would be really helpful. I appreciate any
advice.
>
> I can display the tree correctly, I can use information from the
> selected item to perform operations etc. I am interested in inserting
a
> new item at a specified location. For example, a request to insert an
> item will result in XML data describing the insert:
>
> Regards,
> Graham Weldon.
>
>
>
> ========
> XML Tree INSERTION data Sample
> --------
>
> <command action="" success="true">
>     <addTreeItem parent="123">
>         <element label="NEWitem" id="9999"/>
>     </addTreeItem>
>     <addTreeItem parent="380">
>         <element label="deepItem" id="12"/>
>     </addTreeItem>
> </command>
>
> ========
>
>
> ========
> XML Tree Data Sample
> --------
>
> <tree>
>     <element label="one" id="123"/>
>     <element label="two" id="122"/>
>     <element label="eight" id="897">
>         <element label="hello" id="113"/>
>         <element label="world" id="198">
>             <element label="thing" id="380"/>
>         </element>
>     </element>
> </tree>
>
> ========
>
>
> ========
> ModelLocator
> --------
> ... snip ...
>
> public var myTreeData : XMLListCollection = new XMLListCollection();
>
> ... snip ...
> ========
>
>
> ========
> Application.mxml
> --------
> ... snip ...
>
> <myComponents:TreeComponent
>     dataProvider="{ModelLocator.myTreeData}"/>
>
> ... snip ...
> ========
>
>



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to