[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Initial sorting of grid - selection of first item  XML
Forum Index -> Development
Author Message
CaptainCasa

Power User
[Avatar]

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

(from mail conversation)

Use case is: a FIXGRID has a PERSISTID - this means: its sort status (and columns sequence and column widths) will be saved per user.

When you load the grid with data at point of time the grid is built up and them select the first item...:


Code:
 FIXGRIDListBinding<...> m_grid = new FIXGRIDListBinding();
 ...
 ...
 m_gird.getItems().add(...);
 m_gird.getItems().add(...);
 m_gird.getItems().add(...);
 m_gird.getItems().add(...);
 ...
 m_grid.selectItem(0);
 


...then the grid will not show the first item - because the sorting is applied during the build up.

You need to be part of the build-up processing. There are two way:

Code:
     FIXGRIDListBinding<GridItem> m_grid = new FIXGRIDListBinding<GridItem>()
     {
         @Override
         public void initialize()
         {
             super.initialize();
             selectItem(0);
         }
     };
 


or (since 20220110):

Code:
         m_grid.addConfiguredByLayoutListener(new IConfiguredByLayoutListener()
         {
             @Override
             public void onInitializationByLayoutFinished()
             {
                 m_grid.selectItem(0);
             }
         });
 


Kind regards! Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team