http://www.primefaces.org:8080/prime-sh ... onAjax.jsf
My problem is when i select an item, it work fine, but, in the second and next selections, the first item i selected is shown again in the update panel.
Let me show what i do.
In the client side:
Code: Select all
<p:dataTable emptyMessage="Ningún registro encontrado" firstPageLinkLabel="Primero" id="dataTable1" lastPageLinkLabel="Último"
loadingMessage="Cargando datos" nextPageLinkLabel="Siguiente" paginator="true" previousPageLinkLabel="Anterior"
rows="15" selection="#{RequestBean1.minaSeleccionada}" selectionMode="single"
style="left: 744px; top: 114px; position: absolute; width: 400px; z-indez: 10;" update="display" value="#{SessionBean1.arrayMinas}"
var="currentRow" width="456"
onselectComplete="minaDialog.show()"
>
<p:column id="column1">
<h:outputText id="outputText1" value="#{currentRow['seleccion']}"/>
<f:facet name="header">
<h:outputText id="outputText2" value="S"/>
</f:facet>
</p:column>
<p:column id="column2">
<h:outputText id="outputText3" value="#{currentRow['provincia']}"/>
<f:facet name="header">
<h:outputText id="outputText4" value="Provincia"/>
</f:facet>
</p:column>
<p:column id="column3">
<h:outputText id="outputText5" value="#{currentRow['numeroRegistro']}"/>
<f:facet name="header">
<h:outputText id="outputText6" value="Nº de Registro"/>
</f:facet>
</p:column>
<p:column id="column4">
<h:outputText id="outputText11" value="#{currentRow['denominacion']}"/>
<f:facet name="header">
<h:outputText id="outputText12" value="Denominacion"/>
</f:facet>
</p:column>
</p:dataTable>
<p:dialog header="Detalle Explotación" widgetVar="minaDialog"
modal="true" fixedCenter="true" draggable="false" width="250px">
<h:panelGrid columns="2" id="display" style="height: 96px; left: 792px; top: 0px; position: absolute; width: 400px; z-indez: 10">
<h:outputText value="Provincia:"/>
<h:outputText style="font-weight:bold" value="#{RequestBean1.minaSeleccionada[0].provincia}"/>
<h:outputText value="Nº de Registro:"/>
<h:outputText style="font-weight:bold" value="#{RequestBean1.minaSeleccionada[0].numeroRegistro}"/>
<h:outputText value="Denominación:"/>
<h:outputText style="font-weight:bold" value="#{RequestBean1.minaSeleccionada[0].denominacion}"/>
</h:panelGrid>
</p:dialog>
SessionBean1:
Code: Select all
private MinaSelec[] ArrayMinas;
//setters an getters
Code: Select all
private Object[] MinaSeleccionada;
public void setMinaSeleccionada(Object[] MinaSeleccionada){
this.MinaSeleccionada=MinaSeleccionada;
}
public Object[] getMinaSeleccionada(){
return this.MinaSeleccionada;
}
I´m sure i´m doing something worng, can you help me, please
Thank you
Best Regards