[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Grid selection problems  XML
Forum Index -> Development
Author Message
fhinz

Active

Joined: 02/03/2011 15:48:46
Messages: 24
Offline

Hello,

I try to automatically select some other grid lines automatically, depending on where the user has clicked in the table. There are some problems:

There are some functions I try to execute after doubleclicking a cell:

First I want to get the Column number of the clicked cell (or the cell itself, there is no way?), but

<FIXGRIDTreeItem>.getHighlightedCells(); does not give me any cells back? It's empty. Shouldn't it be filled at least with one item, if I click on a row?

Then I want to make the program select another row, which works, (additionally I want to select the right cell, which I don't have) but nevertheless there is another problem:

m_grid.selectAndFocusItem(<Row>); selects the correct row and goes into the first column. But: Pressing <Tabulator> bring me to the next row instead of the next column!

The last question: I didnt make it happen to bring a textfield in a cell into edit mode by automatically selecting the cell, is that possible? Do I have to get the "Real" item (textfield) out of the cell to bring it in edit mode? I don't have an idea ...

Perhaps someone has a clue? Thank you!

Regards,
Florian
CaptainCasa

Power User
[Avatar]

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

Hi,

Selection: in order to get the column number: see Demo Workplace > Grid > Selection Issues > Info about selected columns
(getHighlightedCells has to do with Cell Selection, this is something different...)


Focus: If there are no other focusable cells "on the right" then the next focuasable cell is in the next row - consequently the next row is selected. In case you "only" have labels on the right, set them to focusable=true.

Field: you need to set the "enabled" of the FIELD depending on selection - did you try this? Somethin like

Code:
 public class GridItem....
 {
   public boolean getFieldEnabled()
   {
     if (m_grid.getSelectedItems().contains(this))
       return true;
     else
       return false;
   }
 }
 

Then you have to bind the FIELD-ENABLED to ".{fieldEnabled}".

Regards, Björn

Björn Müller, CaptainCasa GmbH
fhinz

Active

Joined: 02/03/2011 15:48:46
Messages: 24
Offline

CaptainCasa wrote:
Selection: in order to get the column number: see Demo Workplace - Grid - Selection Issues - Info about selected columns
(getHighlightedCells has to do with Cell Selection, this is something different...)  


Right, I found it, but this uses only the methods of a FIXGRIDITEM, but I have to use a FIXGRITREEITEM. By the Way: The "Cell Selection"-Demo dousn't work for me. nothing happens on "next" and "scroll down" with any selected cell.

Also "m_grid.getColumnIndexOfLastSelection()" gets me the right column, but how do I select a specific cell in a treetable?

CaptainCasa wrote:
Focus: If there are no other focusable cells "on the right" then the next focuasable cell is in the next row - consequently the next row is selected. In case you "only" have labels on the right, set them to focusable=true. 


There are fucusable cells are on the right side, but not at the very next column. This seems to be a problem.
vadingding

Power User
[Avatar]

Joined: 14/07/2017 13:26:37
Messages: 145
Offline

Hi Captain,

The getColumnIndexOfLastSelection() only returns the index of column that is selected via mouse click.

But when selecting columns via tab key, the return value is still the index of the column that was selected via mouse click.

This is a problem if the user does not select columns using mouse, what if the use tab key for column selection???

CaptainCasa

Power User
[Avatar]

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

Hi,

we now make sure that the column selection index is correctly for selections triggered by the grid also if the keyboard is used.

Please pay attention: the selection via keyboard is "only" triggered if the user really selects a row. It is not triggered if the user navigated with tab-key within one row! (Otherwise there would be quite a lot of roundtrips...).

We make sure in addition that the index is correctly set if the user "executes" the row - i.e. either double-clicks the row, or presses the return-key within the row.

Changes are part of the update of this week which will be published somehwhere this evening/night...

Regards, Björn

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