I would think that if you don't want to replicate the server-side
logic, you could just refresh the XMLListCollection data (new call)
after the insertion has occured.  The binding would update the
view.  If you are using the view to allow an insertion point, you
would have to use addChildAt().

-TH

--- In [email protected], 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




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