Update form fields in UI in between an AJAX call

UI Components for JSF
Post Reply
mainak1990
Posts: 22
Joined: 07 Jan 2016, 13:22
Location: Kolkata

06 May 2016, 08:11

Hi,

I have a multi row selection datatable where there is column named "Status'. My objective is to update the status in between an Ajax call.
Suppose I have selected 5 rows and clicked on the command button then, once the status of the first row is received from data base it needs to shown to UI immediately and execution continues for the rest rows and update accordingly one by one in UI.

Currently I am able to update the status for all the rows after the entire list is populated in managed bean class. So the status of those rows are getting updated all together.

How can I achieve this? Please help me asap.

Thanks,
Mainak
Kolkata, India
Mainak Mukherjee
Kolkata, India
Programmer / Web Developer
PrimeFaces 5.2 / PF Extensions 3.2.0
JSF 2.2 / IBM WebSphere Portal 7.x

Miguel Cubells
Posts: 99
Joined: 25 Feb 2015, 11:02

06 May 2016, 09:36

Probably you could use PUSH events to do so.
In the server, once a row is ready, you could push an event with a websocket connection to the browser, which is independent from the HTTP AJAX call, and on receiving the javascript event, update a single row with javascript.
You need to configure the Atmosphere framework with PrimeFaces, which is actually quite easy.
PrimeFaces 6.1 / PF Extensions 6.1.1 / Atmosphere 2.4.3
Apache Mojarra 2.2.13+
WildFly 10.1.0.Final

mainak1990
Posts: 22
Joined: 07 Jan 2016, 13:22
Location: Kolkata

13 May 2016, 11:46

Miguel Cubells wrote:Probably you could use PUSH events to do so.
In the server, once a row is ready, you could push an event with a websocket connection to the browser, which is independent from the HTTP AJAX call, and on receiving the javascript event, update a single row with javascript.
You need to configure the Atmosphere framework with PrimeFaces, which is actually quite easy.

Hi Miguel,

Thanks for your input.

It was really something new interesting approach.

Just one thing can you give me some example of this or how to integrate Atmosphere Framework with PrimeFaces?

Thanks in advance.

Mainak
Kolkata, India
Mainak Mukherjee
Kolkata, India
Programmer / Web Developer
PrimeFaces 5.2 / PF Extensions 3.2.0
JSF 2.2 / IBM WebSphere Portal 7.x

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

13 May 2016, 12:50

just check the userguide and showcase. It's called PrimePush.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

smokeybandit
Posts: 277
Joined: 08 Jul 2013, 17:53

13 May 2016, 18:48

Or you could just do a poll to check the status of the row updates, and update them as needed.

I assume the row-by-row updates take considerable time?

mainak1990
Posts: 22
Joined: 07 Jan 2016, 13:22
Location: Kolkata

17 May 2016, 09:07

smokeybandit wrote:Or you could just do a poll to check the status of the row updates, and update them as needed.

I assume the row-by-row updates take considerable time?

My requirement is like that only. I need to update the rows one-by-one.

Anyways thanks everyone for your inputs. I will try this with PrimePush and get back to you.
Mainak Mukherjee
Kolkata, India
Programmer / Web Developer
PrimeFaces 5.2 / PF Extensions 3.2.0
JSF 2.2 / IBM WebSphere Portal 7.x

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 53 guests