Primefaces 10 Dialog funcion ajax event close no actualiza Datatable selection

Community Discussions in Spanish
Post Reply
lduque0114
Posts: 1
Joined: 19 Aug 2019, 06:47

07 May 2021, 19:41

Necesito de su ayuda, no se si es una actualización de prime que esta con bug o el bug es mio jajaja... tengo un btn que al hacer click abre un dialog, pero ese btn se encuentra disabled en su estado inicial que al hacer click o seleccionar en una fila del datatable cambia el estado del btn para poder hacer click y aperturar el dialog. Al cerrar este dialog este genera un event close con ajax el cual debería actualizar el datatable(para eliminar la fila seleccionada), el btn para poner disabled de nuevo y el dialog para setear los campos. Pero al hacer el event close actualiza el dialog y el btn pero no el datatable el mismo queda con la selección activa. pense que era algo que estaba haciendo mal pero no es asi, el problema esta que este comportamiento servía en version 8 de primefaces en version 10 no lo hace y no encuentro la forma de ver el porque o de como hacerlo.

xhtml

<html xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">

<h:head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>.: Ejemplo :.</title>
link rel="icon" type="image/vnd.microsoft.icon"
href="./img/favicon.ico" />
</h:head>
<h:body>
<f:loadBundle basename="language_es_VE" var="bundle" />
<h:form id="bull">
<p:commandButton process="@this" title="#{bundle.UPDATE}"
icon="pi pi-pencil" disabled="#{pageController.tbButtonW}"
id="updateUserLink" oncomplete="PF('dedede').show()"
update="bull:dataTablePrueba,bull:updateUserLink" />


<p:dataTable id="dataTablePrueba" var="prue" reflow="true"
widgetVar="dtPrueba" emptyMessage="#{bundle.DT_EMPTY_MESSAGE}"
filteredValue="#{pgBannerController.pgBannerListFilter}" rows="10"
paginator="true" paginatorPosition="bottom"
paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
currentPageReportTemplate="Registros: {totalRecords} - Pag ({currentPage} #{bundle.PAGE_DIVISOR} {totalPages})"
selectionMode="single" selection="#{pageController.selectedBanner}"
rowKey="#{prue.id}" value="#{pageController.pgBannerList}">

<p:ajax event="rowSelect" update="bull:updateUserLink" />

<p:column filterBy="#{banner.pictureName}"
sortBy="#{prue.pictureName}" headerText="Nombre Imagen"
filterMatchMode="contains">
<h:outputText value="#{prue.pictureName}" />
</p:column>

<p:column filterBy="#{prue.pictureFormat}"
sortBy="#{prue.pictureFormat}" headerText="Formato Imagen"
filterMatchMode="contains">
<h:outputText value="#{prue.pictureFormat}" />
</p:column>

</p:dataTable>
</h:form>

<h:form id="bull2">
<!-- .:::::: DIALOGO MODIFICAR BANNER ::::::. -->
<p:dialog id="dedede" widgetVar="dedede" draggable="false"
header="modificar dialog" closable="true" resizable="false"
closeOnEscape="true" modal="true" appendTo="@(body)">

<p:ajax event="close" listener="#{pageController.limpiarBTN}"
update="bull2:dedede, bull:dataTablePrueba, bull:updateUserLink" />
</p:dialog>
</h:form>

<!-- jQuery library -->
<!-- Latest compiled JavaScript -->
<script src="./css/js/popper.min.js"></script>
<script src="./css/js/bootstrap.min.js"></script>
</h:body>
</html>

Post Reply

Return to “Spanish”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests