简体   繁体   中英

GWT CellTable CheckboxCell Not working in IE8

I am having a CellTable with CheckboxCell in it.

I have added the following handler to it:

private static Column<AIDataRecord, Boolean> m_checkColumn = 
    new Column<AIDataRecord, Boolean>(new CheckboxCell(true, false)) 
    {
        @Override
        public Boolean getValue(AIDataRecord object) 
        {
            // Get the value from the selection model.
            return object.isSelected();
        }   
        @Override
        public void onBrowserEvent(Context context, Element elem, AIDataRecord object, NativeEvent event) 
        {
            System.out.println("Browser Event Called");
            super.onBrowserEvent(context, elem, object, event); 
            String eventType = event.getType();
            if ("change".equals(eventType)) 
            {
                System.out.println("Value changed");
                object.toggleSelection();
                System.out.println("Nw : "+object.isSelected());
            }
        }
    };

where object.toggleSelection() is a method which reverses a boolean field ie true to false and false to true.

I am using this code find if any check box is selected or not to identify any row.

This thing is working perfectly fine in All major browsers Except IE 8.

In IE 8 I get the object.isSelected() true but still when I click on button on that panel to delete row, it shows isSelected() false for the same row.

Can any body please help me with where should I try to find the problem ? Why IE is behaving differently??

Can any Java/GWT expert please help me out...

Thanks.

Why don't you assign a FieldUpdater to your your column? It is much simpler. For example:

m_checkColumn.setFieldUpdater(

    new FieldUpdater<AIDataRecord, Boolean>() {
         @Override
         public void update(int index, AIDataRecord object, Boolean value) {
            object.toggleSelection();
            Window.alert("Nw : " + object.isSelected());
         }
    }

);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM