Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

update datatable,tree via different different pages

 
prashant rathod
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am using liferay 6.1 and jsf 2.2 and primefaces 3.3
i have two lists displayed using tree component in two different portlets and both portlets are on different pages.
and both lists are coming from the database from the same table.
when i add something to the table using third portlet it gets added to the table in the database.
so i want other two lists(Tree structure) on different portlets should get updated with the new data.
how it is possible.?


 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, this is what I call jolly good fun!

First, realize that regardless of whether a portlet is on the same page or a different page, each portlet instance is operating on its own classpath. And that therefore, they cannot share data models.

Secondly, you have the constraint that HTTP is purely a request/response cycle processor. So the only way to update any webpage at all, whether in part or in full is to send a request to the server and render from its response. Fortunately these days we have AJAX support for partial page rendering at timed intervals. Otherwise the entire portal page would have to be re-rendered. At the cost of making requests to each and every portlet on the page, irrespective of whether or not it was part of the problem set.

Thirdly, you have the problem of getting the portlet UI models up to date. Which, in turn, depends on getting their domain models up to date, if you are using an ORM. Since a change in one app's domain model does not automatically reflect in the domain models of any related apps, you'll need a mechanism to either poll for or be notified of any changes to the data domain attached to each portlet's domain model. For best performance, that means that you also should have a good cache mechanism backing the ORM.

One you have all those items covered, then you'll probably want to optimize the refreshing mechanisms to improve response and reduce overhead. But don't do that until AFTER you have the brute-force mechanisms working, or it will be murder to debug.
 
prashant rathod
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
???
can you explain it with example?
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is some heavy-duty stuff. Actual details are too complicated - and too specialized - to present in an online forum like this. Plus I charge $$$$ for that kind of work.
 
prashant rathod
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmm good... !
thnks ..!
i just solved my problem ....!
hurreeeyyyyy.....!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic