I have tried several attempts with no luck on the role label node,  is there an 
example or 
some docs that simply the handler function. Being a newbie and just putting 
code in the 
correct place is a small success :)

if you havn't heard it today, thank you for your patient's !


Here is a snippet from my xml file:

<location label="myNewCity"
                ID="01">
<organization label="Commercial 123">   
        <role label="Analyst">
                <Assignment>
                        <Assign name="Business Process (HIJK)">
                        <sub name="sub name 1"> Description="insert content"> 
RoleProfile="url"> AntLearn="insert content"> OpenPosition="url"</sub>
                        <sub name="sub name 2"> Description="insert content"> 
RoleProfile="url"> AntLearn="insert content"> OpenPosition="url"</sub>
                        </Assign>
                        
                        <Assign name="Customer Care (ABCDE)">
                        <sub name="sub name 1"> Description="insert content"> 
RoleProfile="url"> AntLearn="insert content"> OpenPosition="url"</sub>
                        <sub name="sub name 2"> Description="insert content"> 
RoleProfile="url"> AntLearn="insert content"> OpenPosition="url"</sub>
                        </Assign>
                </Assignment>
        </role>
        
        <role label="Lead">
                <Assignment>
                        <Assign name="Lead Process (Wild23)">
                        <sub name="sub name 1"> Description="insert content"> 
RoleProfile="url"> AntLearn="insert content"> OpenPosition="url"</sub>
                        <sub name="sub name 2"> Description="insert content"> 
RoleProfile="url"> AntLearn="insert content"> OpenPosition="url"</sub>
                        </Assign>
                        
                        <Assign name="Loss Prevention (AFGHIJ)">
                        <sub name="sub name 1"> Description="insert content"> 
RoleProfile="url"> AntLearn="insert content"> OpenPosition="url"</sub>
                        <sub name="sub name 2"> Description="insert content"> 
RoleProfile="url"> AntLearn="insert content"> OpenPosition="url"</sub>
                        </Assign>
                </Assignment>
        </role>
</organization>
        </location>


