Primefaces - The variable is not updated

1

I have the following table in a dialog with a p:commandLink , which when clicked must update the value of the variable encab_idadmision , taken from admv.idadmision .

Already review and admv.idadmision has the value, however encab_idadmision , is not updated.

What am I doing wrong?

  <p:dataTable id="dt_buscar_adm" var="admv" value="#{b_ventas.l_bus_adm_tbl}" paginator="true" rows="10" styleClass="paginated">

                        <p:column style="width: 30px">
                              <p:commandLink update="fventas:head_nro_atencion" oncomplete="PF('pac_admitidos').hide();" styleClass="ui-icon ui-icon-search" style="float:left;margin-right:10px" title="View">
                                  <f:setPropertyActionListener value="#{admv.idadmision}" target="#{b_ventas.encab_idadmision}" />
                              </p:commandLink>
                        </p:column> 
    
asked by Santiago Matiz 14.09.2016 в 15:01
source

3 answers

1

Try this syntax

<p:commandLink update=":#{p:component('encab_idadmision')}" 
    
answered by 04.10.2016 в 13:40
0

I would try something different, but anyway if it were you would do it in the commandLink listener since I do not like to use the f: setPropertyActionListener because it masks logic in the xhtml

<p:commandLink styleClass="ui-icon ui-icon-search" style="float:left;margin-right:10px" title="View">
<f:setPropertyActionListener value="#{admv.idadmision}" target="#{b_ventas.encab_idadmision}" />
<p:ajax update="fventas:head_nro_atencion" oncomplete="PF('pac_admitidos').hide();" />
</p:commandLink>
    
answered by 13.10.2016 в 08:48
0

I guess that fventas is a form , and what is happening to you is that you are doing wrong the reference.

<p:commandLink update="fventas:head_nro_atencion"...

The correct reference should be with two points before, as follows:

<p:commandLink update=" : fventas: head_nro_atencion "... '

Normally when some element is not being referenced correctly, certain actions are not performed normally, as in this case.

Check here 3 techniques to correctly reference the components:

link

Greetings!

    
answered by 25.01.2017 в 23:17