Passing id of a component inside a rich:tree..........help :(
sksumit1 Mar 12, 2010 1:52 AM<rich:tree id="treeForContract"
value="#{nominationDetailsContractBacking.tree}" var="node"
switchType="client" style="margin : 0 0 0 170px;">
<rich:treeNode>
<h:inputText value="#{node.nodeName}"
style="border: 0px;width:70px;FONT-SIZE: 11px;text-align:left;" readonly="true"/>
<rich:spacer width="#{node.nodeAlign}" />
<h:inputText value="#{node.nodeAllocation}"
style="border: 0px;width:70px;FONT-SIZE: 11px;text-align:left;" readonly="true"/>
<rich:spacer width="80" />
<h:inputText value="#{node.distributerName}" id="d1" onkeyup="authorize(id);">
</h:inputText>
<a:region renderRegionOnly="true" id="region" >
<rich:suggestionbox for="d1" width="200" height="200"
suggestionAction="#{nominationDetailsContractBacking.suggestionActionForName}" var="disName">
<h:column>
<h:outputText value="#{disName.name}" />
</h:column>
</rich:suggestionbox>
</a:region>
<rich:spacer width="40"></rich:spacer>
<h:selectBooleanCheckbox value="#{node.nodeDeleteFlag}" id="auth">
<a:support actionListener="#{nominationDetailsContractBacking.putCISinSession(node)}"
event="onclick" eventsQueue="inputQueue"/>
</h:selectBooleanCheckbox>
<h:inputHidden value="#{node.nodeKeyId}" />
<h:inputHidden value="#{node.nodeId}" />
<rich:separator lineType="solid" width="430px" style="margin: 2px 0 0 #{node.nodeAlign + 45}px;" />
</rich:treeNode>
</rich:tree>
HERES JAVASCRIPT
<script>
function authorize(caller){
var value=caller.lastIndexOf(":")
var num = new Number(value);
var result=caller.substring(0,num+1);
var authorizedValue=document.getElementById(result.concat("auth")).checked;
if(authorizedValue == false){
document.getElementById(result.concat("auth")).click();
}
}
</script>
I want to click the checkbox "auth" when something is getting selected from "d1". The click works fine , but the suggestion box disappears and i have to search again to get the suggestion box popup. I tried calling the javascript from the suggestion box itself, but at run time a style tag encapsulates the javascript call and it doesn't have an id. Please help me in solving this problem.