11-05-2012 02:37 AM
Hi ankit
My whole screen are not scrolling. and i all ready did what you hve told now.
My problem is that
While scrolling of first VFM ends the element automatically it goes on first element on second VFM and second VFM starts scrolling autometically which i dont want.
I want it to scroll while i navigate through pointer laft and right on each VFM.
Which is working with GrideFieldManager.
Thanks.
11-05-2012 03:16 AM
Add first vertical field manager to another VFM(NO_VERTICAL_SCROLL), add second VFM to another VFM(NO_VERTICAL_SCROLL). Add these third and fourth VFM to HFM.
11-05-2012 03:59 AM
Hi ankit
Even it is not working means while the second VFM finishing scrolling the first VFM starting to scroll automatically
But I need to scroll it while I navigate the pointer left and right on choice.
Did you tested it or just gave me idea, if you have tested it can you give me some code sample?
Thanks.
11-05-2012 04:38 AM
OK, I understand your requirement.
In the initial explanation the problem you were having was that both VFMs were scrolling together. So you scrolled down one and the other scrolled to keep at the same 'level'. The solution I suggested should have resolved that issue and perhaps it has since you no longer say it is a problem. It would be nice if you could confirm that,
Now you have a different problem, in that when focus moves from one VFM to another, the focus action taken is not what you want. This is a fairly common problem, typically though people see it with HFMs. With VFMs and HFMs, when focus moves into the Manager, they will set the focus to the first or last Field in the Manager depending on direction of the movement. A lot of people what the focus to return to the last selected item.
So you need to suppress this behavior in some way. One option is to override the various focus methods in a manager and retain the 'selected' Field which focus moves back to.
But in your case, probably the easiest way is to make sure that both VFMs do not loose focus on a vertical scroll. Below is some code that should do that assuming the 'scrolling' you are talking about is being achieved using the track pad. You should add this to both VFMs to override their standard method.
Note that this code makes the assumption that the first and last Fields in the manager are focusable.
Hope this helps:
/**
* Navigation movement so that we stop at the end when scrolling up and down
*/
protected boolean navigationMovement(int dx, int dy, int status, int time) {
int focusIndex = getFieldWithFocusIndex();
if ( focusIndex == 0 && dy < 0 ) {
// scrolling up but at beginning
return true;
}
if ( focusIndex == this.getFieldCount() - 1 && dy > 0 ) {
// scrolling down but at end
return true;
}
return super.navigationMovement(dx, dy, status, time);
}
11-05-2012 10:26 AM
Hi peter
many many thanks
I got solved my problem.