Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to reset scrollbar position on jsff refresh?

Rajesh Gudiputi-OracleSep 24 2013 — edited Sep 27 2013

Hi,

I have a panelGridLayout which shows horizontal scrollbar when the content does not fit the available horizontal space.

Within the panelGridLayout I have elements which I can drag and drop and after the drop I refresh the grid to show the new data.

Sometimes to view the last element I have to scroll using the horizontal scrollbar. Now when I drag and drop the last element when the grid refreshes it resets the scrollbar to the starting position and it is very annoying for the user.

How can I reset the scrollbar position after the page reload.

Here are the things I tried:

1. For the pageDef of the jsff file added a new custom Controller class. Inside the refreshRegion method of the controller class added java code to execute a javascript method which will set the 'scrollLeft' position of the div container of the panelGridLayout. The javascript method is getting called(since I put a alert statement in it for testing) but the scrollbar position is not getting set. If I execute the same javascript code from a button then it is working fine(so no issues in the javascript method).

2. Created an outputText component and set visible=false and clientComponent=true and set the value property to a bean method like this #(pageFlowScope.ratingBean.getscrollBarTextValue). Inside the getter method again calling the same javascript method but no help.

3. Tried to refresh only the gridCell inside the panelGridLayout but since the gridCell is created by a af:iterator component only one grid cell is getting refreshed. I need all the grid cells to be refreshed.

This is a very annoying issue for our users and is looked at by our mgmt. Any help is highly appreciated.

Thanks,

Rajesh.

This post has been answered by Rajesh Gudiputi-Oracle on Sep 27 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2013
Added on Sep 24 2013
1 comment
645 views