\--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> The benefit of the handler function over the binding is that you can
> examine the structure of the current item to understand how to build the
> expression to return the dataProvider.
> 
>  
> 
> Now, you are going to need separate handler functions for each combo
> box, or else pass in a parameter and create logic to know what to do in
> a generic one.
> 
>  
> 
> For simplicity, create a separate handler for each comboBox.  In that
> handler, trace( event.result.toXMLString() ), to see exactly what you
> current selectedItem contains.  You probably have an error in the
> selection expression for the "role" nodes, and this will let your see
> how to fix it.
> 
>  
> 
> Tarcy
> 
>  
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of dranoel1967
> Sent: Tuesday, January 02, 2007 6:37 PM
> To: [email protected]
> Subject: [flexcoders] Re: Multiple ComboBox Selection and Tree from XML
> 
>  
> 
> I am having a hard time following your "approach" ref. to
> listChangehandler 
> (understanding the where and what to change) the binding approached
> worked on the 2nd 
> ComboBox but not the third and so on... In "mybox3" if I mirror the
> dataprovider it does 
> return the same values as the second just not when I change ref. to
> "role" , both are child 
> nodes of the parent "location", then "organization" and "role" which all
> have their name 
> then label i.e <role label="Analyst"> . Your thoughts!
> 
> <mx:ComboBox id="mybox1"
> dataProvider="{xmlData}"
> labelField="@label"
> width="157" x="10" y="92"
> change="listChangeHandler(event)"/>
> 
> <mx:ComboBox id="mybox2" 
> dataProvider="[EMAIL PROTECTED]"
> width="169" x="175" y="92"
> change="listChangeHandler(event)"/>
> 
> <mx:ComboBox id="mybox3" 
> dataProvider="[EMAIL PROTECTED]"
> width="334" x="10" y="137" 
> change="listChangeHandler(event)"/> 
> 
> --- In [email protected] <mailto:flexcoders%40yahoogroups.com>
> , "Tracy Spratt" <tspratt@> wrote:
> >
> > Ok, good. Now, each item in the first combo box has an XML "location"
> > node in it. If the location node contains the child nodes necessary to
> > populate the second combo, then in the "listChangeHandler" do
> something
> > similar to what you did in the result handler. You can directly assign
> > the dataProvider instead of using an instance variable:
> > 
> > 
> > 
> > var xmlLocation:XML = XML(event.target.selectedItem); //or use the
> "as"
> > operator
> > 
> > var xlNames:XMLList = xmlLocation.Name;
> > 
> > cboNames.dataProvider = xmNames;
> > 
> > 
> > 
> > Do the same in the Names combobox handler to populate the third combo
> > and the Tree, or whatever.
> > 
> > 
> > 
> > While this would be my approach, you could also use binding to
> populate
> > the comboboxes, something like:
> > 
> > <mx:ComboBox id=" cboNames" dataProvider="{ mybox1.selectedItem.Name}"
> > ../>
> > 
> > Binding is just a little harder to debug, becaue using the handler
> > function you can trace xmlLocation.toXMLString() to know exactly how
> to
> > reference the child nodes.
> > 
> > 
> > 
> > Tracy
> > 
> > 
> > 
> > ________________________________
> > 
> > From: [email protected] <mailto:flexcoders%40yahoogroups.com>
> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of dranoel1967
> > Sent: Monday, January 01, 2007 8:29 AM
> > To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Re: Multiple ComboBox Selection and Tree from
> XML
> > 
> > 
> > 
> > I have managed to get this to work, I had to reformat my xml data
> file.
> > Now that I have 
> > that working, how would I capture the users selection to populate the
> > second and and 
> > then the third combobox.
> > 
> > Thank you for the previous post and direction.
> > 
> > Regards,
> > 
> > <!---end of code-->
> > 
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> 
> > <http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> > "
> layout="absolute" 
> > xmlns:adobe="http://www.adobe.com/2006/fc
> <http://www.adobe.com/2006/fc>  <http://www.adobe.com/2006/fc
> <http://www.adobe.com/2006/fc> >
> > "
> > initialize="e4xService.send()">
> > 
> > <mx:HTTPService id="e4xService"
> > url="data/data.xml"
> > result="resultHandler(event)"
> > resultFormat="e4x"/>
> > 
> > <mx:Script>
> > <![CDATA[
> > import mx.events.ListEvent;
> > import mx.rpc.events.ResultEvent;
> > 
> > [Bindable]
> > private var xmlData:XMLList;
> > [Bindable]
> > private var selectedXML:XML;
> > 
> > private function resultHandler(event:ResultEvent):void
> > {
> > var result:XML = event.result as XML;
> > xmlData = result..location as XMLList;
> > }
> > 
> > private function listChangeHandler(event:Event):void 
> > {
> > }
> > 
> > ]]>
> > </mx:Script>
> > 
> > 
> > 
> > <mx:MenuBar x="10" y="10" width="780" height="72" cornerRadius="5"></
> > mx:MenuBar>
> > <mx:HDividedBox x="10" y="90" width="780" height="352">
> > <mx:Panel width="386" height="352" layout="absolute" title="myQuest" 
> > fontFamily="Verdana">
> > 
> > <mx:ComboBox id="mybox1"
> > dataProvider="{xmlData}"
> > labelField="@label"
> > width="157" x="10" y="92"
> > change="listChangeHandler(event)"/>
> > 
> > <!---end of code-->
> > 
> > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > , "Tracy Spratt" <tspratt@> wrote:
> > >
> > > If the data can be in one file then that is the easiest way to do
> it.
> > > 
> > > 
> > > 
> > > Use HTTPService with resultFormat="e4x" to get the data into Flex.
> > > 
> > > Then use an e4x expression to return an XMLList of the correct nodes
> > for
> > > the first combo box.
> > > 
> > > 
> > > 
> > > When you have that working, post back.
> > > 
> > > 
> > > 
> > > Tracy
> > > 
> > > 
> > > 
> > > ________________________________
> > > 
> > > From: [email protected]
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > [mailto:[email protected]
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > ] On
> > > Behalf Of dranoel1967
> > > Sent: Friday, December 29, 2006 1:24 PM
> > > To: [email protected] <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com> 
> > > Subject: [flexcoders] Re: Multiple ComboBox Selection and Tree from
> > XML
> > > 
> > > 
> > > 
> > > I will be using this xml file, I'm very open to changes... I have
> > > several other "Locations" to 
> > > add 18 in all. My first thought was to create a seperate xml file
> for
> > > each, but as you see I 
> > > currently have then in one large file.
> > > 
> > > Thanks again,
> > > 
> > > <!---start of xml file -->
> > > 
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <Locations>
> > > <Location>
> > > 
> > > <Name>myLocation 1</Name>
> > > <ID>1</ID>
> > > <Organization> 
> > > <Name>Organization 1</Name>
> > > <ID>2</ID>
> > > <Role>
> > > <Name>RoleName 1</Name>
> > > <Assignment>
> > > <Name>myAssign 1</Name>
> > > <Sub>
> > > <Name>myAssign SubName 1</Name>
> > > <ID>1</ID>
> > > <Description><![CDATA[<P ALIGN="LEFT"><FONT 
> > > LETTERSPACING="0" KERNING="0">You determine the resource impact of
> > pends
> > > <FONT 
> > > COLOR="#0000FF">This is a full description of this Assignment's Sub
> > > Category.</
> > > FONT></P>]]></Description>
> > > <RoleProfile>http://www.newURL.com <http://www.newURL.com>
> <http://www.newURL.com <http://www.newURL.com> >
> > <http://www.newURL.com <http://www.newURL.com>  <http://www.newURL.com
> <http://www.newURL.com> > >
> > > </RoleProfile>
> > > <AntLearn><![CDATA[<P ALIGN="LEFT"><FONT 
> > > LETTERSPACING="0" KERNING="0">Experience communicating through
> e-mail
> > > and 
> > > leading meetings with confidence. </FONT></P>]]></AntLearn>
> > > <OpenPosition>http://www.newURL.com <http://www.newURL.com>
> <http://www.newURL.com <http://www.newURL.com> >
> > <http://www.newURL.com <http://www.newURL.com>  <http://www.newURL.com
> <http://www.newURL.com> > > </
> > > OpenPosition>
> > > </Sub>
> > > <Sub>
> > > <Name>myAssign SubName 2</Name>
> > > <ID>2</ID>
> > > <Description><![CDATA[<P ALIGN="LEFT"><FONT 
> > > LETTERSPACING="0" KERNING="0">Our Online Web Information Exchange.
> > This
> > > is your 
> > > one-stop resource for learning the latest news about us and our
> > > industry, as well as the 
> > > place to access information and tools to help you with your
> > professional
> > > and personal 
> > > life.</FONT></P>]]></Description>
> > > <RoleProfile>insert intranet url</RoleProfile>
> > > <AntLearn>Insert your full text here</AntLearn>
> > > <OpenPosition>http://www.newUrl.com <http://www.newUrl.com>
> <http://www.newUrl.com <http://www.newUrl.com> >
> > <http://www.newUrl.com <http://www.newUrl.com>  <http://www.newUrl.com
> <http://www.newUrl.com> > > </
> > > OpenPosition>
> > > </Sub>
> > > 
> > > </Assignment>
> > > </Role>
> > > </Organization>
> > > 
> > > </Location>
> > > <Location>
> > > <Name>myLocation 2</Name>
> > > <ID>2</ID>
> > > <Organization> 
> > > <Name>Organization 2</Name>
> > > <ID>2</ID>
> > > <Role>
> > > <Name>myRoleName 2</Name>
> > > <Assignment>
> > > <Name>MyNextAssign</Name>
> > > <Sub>
> > > <Name>MyNexAssign Sub1</Name>
> > > <ID>2</ID>
> > > <Description><![CDATA[<P ALIGN="LEFT"><FONT 
> > > LETTERSPACING="0" KERNING="0">You determine the resource impact of
> > pends
> > > <FONT 
> > > COLOR="#0000FF">This is a full description of this Assignment's Sub
> > > Category.</
> > > FONT></P>]]></Description>
> > > <RoleProfile>http://www.newIntranetURL.com
> <http://www.newIntranetURL.com> 
> > <http://www.newIntranetURL.com <http://www.newIntranetURL.com> > 
> > > <http://www.newIntranetURL.com <http://www.newIntranetURL.com>
> <http://www.newIntranetURL.com <http://www.newIntranetURL.com> > > </
> > > RoleProfile>
> > > <AntLearn><![CDATA[<P ALIGN="LEFT"><FONT 
> > > LETTERSPACING="0" KERNING="0">Experience communicating through
> e-mail
> > > and 
> > > leading meetings with confidence. </FONT></P>]]></AntLearn>
> > > <OpenPosition>http://www.newURL.com <http://www.newURL.com>
> <http://www.newURL.com <http://www.newURL.com> >
> > <http://www.newURL.com <http://www.newURL.com>  <http://www.newURL.com
> <http://www.newURL.com> > > </
> > > OpenPosition>
> > > </Sub>
> > > <Sub>
> > > <Name>MyNextAssign sub2</Name>
> > > <ID>4</ID>
> > > <Description><![CDATA[<P ALIGN="LEFT"><FONT 
> > > LETTERSPACING="0" KERNING="0">You coach and mentor associates on the
> > > network 
> > > admin and data entry teams, serving as an important role
> > > model.</FONT></P>]]></
> > > Description>
> > > <RoleProfile>insert intranet url</RoleProfile>
> > > <AntLearn><![CDATA[<P ALIGN="LEFT"><FONT 
> > > LETTERSPACING="0" KERNING="0">Your anticipated learning's will go
> > > here.</FONT></
> > > P>]]></AntLearn>
> > > <OpenPosition>http://www.newURL.com <http://www.newURL.com>
> <http://www.newURL.com <http://www.newURL.com> >
> > <http://www.newURL.com <http://www.newURL.com>  <http://www.newURL.com
> <http://www.newURL.com> > > </
> > > OpenPosition>
> > > </Sub>
> > > </Assignment>
> > > </Role>
> > > </Organization>
> > > 
> > > </Location>
> > > </Locations>
> > > 
> > > <!---end of xml file -->
> > > 
> > > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com> 
> > <mailto:flexcoders%40yahoogroups.com>
> > <mailto:flexcoders%40yahoogroups.com>
> > > , "Tracy Spratt" <tspratt@> wrote:
> > > >
> > > > That is clear. The general solution is to bind the dependant combo
> > > > box's dataProvider to the selectedItem in its precedent control,
> or
> > to
> > > > have the change event of each combo box set the dataProvider for
> the
> > > > dependant control. The exact implementation depends on several
> > > factors.
> > > > 
> > > > 
> > > > 
> > > > How is your data organized, and how are you getting it from the
> > > server?
> > > > Specifically, does each comboBox selection need to trigger a data
> > > > service call to get the result data for the dependent combo? Or
> can
> > > you
> > > > get all the data or parts of the data at once?
> > > > 
> > > > 
> > > > 
> > > > Tracy
> > > > 
> > > > 
> > > > 
> > > > ________________________________
> > > > 
> > > > From: [email protected]
> <mailto:flexcoders%40yahoogroups.com> 
> > <mailto:flexcoders%40yahoogroups.com>
> > <mailto:flexcoders%40yahoogroups.com>
> > > [mailto:[email protected]
> <mailto:flexcoders%40yahoogroups.com> 
> > <mailto:flexcoders%40yahoogroups.com>
> > <mailto:flexcoders%40yahoogroups.com>
> > > ] On
> > > > Behalf Of dranoel1967
> > > > Sent: Thursday, December 28, 2006 5:38 PM
> > > > To: [email protected]
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > <mailto:flexcoders%40yahoogroups.com> 
> > > > Subject: [flexcoders] Multiple ComboBox Selection and Tree from
> XML
> > > > 
> > > > 
> > > > 
> > > > Multiple ComboBox Selection from XML
> > > > 
> > > > Okay, I am looking for some help, or an example even a nod in the
> > > right
> > > > direction wouldl be 
> > > > much appreciated.
> > > > 
> > > > I have three combo boxes and a tree that I need to populate from
> an
> > > XML
> > > > file.The first 
> > > > combox 1 will need to have data ready for selection upon load.
> Then
> > > > combobox 2 will then 
> > > > be populated with all associated child nodes from the selection in
> > > > combobox 1, and 
> > > > combobox 3 will then be populated with all associated child nodes
> > from
> > > > the selection in 
> > > > combobox 2. Once the user makes their final selection in combobox
> 3
> > > the
> > > > tree will be 
> > > > populated with that childs data.
> > > > 
> > > > I am sure that this is as clear as mud! :)
> > > > 
> > > > Being very new to xml and Flex any examples and or suggestions
> would
> > > be
> > > > great.
> > > > 
> > > > Best Regards,
> > > > 
> > > > Dranoel
> > > >
> > >
> >
>


Reply via email to