
However, my company modified the code a bit to be a bit more universal in terms of our client, but for some reason, the drop down and closing features don't work.
Please let me know if anyone has faced same issue.
<!--
Note on Changing: Scroll down or search for "Change"
Ignore warnings
-->
<apex:component Controller="OrganisationStructure" id="pageid" allowDML="true">
<apex:attribute name="currentId" description="This is the Hierarchy" type="String" required="true" assignTo="{!currentId}"/>
<apex:form id="outerformid" >
<div class="treeNode">
<apex:repeat value="{!ObjectStructure}" var="pos" >
<apex:repeat value="{!pos.levelFlag}" var="flag" first="0">
<apex:image url="/img/tree/empty.gif" height="16" width="20" rendered="{!IF(flag,false,true)}"/>
<apex:image url="/s.gif" alt="" width="3" height="16" rendered="{!IF(flag,true,false)}"/>
<apex:image url="/img/tree/chain.gif" height="16" width="20" rendered="{!IF(flag,true,false)}"/>
</apex:repeat>
<span height="16" v="top">
<apex:outputText rendered="{!IF(pos.nodeType=='start',true,false)}">
<apex:image id="tree_start" url="/img/tree/minusStart.gif" height="16" width="20" title="Click to expand/collapse nested items." onClick="TreeNodeElement.prototype.toggle(this,'{!pos.nodeId}');changeImage('{!$Component.tree_start}', 1)"/>
<apex:image id="Icon_start" url="/img/icon/custom51_100/globe16.png" width="16" height="16" rendered="{!IF(pos.currentNode,false,true)}"/>
<apex:image id="Icon_start_current" url="/img/icon/star16.png" width="16" height="16" rendered="{!IF(pos.currentNode,true,false)}"/>
</apex:outputText>
<apex:outputText rendered="{!IF(OR(pos.nodeType=='parent',pos.nodeType=='parent_end'),true,false)}">
<apex:image id="Tree_parent" url="/img/tree/minus.gif" rendered="{!IF(pos.nodeType=='parent',true,false)}" height="16" width="20" title="Click to expand/collapse nested items." onClick="TreeNodeElement.prototype.toggle(this,'{!pos.nodeId}');changeImage('{!$Component.Tree_parent}', 2)"/>
<apex:image id="Tree_parent_end" url="/img/tree/minusEnd.gif" rendered="{!IF(pos.nodeType=='parent_end',true,false)}" height="16" width="20" title="Click to expand/collapse nested items." onClick="TreeNodeElement.prototype.toggle(this,'{!pos.nodeId}');changeImage('{!$Component.Tree_parent_end}', 3)"/>
<apex:image id="Icon_parent" url="/img/icon/factory16.png" width="16" height="16" rendered="{!IF(pos.currentNode,false,true)}"/>
<apex:image id="Icon_parent_current" url="/img/icon/star16.png" width="16" height="16" rendered="{!IF(pos.currentNode,true,false)}"/>
</apex:outputText>
<apex:outputText rendered="{!IF(OR(pos.nodeType=='child',pos.nodeType=='child_end'),true,false)}">
<apex:image id="Tree_child" url="/img/tree/node.gif" rendered="{!IF(pos.nodeType=='child',true,false)}" height="16" width="20" title="Click to expand/collapse nested items." onClick="TreeNodeElement.prototype.toggle(this,'{!pos.nodeId}')"/>
<apex:image id="Tree_child_current" url="/img/tree/nodeEnd.gif" rendered="{!IF(pos.nodeType=='child_end',true,false)}" height="16" width="20" title="Click to expand/collapse nested items." onClick="TreeNodeElement.prototype.toggle(this,'{!pos.nodeId}')"/>
<apex:image id="Icon_child" url="/img/icon/desk16.png" width="16" height="16" rendered="{!IF(pos.currentNode,false,true)}"/>
<apex:image id="Icon_child_current" url="/img/icon/star16.png" width="16" height="16" rendered="{!IF(pos.currentNode,true,false)}"/>
</apex:outputText>
<apex:outputText rendered="{!IF(pos.nodeType=='end',true,false)}">
<apex:image id="Tree_end" url="/img/tree/nodeEnd.gif" height="16" width="20"/>
<apex:image id="Icon_end" url="/img/icon/desk16.png" width="16" height="16" rendered="{!IF(pos.currentNode,false,true)}"/>
<apex:image id="Icon_end_current" url="/img/icon/star16.png" width="16" height="16" rendered="{!IF(pos.currentNode,true,false)}"/>
</apex:outputText>
<!-- Change Below -->
<apex:outputLink value="/{!pos.account.id}" style="{!IF(pos.currentNode,'font-weight: bold;','')}" styleClass="columnHeadActiveBlack" target="_top">{!pos.account.Firmation__c}</apex:outputLink>
<!-- Include the following if you uses sites with accounts -->
<!-- Stop -->
</span>
<div> </div>
<apex:outputText rendered="{!IF(OR(pos.nodeType=='child_end',pos.nodeType=='child'),false,true)}">
<div id='{!pos.nodeId}'/>
</apex:outputText>
<apex:outputText rendered="{!IF(OR(pos.nodeType=='child_end',pos.nodeType=='child'),true,false)}">
<div id='{!pos.nodeId}'><apex:image url="/s.gif" alt="" width="1" height="1"/></div>
</apex:outputText>
<apex:repeat value="{!pos.closeFlag}" var="close" />
</apex:repeat>
<br/><br/><br/>
</div>
2 respuestas
+1 @Robin - head on over to the Developer Community for expert assistance with programming-related topics.