Re: [flexcoders] Viewstack / Navigator Filtering Best Practice?
i was stuck right in the same situation. i haver a linkbar binding from a viewstack. i want to be able to define which childs of viewstack will be visible in linkbar(i.e. want to filter dataprovider of linkbar) On 10/2/06, Jamie O [EMAIL PROTECTED] wrote: Hello,Looking for a little help as far as best practices for filtering anavigator (togglebuttonbar, buttonbar) from a viewstack data provider. Each viewstack is a canvas and I only want to present the selection inthe togglebuttonbar IF the XML node which contains the data for thecanvas exists.Right now I'm using .addChild and .removeChild on the togglebuttonbar to control which buttons are displayed. That works the firs time theapp loads, but as the user changes the data source (tied to a textboxthat loads a different xml file) it breaks. I'm thinking there is away to control which viewstate elements are displayed from within a dataprovider, but having issues with that.Right now, this is the XML event result handler source code:mx:Scriptprivate function XMLDPHandler(event:ResultEvent):void {pcXMLDP = new XML(event.result );bbNavigate.removeAllChildren();if (pcXMLDP.nodename1.length() 0) {bbNavigate.addChild(vsNavigate .getChildByName(nodename1));}else {bbNavigate.removeChild(vsNavigate .getChildByName(nodename1)); }/mx:ScriptAnd this is the viewstack / navigator components MXML:mx:ToggleButtonBar x=10 y=70 id=bbNavigate width=475 /mx:ViewStack x=10 y=100 id=vsNavigate width=475 height=235 mx:Canvas id=nodename1 label=Node 1 width=325 height=100mx:Label text=Node 1 text testfontWeight=bold left=0 top=0/ mx:ComboBox id=cmbCriteria width=200dataProvider={pcXMLDP.nodename1.criteria}labelField=@Nameleft=108 top=15//mx:Canvas mx:Canvas id=nodename2 label=Node 2 width=325 height=100mx:Label text=Node 2 text testfontWeight=bold left=0 top=0/ mx:ComboBox id=cmbRank width=200dataProvider={pcXMLDP.nodename2.rank}labelField=@Nameleft=108 top=15//mx:Canvas /mx:ViewStack/mx:CanvasAny help would be appreciatedThx--Flexcoders Mailing ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txtSearch Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/* Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required)* To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED]* Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ __._,_.___ -- 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 Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___
Re: [flexcoders] Viewstack / Navigator Filtering Best Practice?
Jamie just change from private to public in your function, and it will works.Regards.On 10/2/06, Jamie O [EMAIL PROTECTED] wrote: Hello, Looking for a little help as far as best practices for filtering a navigator (togglebuttonbar, buttonbar) from a viewstack data provider. Each viewstack is a canvas and I only want to present the selection in the togglebuttonbar IF the XML node which contains the data for the canvas exists. Right now I'm using .addChild and .removeChild on the togglebuttonbar to control which buttons are displayed. That works the firs time the app loads, but as the user changes the data source (tied to a textbox that loads a different xml file) it breaks. I'm thinking there is a way to control which viewstate elements are displayed from within a dataprovider, but having issues with that. Right now, this is the XML event result handler source code: mx:Script private function XMLDPHandler(event:ResultEvent):void { pcXMLDP = new XML(event.result); bbNavigate.removeAllChildren(); if (pcXMLDP.nodename1.length() 0) { bbNavigate.addChild(vsNavigate .getChildByName(nodename1)); } else { bbNavigate.removeChild(vsNavigate .getChildByName(nodename1)); } /mx:Script And this is the viewstack / navigator components MXML: mx:ToggleButtonBar x=10 y=70 id=bbNavigate width=475 / mx:ViewStack x=10 y=100 id=vsNavigate width=475 height=235 mx:Canvas id=nodename1 label=Node 1 width=325 height=100 mx:Label text=Node 1 text test fontWeight=bold left=0 top=0/ mx:ComboBox id=cmbCriteria width=200 dataProvider={pcXMLDP.nodename1.criteria} labelField=@Name left=108 top=15/ /mx:Canvas mx:Canvas id=nodename2 label=Node 2 width=325 height=100 mx:Label text=Node 2 text test fontWeight=bold left=0 top=0/ mx:ComboBox id=cmbRank width=200 dataProvider={pcXMLDP.nodename2.rank} labelField=@Name left=108 top=15/ /mx:Canvas /mx:ViewStack /mx:Canvas Any help would be appreciated Thx -- Igor Costawww.igorcosta.com __._,_.___ -- 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 Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___
[flexcoders] Viewstack / Navigator Filtering Best Practice?
Hello, Looking for a little help as far as best practices for filtering a navigator (togglebuttonbar, buttonbar) from a viewstack data provider. Each viewstack is a canvas and I only want to present the selection in the togglebuttonbar IF the XML node which contains the data for the canvas exists. Right now I'm using .addChild and .removeChild on the togglebuttonbar to control which buttons are displayed. That works the firs time the app loads, but as the user changes the data source (tied to a textbox that loads a different xml file) it breaks. I'm thinking there is a way to control which viewstate elements are displayed from within a dataprovider, but having issues with that. Right now, this is the XML event result handler source code: mx:Script private function XMLDPHandler(event:ResultEvent):void { pcXMLDP = new XML(event.result); bbNavigate.removeAllChildren(); if (pcXMLDP.nodename1.length() 0) { bbNavigate.addChild(vsNavigate .getChildByName(nodename1)); } else { bbNavigate.removeChild(vsNavigate .getChildByName(nodename1)); } /mx:Script And this is the viewstack / navigator components MXML: mx:ToggleButtonBar x=10 y=70 id=bbNavigate width=475 / mx:ViewStack x=10 y=100 id=vsNavigate width=475 height=235 mx:Canvas id=nodename1 label=Node 1 width=325 height=100 mx:Label text=Node 1 text test fontWeight=bold left=0 top=0/ mx:ComboBox id=cmbCriteria width=200 dataProvider={pcXMLDP.nodename1.criteria} labelField=@Name left=108 top=15/ /mx:Canvas mx:Canvas id=nodename2 label=Node 2 width=325 height=100 mx:Label text=Node 2 text test fontWeight=bold left=0 top=0/ mx:ComboBox id=cmbRank width=200 dataProvider={pcXMLDP.nodename2.rank} labelField=@Name left=108 top=15/ /mx:Canvas /mx:ViewStack /mx:Canvas Any help would be appreciated Thx -- 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 * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/