PDA

View Full Version : [CLOSED] [1.2.3] Possible Bug with EditorGrid + SelectionChangedListener



micgala
24 Mar 2009, 5:44 AM
Hi.

I am using GXT 1.2.3 + Safari browser (Mac).

Well, The SelectionChangedListener is not being called when I select an entry in the grid.

For testing it, just change the EditorGrid example a little bit, this lines are enough:


grid.setClicksToEdit(ClicksToEdit.TWO);
grid.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<Plant>() {
@Override
public void selectionChanged(SelectionChangedEvent<Plant> se) {
MessageBox.alert("", "I was called", null);
}
});

I guess this is a bug... the MessgeBox should be displayed when I select an entry in the grid (when I click over a cell).

Thanks for checking,
Michel.

micgala
30 Mar 2009, 3:33 AM
Hi.

Were everyone able to recreate this? Or is there something I am forgetting to do?

micgala
2 Apr 2009, 8:40 AM
Hi.

Just to add new information....
I was able to recreate this problem in FF3, IE6 and IE7 as well...
It seems that the combination EditorGrid + SelectionChangedListener is somehow broken...

I wonder if nobody else is using this combination...

sven
2 Apr 2009, 9:01 AM
Please read the bugforum guidelines. You need to provide a fully working testcase and not only a codesnippet.

sven
2 Apr 2009, 10:29 AM
Understood now what you mean. CellSelectionModel is working differently here as you dont select a complete ModelData.

There are no events fired.

micgala
2 Apr 2009, 11:56 PM
Interesting.... and this is the desired behavior?
I mean, I would guess the event still should be fired... since we selecting an entry in the grid...

Imagine that I have one button that deselect a previously selected cell in the grid...
And I want to listen to this... I don't think there is no other way of listening to this except for this event that is not being fired...

Do you have plans on changing this?
If not, do you have a workaround?

Tks,
Michel.

sven
3 Apr 2009, 1:44 AM
CellSelectionModel is quite basic. You can switch die RowSelectionModel and the events will fire.

micgala
3 Apr 2009, 2:13 AM
allright, tks I will try that...

Can you tell me how to change the EditorGrid selection mode to Row?

I tried to perform this, but it was still selecting one cell:

editorGrid.setSelectionModel(new GridSelectionModel<BaseModel>());

Am I missing something?

Vielen Dank.

micgala
9 Apr 2009, 12:52 AM
alright.

really funny behavior:

If you have clicks to edit = 2 in the GridEditor.
And you set the selectionModel to

GridSelectionModel<BaseModel> rowSelectionModel = new GridSelectionModel<BaseModel>();
editorGrid.setSelectionModel(rowSelectionModel);

Then nothing happens when you click! The row does NOT gets selected.
You need to do a 2 click so then the row gets selected....

Please check this!

For a source code for testing:
You have the editorgrid example code, right?
Simply change its selectionModel and set click to edit to 2... and that is it... you have then an example to test in your hands.

sven
9 Apr 2009, 3:14 AM
Fixed in SVN.

micgala
9 Apr 2009, 3:32 AM
Hi Sven.

Tks a lot for verifying this!

Mit freundlichen Grüßen/Best regards
Michel.