PDA

View Full Version : OnDoubleClick for ListView



johker
18 May 2009, 7:39 AM
Hi guys,

I am currently using GXT 1_2_3.

I would like to be able to handle the DoubleClck on the items of my ListView.

I could see that the seelctionModel does not manage the Event.
So, I decided to create my own Listener and add it directly to the ListView instanciated object.
Here is the code :
public class OneSample extends Dialog implements Listener<ListViewEvent> {
.....
view.addListener(Events.OnDoubleClick, this) ;

public void handleEvent(ListViewEvent ce) {

System.out.println("SaveDialogBox.ContainerEvent"+ ce.model.get("name")) ;
Info.display("ObDoubleClick","On double click handled.") ;

switch (ce.type) {
case Events.OnDoubleClick:
break;
}
}

I can handle the Event but, I can't get an item associated with the DoubleClick.

Is there somebody with experience on this ready to help?

Thanks in advance

johann

johker
18 May 2009, 9:02 AM
Guys,

I found a solution to achieve this.

I don't know if it is clever but can't find an other way.
I am picking up the selectdItem like this:
view1.getSelectionModel().getSelectedItems().get(0)

If somebody has a better, the hint is welcome.