• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Automatically refresh datatable when Session Bean changes

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an JSF application that uses a data table (i.e. <h:datatable>) to display the values inside of a Session Bean (via a Backing Bean). The problem I have is that the Session Bean is continuously being updated on the server. The data table needs to reside on the client side for manipulation purposes (e.g. sorting, filtering, hide/show columns)

How do I manage to push these changes to my data table?
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds like that you´re using entirely Javascript for sorting/filtering/hiding/showing without re-requesting the data from the server side. In this case, you can´t do anything but polling for the server for new data. HTTP disallows pushing data to the client, so you can´t do any much from the server side on.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bauke Scholtz wrote: HTTP disallows pushing data to the client, so you can´t do any much from the server side on.



Which is why true MVC is impossible via HTTP. In true MVC, asynchronous changes to the Model will cause the Controller to update the View. Since HTTP is strictly request/response, the view can only be updated when a new request is made - either by an explicit action or by having client-side polling - the HTTP standard strictly forbids unsolicited responses. In fact, without a request, the very word "response" is meaningless, since it's a reactive word, not an active one.

Still, the nice thing about JSF is that it's about as close to true MVC as HTTP will let you get.
 
I'm thinking about a new battle cry. Maybe "Not in the face! Not in the face!" Any thoughts tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic