Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Refresh issue

 
Sithu Sarath
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi,
In my requirement, i have a datagrid which includes an icon in every row in PAGE 1. At one point the icon is purple and then after double clicking the row, it takes to a different page PAGE 2 and after saving, it comes back to PAGE 1. At that time, icon in PAGE 1 has to change to blue. But the icon remains purple in my case. When I refresh the page, the problem is rectified. As i have observed that the icon value taken is that of blue but the display is incorrect, i feel it has something to do with refreshing the page.
Please help me resolve this issue as soon as possible.

Thanks
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is the color updated ? By modifying the page's innerHTML ?

From the work flow you mentioned, it appears to me that your page is displayed based on a flag that is set by the controller. Obviously the JSP will not contain the updated flag unless it is refreshed. Two solutions you can try

1. Use AJAX to poll the status of this flag and display the result. This is inefficient and has a time delay.
2. Modify the flow so that the new page does not open in a new window, but on the same window. When you are done with your changes the page should redirect to the old page, which would result in another GET call to the controller. The JSP page will now contain updated values.

I assumed that some of the calls that you make are idempotent. If they are not you may need to use a pattern like PRG to get around problems related to usability.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic