Shashika
Shashika

Reputation: 1636

SmartGWT: Open window from selected record in Listgrid

I'm new to SmartGWT and I need to open an another window when I select a particular record in a List Grid. Previously I used the HoverCustomizer but I cannot move with that further because there are hundreds of records to show. So how can I do this task?

Upvotes: 0

Views: 140

Answers (1)

Daniel Faro
Daniel Faro

Reputation: 327

ListGrid list = new ListGrid();
//list configuration goes here
list.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event){
        //Get the clicked record
        Record row = list.getSelectedRecord();

        //Check if thats the record you want
        if(row != null && row.getAttribute("attribute").equals("thingToCheck"){            
            //Now just open the window
            Window window = new Window();
            //Configure here the window
            window.show();
        }
    }
});

Upvotes: 1

Related Questions