I have a issue with primefaces generating repeated IDs for checkboxes.
I have 2 guys, one with 2 tests and other with 4 tests.
When I list them using subTable (http://www.primefaces.org/showcase/ui/d ... bTable.jsf) the ID that primefaces generates for each checkbox is based on the checkbox position under the person.
That means each first person test will have an ID as zero, the second as 1, the third as 2...
Below is an screenshot of the first test of each person being highlighted when I just pass the mouse over anyone of the first checkboxes.
The same happens when I pass mouse over the second test checkbox, the checkbox that is in second position of each person is highlighted.
How can I generate dynamic checkbox IDs?
I tryied to set id="#{test.testId}" but all just crashes when I do that...
Is this a PrimeFaces bug?
XHTML code:
Code: Select all
<p:dataTable id="sorotable"
style="text-align: center; width: 806px; margin-top: 5px; margin-left: -15px !important;"
rowKey="#{e.resExameCmDcId}"
styleClass="list" tableStyleClass=" list2 list-table mg-leftless5"
value="#{cc.attrs.exameAccordion.exameCMDCBean.pessoasCMDC}" var="pessoaCMDC" paginator="false"
emptyMessage="#{global['global.mensagem.vazio']}" >
<p:columnGroup type="header">
<p:row>
<p:column headerText="Checkbox" />
<p:column headerText="Soro" />
<p:column headerText="PRA AGH c/DIT" />
<p:column headerText="PRA AGH s/DIT" />
<p:column headerText="PRA Quali I" />
<p:column headerText="PRA Quali II" />
<p:column headerText="PRA Quanti I" />
<p:column headerText="PRA Quanti II" />
</p:row>
</p:columnGroup>
<p:subTable id="subtable" var="exame" value="#{pessoaCMDC.exameCMDC}">
<f:facet name="header">
<p:column style="text-align: center; min-width: 0px; width: 200px;">
<h:outputText value="#{pessoaCMDC.nome} "/>
</p:column>
<p:column style="text-align: center; min-width: 0px; width: 70px">
<h:outputText value=" - RGCT: #{pessoaCMDC.rgct} "/>
</p:column>
</f:facet>
<p:column style="text-align: center;">
<p:selectBooleanCheckbox
value="#{exame.selected}"
disabled="#{(exame.resExameCmDcId==null?false:true) or (cc.attrs.exameAccordion.disableEdicao)}">
<p:ajax listener="#{exameCMDCMBean.processSoroSelection}" />
<f:attribute name="selres" value="#{pessoaCMDC.exameCMDC}" />
<f:attribute name="ex" value="#{cc.attrs.exameAccordion}" />
</p:selectBooleanCheckbox>
</p:column>
<p:column style="text-align: center;min-width: 0px; width: 120px">
<h:outputText value="#{exame.soroId.nomeAmostra}"/>
</p:column>
<p:column style="text-align: center;min-width: 0px; max-width: 80px; min-width: 20px;">
<h:outputText value="#{exame.praAghSemDTT}"/>
</p:column>
<p:column style="text-align: center;min-width: 0px; max-width: 80px; min-width: 20px;">
<h:outputText value="#{exame.praAghComDTT}"/>
</p:column>
<p:column style="text-align: center;min-width: 0px; min-width: 20px;">
<h:outputText value="#{exame.praQualiI}"/>
</p:column>
<p:column style="text-align: center;min-width: 0px; min-width: 20px;">
<h:outputText value="#{exame.praQualiII}"/>
</p:column>
<p:column style="text-align: center;min-width: 0px; min-width: 20px;">
<h:outputText value="#{exame.praQuantiI}"/>
</p:column>
<p:column style="text-align: center;min-width: 0px; min-width: 20px;">
<h:outputText value="#{exame.praQuantiII}"/>
</p:column>
</p:subTable>
<p:columnGroup type="footer"/>
</p:dataTable>