﻿<?xml version="1.0" encoding="utf-8" ?> 
<application-components>
   <application-component id = "tree_context">
       <!-- participant-id ="datagrid" -->
      <![CDATA[
         component_init:function(){
            var sP = Hemi.GetSpecifiedAttribute(this.getContainer(),"participant-id");
            if(!sP) sP = "datagrid";
            this.joinTransactionPacket(sP);
            this.getProperties().SharedTransaction = sP;
            
            var oLabel = document.createElement("div");
            var oText = document.createElement("div");
            this.getContainer().appendChild(oLabel);
            this.getContainer().appendChild(oText);
            this.getObjects().label = oLabel;
            this.getObjects().text = oText;
            oLabel.className = "explorer_address_label";
            //oText.className = "explorer_address_text";
            oLabel.appendChild(document.createTextNode("Path:"));

            //this.getContainer().appendChild(document.createElement("div"));
            // Announce to the trees that the context is available
            // This could also be done with contextually sensitive MessageService publications
            // But using the transaction allows for a many-to-many communication on the same band
            this.serveTransaction("contextload",this);
		 },
        component_destroy : function(){
	        this.getObjects().label = 0;
	        this.getObjects().text = 0;							 
        },
        _handle_treeload : function(s, v){
	        // 
	        Hemi.xml.setInnerXHTML(this.getObjects().text, v.data.src.GetCurrentPath());
        },
        _handle_treenavigate : function(s, v){
		        Hemi.xml.setInnerXHTML(this.getObjects().text, v.data.src.GetCurrentPath());
        }
			]]>
		</application-component>
</application-components>
