Priemfaces p: commandButton with ui: repeat only one button works

0

Good I have the following problem, I am using primefaces for my front and in a section I am using the ui: repeat of JSF to generate dynamically a grid view where each grid shows a bank and its balance according to different conditions, now the code repeat perfectly fulfills its function and perfectly generates my bank grid with its different balances, however, by proving the "See movements" button, only the first box works for me, the others do not do anything or mark the console error.

I leave the code here

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:p="http://primefaces.org/ui">
<h:head>
<link rel="stylesheet" href="recursos/CSS_Inicio.css"/>
<link rel="stylesheet" href="recursos/CSS_General.css"/>
<link rel="stylesheet" href="recursos/CSS_Medidas.css"/>
</h:head>
<h:body>
<div>
    <h:form>
        <p:menubar model="#{menu.model}"/>
    </h:form>
</div>

<div>
    <h:form prependId="false" id="visor_bancos">
        <div class="Contenerdo_Banco" >
            <ui:repeat var="ban" value="#{inicio.lista_Bancos}">
                <div class="Banco">
                    <div class="Banco_Titulo">
                        <p:outputLabel value="#{ban.banco}" />
                    </div>

                    <div class="Visor_Saldos Margin_top_05">
                        <div class="Margin_top_05">
                            <p:outputLabel value="Saldo" />
                        </div>
                        <div>
                            <p:outputLabel value="#{inicio.saldo_conciliado(ban.id_banco)}" />
                        </div>
                        <div class="Margin_top_05">
                            <p:outputLabel value="Asignación sin conciliar" />
                        </div>
                        <div>
                            <p:outputLabel value="#{inicio.montos_sin_conciliar(ban.id_banco, 'ASIGNACION')}" />
                        </div>
                        <div class="Margin_top_05">
                            <p:outputLabel value="Deducción sin conciliar" />
                        </div>
                        <div class="Margin_bottom_05">
                            <p:outputLabel value="#{inicio.montos_sin_conciliar(ban.id_banco, 'DEDUCCION')}" />
                        </div>
                    </div>

                    <div>
                        <h:form>
                            <p:commandButton class="Banco_Botones Margin_top_05" 
                                            value="Ver movimientos#{ban.id_banco}" 
                                            action="#{movimientos.cargar_lista_movimientos(ban.id_banco)}"/>
                            <p:commandButton class="Banco_Botones Margin_top_05" value="Eliminar banco" />
                        </h:form>
                    </div>
                </div>
            </ui:repeat>
            <p:commandButton value="Agregar&#10;Banco" onclick="PF('banco_Nuevo').show();" class="Banco_Agregar_Boton"/>
        </div>
    </h:form>
</div>

<!--VENTANAS EMERGENTES (MODALES)-->
<p:dialog widgetVar="banco_Nuevo" modal="true" >
    <ui:include src="/Bancos/nuevo_banco.xhtml"/>
</p:dialog>
</h:body>
</html>
    
asked by David Valado 19.08.2018 в 03:03
source

1 answer

0

I have already solved the problem, I have removed the tags from the grouping of the commandButtons and it works well now.

               <div>
                    <h:form>
                        <p:commandButton class="Banco_Botones Margin_top_05" 
                                        value="Ver movimientos#{ban.id_banco}" 
                                        action="#{movimientos.cargar_lista_movimientos(ban.id_banco)}"/>
                        <p:commandButton class="Banco_Botones Margin_top_05" value="Eliminar banco" />
                    </h:form>
                </div>

Now the code was made

                        <div>
                        <p:commandButton class="Banco_Botones Margin_top_05" 
                                        value="Ver movimientos#{ban.id_Banco}" 
                                        action="#{movimientos.ir_A_Movimientos(ban.id_Banco)}"/>
                        <p:commandButton class="Banco_Botones Margin_top_05" value="Eliminar banco" />
                    </div>
    
answered by 09.09.2018 / 11:17
source