Render message before method completes

UI Components for JSF
Post Reply
tcms
Posts: 1
Joined: 13 Nov 2017, 23:59

14 Nov 2017, 00:08

Hi,

Currently I'm using PF 6.0 and find out that the component rendering only takes effect after a method completion. Probabily this is related with JSF life cycle, but i'm not sure.

For example, when we add a message with FacesMessage, this message only showup after the method that calls the FacesMessage ends. It's possible to show up the message as soon as it was set, or it only show up after method is completed?

This could be useful for Dialog confirms with response callbacks. If a dialog confirm is invoked on an actionlistener, the method will be waiting until the user gives some callback, after that, the code continues.

Is it possible?

Jan Eckert
Posts: 84
Joined: 11 Sep 2014, 10:13
Location: Brussels, Belgium

15 Nov 2017, 16:24

I do not completely understand your request. But there is the infamous way to shortcut the Lifecycle by calling

Code: Select all

FacesContext.getCurrentInstance().renderResponse();
If you need to give feedback on user input before even looking on other inputs, the immediate-attribute of UIInput components might be what you are looking for. I know that my answer is vague, but so is your question :P

Take care
Primefaces 6.1+
Wildfly 11

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

21 Nov 2017, 13:23

You cannot in the middle of an action, suspend it, ask the user for feedback and continue. You should implement that in two steps, two actions to the server. For just providing feedback TO the user, you could try using 'push' mechanisms.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 40 guests