GWT CellTable CheckboxCell不能在IE8中工作 [英] GWT CellTable CheckboxCell Not working in IE8

查看:94
本文介绍了GWT CellTable CheckboxCell不能在IE8中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经将以下处理程序添加到它:

  private static Column< AIDataRecord,Boolean>新的CheckboxCell(true,false))
{
@Override
public Boolean getValue(AIDataRecord object)
{
//从选择模型中获取值。
返回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());
}
}
};

其中 object.toggleSelection()是一个方法,它颠倒一个布尔型字段,即真正的假和假真。



我使用此代码查找是否选中任何复选框或不识别任何行。 / b>

这个东西在所有主流浏览器中都可以正常工作除了IE 8以外。

在IE 8中, .isSelected()true,但仍然当我点击该面板上的按钮来删除行时,它显示同一行的isSelected()为false。



任何人都可以帮忙我应该在哪里找到问题?为什么IE的行为不同?



任何Java / GWT专家都可以帮我解决问题...



感谢。

为什么不将FieldUpdater分配给你的列?它更简单。例如:

  m_checkColumn.setFieldUpdater(

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

);


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 i.e. 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());
         }
    }

);

这篇关于GWT CellTable CheckboxCell不能在IE8中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