[Logo] OLD FORUM - Use new one: https://www.CaptainCasa.online/forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
FIXGRIDListBinding#resort() Selection and Focus issue  XML
Forum Index -> Development
Author Message
bthalheim

Power User

Joined: 05/04/2012 11:45:24
Messages: 72
Offline

Hi,

I am using longpolling to Push updated data into a fixgrid in my frontend.
When updating Data in the fixgrid (either changing elements or adding/deleting some), I make sure that the item is sorted into the grid by simply calling
Code:
fixgridListBinding.resort()


Unfortunately, this causes two problems:
  • Focus is lost.
  • Selection is lost.

    The loss of the selection is no problem, I just need to grab the selectedItems before the resort and then reselect these items.

    More interesting is the loss of the Focus. I have meanwhile tried ensureItemToBeDisplayed, but that results on the item being always focussed as the top row of the displayed rows (so if I select a line in the middle then the item and the focus "jumps up").

    Does there exist any way to preserve and restore the vertical scroll position of a fixgrid?

    Cheers,

    Björn
  • Admin

    Power User

    Joined: 21/11/2007 11:36:10
    Messages: 38
    Offline

    Hi,

    yes there is a way:

    You receive the current horizontal scroll position by

    FIXGRIDBinding.getCurrentHorizontalScrollPosition()

    any you can set by

    FIXGRIDBinding.scrollHorizontallyToPosition(int value)

    Regards, Björn
    bthalheim

    Power User

    Joined: 05/04/2012 11:45:24
    Messages: 72
    Offline

    Hi,

    unfortunately, this is the horizontal scroll position.
    I need the vertical scroll position.
    But yes, if there were something like get/setVerticalScrollPosition, that wourd be exactly what I need.

    Cheers,

    Björn
    CaptainCasa

    Power User
    [Avatar]

    Joined: 21/11/2007 12:23:06
    Messages: 5555
    Offline

    ...the vertical scroll position is set by setting setSbvalue(...) - the index of the current top-line of the grid.

    Please also check method ensureToBeDisplayed(...) with FIXGRIDBinding.

    Regards, Björn

    Björn Müller, CaptainCasa GmbH
    bthalheim

    Power User

    Joined: 05/04/2012 11:45:24
    Messages: 72
    Offline

    Thanks. This does exactly what I want.
    I should have known this ...

    Björn
     
    Forum Index -> Development
    Go to:   
    Powered by JForum 2.1.6 © JForum Team