Focal Point
[SOLVED] FLEX - Expanding nodes in a ibiTree component

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/975100301

May 04, 2009, 08:51 AM
edarefsky
[SOLVED] FLEX - Expanding nodes in a ibiTree component
Does anyone have an example of how to automatically expand a tree that is created through the ibiTree component down to the second node? In the example below, I would like the tree to always open to the REPORT_CATEGORY branch.

 <ibi:ibiTree  seturl="{rptfile.valueOf()}" id="rptlist" ibiTreeLabelField="REPORT_BUSINESS_AREA,REPORT_CATEGORY, REPORT_DISPLAY_NAME,REPORT_URL_ADDRESS" ibiShowLabelFolder="false">
<ibi:ibiUseColumns>REPORT_BUSINESS_AREA,REPORT_CATEGORY,REPORT_DISPLAY_NAME,REPORT_URL_ADDRESS</ibi:ibiUseColumns>
</ibi:ibiTree>


Any insight would be much appreciated.

This message has been edited. Last edited by: edarefsky,


WebFocus 7.6.6, Win2k, Excel, PDF, Flat files, XML, HTML, Flex 1.0.1
May 12, 2009, 05:13 PM
Kerry
Hi edarefsky,

I passed this to internals and here is the reply: Per discussion with the PM, the simple answer is that, there is no way to do this via our ibi component properties. This will need to be implemented via ActionScripts. You may want to search the Adobe doc site for help as well.

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
May 13, 2009, 08:59 AM
edarefsky
Thanks Kerry.

I actually opened a case with tech support and have sent them my mxml code and data file. Being new to Flex and action script, I did try a few things but didn't get anywhere.

Elyse


WebFocus 7.6.6, Win2k, Excel, PDF, Flat files, XML, HTML, Flex 1.0.1
May 14, 2009, 12:42 AM
TexasStingray
Here is an example. it opens all regions showing all the states, which are folders as well.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="*"
	 creationComplete="createComplete()">
	<mx:Script>
		<![CDATA[
			import mx.events.FlexEvent;
			import mx.controls.Alert;
			
			private function createComplete():void
			{
				MainTree.addEventListener(mx.events.FlexEvent.UPDATE_COMPLETE,testExpand);
			}
			
			private function testExpand(evt):void
			{
				if(MainTree.dataProvider != null)
				{
					var obj = MainTree.dataProvider;
					for(var i:int = 0; i < obj.length; ++i)
						this.MainTree.expandItem(obj[i],true);
					MainTree.removeEventListener(mx.events.FlexEvent.UPDATE_COMPLETE,testExpand);
				}  
			}
		]]>
	</mx:Script>
	<ns1:ibiCanvas right="0" left="0" top="0" bottom="0">
		<ns1:ibiTree width="221" left="10" top="10" bottom="10" id="MainTree" ibiShowLabelFolder="false" ibiTreeLabelField="REGION,ST,CITY" ibiUseColumns="REGION,ST,CITY">
			<ns1:seturl>http://xxxxxxxxxx/ibi_apps/WFServlet?IBIF_ex=wfobj&IBIAPP_app=baseapp</ns1:seturl>
		</ns1:ibiTree>
	</ns1:ibiCanvas>
</mx:Application>



Hope this helps




Scott

Thanks - that worked like a charm. I was missing the eventlistener piece to get Flex to recognize my ExpandItem command.


WebFocus 7.6.6, Win2k, Excel, PDF, Flat files, XML, HTML, Flex 1.0.1