PrimeFaces JSF - p: commandButton for update and oncomplete

0

I am trying to make a orderList and am having trouble setting the attributes in the commandButton update and oncomplete tag. I also do not know what their function is, but I know it does not work right if not configured right. Would someone clarify me? Thank you.

<p:orderList value="#{cliente.listaClientes}" var="cl" controlsLocation="none" itemLabel="#{cl.nome}" itemValue="#{cl}" />
<p:commandButton value="Submit" update="displayListaClientes" oncomplete="PF('clDialog').show()" style="margin-top:5px" />
    
asked by anonymous 04.05.2016 / 13:16

2 answers

1

Looking at your code I saw that the 'oncomplete' is correct, it will execute this function from primefaces to show its dialog. As for Update it works when you need to update something inside your screen, such as updating your 'form' after the click of this button.

<h:form id="form_user">
    <p:commandButton value="Submit" update="form_user" oncomplete="PF('clDialog').show()" style="margin-top:5px" />
</h:form>
    
03.06.2016 / 20:44
0

The update updates the part of the screen in question. You can enter the id of the component if it is contained by a container (such as a panelGroup) updates all the components within the tag in question.

Ex when you click a button you want to update only part of the screen instead of the whole screen. In the update you inform which part or parts of the screen you want to update.

The oncomplete already executes something (javascript) when the ajax request is completed.

    
04.05.2016 / 16:40