Ops, sorry for two posts...
if you mean that :-)
do this:
<t:dataTable id="containingTable" rowIndexVar="rowIndex" ....>
...
<t:dataTable id="childTable"
forceId="true"
forceIdIndexFormula="#{rowIndex}" ... >.
..
</t:dataTable>
</t:dataTable>
<h:dataTable border="0" rowClasses="" value="#{Version2$reception2.events}" var="var" width="100%">
<h:column>
<h:selectBooleanCheckbox rendered="#{not var.hasChild}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText style="font-weight: bold" value="Purpose of Registration"/>
</f:facet>
<h:outputLabel value="#{var.name}" onclick="ShowHide2('#{var.eventKeyword}')"/>
<h:dataTable value="#{var.children}" var="childVar" id="...">
<h:column>
<h:selectBooleanCheckbox rendered="#{not childVar.hasChild}"/>
</h:column>
<h:column>
<h:outputText value="#{childVar.name}"/>
</h:column>
</h:dataTable>
I need to set the appropriate id for the nested datatable so that it can be given as an argument to the javascript in the main table. I use Sun JSF 1.1
I see. You want to prevent the ID's being woodstocked? You can't do it in JSF 1.1.
Rather use the 'this' reference in Javascript and then do a lookup for the child datatable based on the ID of the reference.
Example JSF<h:column>
<h:outputLabel id="label" value="#{var.name}" onclick="showHide(this);">
<h:dataTable id="childTable">
...
</h:dataTable>
</h:column>
JSfunction showHide(element) {
var childTable = document.getElementById(element.id.substring(0, element.id.lastIndexOf(':')) + ':childTable');
childTable.style.display == 'none' ? childTable.style.display = 'block' : childTable.style.display = 'none';
}