3
Inside my code I have two variables called displayMessage and displayImage that are two Strings, as the method is running, the messages are being updated. In my Managedbean messages are updated, but I have not found an effective way to render this information on the page xhtml, which to each change would like the messages to be updated within a dialog.
Follow an excerpt of my code below:
<p:commandButton value="Buscar" id="pesquisa"
class="ui-button-custom ui-button-busca"
action="#{fluxo.veiculos}" process="@form"
update="@form" onclick="PF('statusDialog').show();" />
<p:dialog id="mod" modal="true" widgetVar="statusDialog" header="Status"
draggable="false" closable="true">
<h:form id="idformdialog">
<div class="modal-content">
<p:graphicImage id="displayImage1" url="#{fluxoPeriodo.displayImage}" />
<h:outputText id="displayMessage1" value="#{fluxoPeriodo.displayMessage}" />
</div>
<div class="modal-content">
<p:graphicImage id="displayImage2" url="#{fluxoPeriodo.displayImage2}" />
<h:outputText id="displayMessage2" value="#{fluxoPeriodo.displayMessage2}" />
</div>
</h:form>
</p:dialog>
By clicking the button Fetch appears to dialog about a datatable while information is processed.
Below follows the way I would like the information to be shown in my dialog:
Does anyone have any suggestions on how to achieve this goal?
Gratefully, Well
It’s gotten a lot better, but I haven’t reached my goal yet. What happens is that the message of the last equipment appears as soon as it finishes the execution of the method. I would like during the process, the equipment exchange information to appear in my dialog, for example: Processed Equipment 3! Equipment 4 in process ... Next update: Equipment 4 processed Equipment 5 in process. Thank you
– Well Silva
@Wellsilva Which version of Primefaces you’re using?
– ℛɑƒæĿᴿᴹᴿ
I’m using API 6.1
– Well Silva
@Wellsilva updated reply, check if helped, please.
– ℛɑƒæĿᴿᴹᴿ
I’ll check thank you.
– Well Silva
It took effect in this way: public void updateForm() { Requestcontext.getCurrentInstance(). update("idformdialog:displayImage1"); Requestcontext.getCurrentInstance(). update("idformdialog:displayMessage1"); Requestcontext.getCurrentInstance(). update("idformdialog:displayImage2"); Requestcontext.getCurrentInstance(). update("idformdialog:displayMessage2"); Facescontext.getCurrentInstance(). addMessage(null, new Facesmessage("Success", "Success")); }
– Well Silva
Requestcontext.getCurrentInstance(). update("mod"); Did not succeed in this way. But even I put the execution in some snippets of the code he updated status of the last equipment, when the execution of the method ended. There has to be a way to do this, as you yourself said it is a way, great way, helped me a lot.
– Well Silva
My method runs within a FOR, what happens, it makes 4 equipment if select 4, but shows only the last, when in fact my goal is it get to show the process one by one.
– Well Silva
It will be necessary to orchestrate these calls to achieve the desired effect
– ℛɑƒæĿᴿᴹᴿ
Exactly I was thinking about it ... He only does it when he finishes the method. I will work on the method and soon get to a conclusive answer. Post here.
– Well Silva