I have the next code on my JSF page:
<b:dataTable value = "#{formBean.formularios}" var = "formulario" id = "dataTableFormularios">
<p:column>
<f:facet name = "header">
<h:outputText value = "Nombre Formulario"/>
</f:facet>
<h:form>
<p:commandLink update = "..." process="@this" action="..." value = "#{formulario.nombre}"/>
</h:form>
</p:column>
</b:dataTable>
My goal: I want to provide the user the ability to remove some records from the table simultaneously and without much effort. What do you recommend me to do?
My proposal: Use b:selectBooleanCheckbox
with a button and cover all this in a <h:form>
.
The problem with my proposal: In order to cover all selectBooleanCheckbox
with a button, I think it should also cover the entire table.
If I recubro entire table would have a structure failure by the <h:form>
of <p:commandLink>
:
<h:form>
<b:dataTable value = "#{formBean.formularios}" var = "formulario" id = "dataTableFormularios">
<p:column>
<f:facet name = "header">
<h:outputText value = ""/>
</f:facet>
<b:selectBooleanCheckbox value = "{#formulario.id}"/>
</p:column>
<p:column>
<f:facet name = "header">
<h:outputText value = "Nombre Formulario"/>
</f:facet>
<h:form>
<p:commandLink update = "..." process="@this" action="..." value = "#{formulario.nombre}"/>
</h:form>
</p:column>
</b:dataTable>
<b:commandButton .../>
</h:form>
Just wrap your whole
dataTable
with aform
like you did and remove all otherform
elements inside yourdataTable
. ThecommandLink
within thedataTable
will still work