0

I have a datatable that displays a list of elements where in each row there is checkBOX that displays or hides a button in another column with every check/uncheck action.

I tried rendering the id of the column and the id of the linkCommands but it wont work.

I also tried render=":form1:activateButton :form1:deactivateButton" to render both linkCommands but i got a FacesException: f:ajax contains an unknown id - cannot locate it in the context of the component

<h:form id="form1">
<a4j:region>
<rich:dataTable id="elementList" 
value="#{object.elementList}"
var="element" rowKeyVar="index">
<f:facet name="header">
<rich:columnGroup>
<rich:column>
...
</rich:column>
<rich:column>
<h:outputText
value="Actions" />
</rich:column>
</rich:columnGroup>
</f:facet>
<rich:column>
<h:selectBooleanCheckbox id="checkBox"
value="#{element.selected}"  >
<f:ajax event="click"
                    render="actions"  execute="@form"  />
</h:selectBooleanCheckbox>
</rich:column>
<rich:column style="text-align: center;" id="actions">
<a4j:commandLink id="activateButton"
rendered="#{element.selected and element.deactivated 'true'}"
action="">
<h:graphicImage  name="tick.png" />
</a4j:commandLink>
<a4j:commandLink id="deactivateButton"
rendered="#{element.selected and !element.deactivated }"
action="">
<h:graphicImage  name="cross.png" />
</a4j:commandLink>
</rich:column>
BalusC
  • 1,040,783
  • 362
  • 3,548
  • 3,513
Melai11
  • 108
  • 8

0 Answers0