开发者

GWT CELLTABLE How to restore old value in EditableTextCell?

开发者 https://www.devze.com 2023-03-24 13:28 出处:网络
I want to used editableNumbercell like intger,decimal etc.. But there is no such gwt widget present so I am using editable text cell and using validation for numbers when user update val开发者_如何学J

I want to used editableNumbercell like intger,decimal etc.. But there is no such gwt widget present so I am using editable text cell and using validation for numbers when user update val开发者_如何学JAVAue in cell.

How to avoid cell editing when validation fails.

if validation fail then editabletext cell value restored to old value.How to do that?

intgerColumn.setFieldUpdater(new FieldUpdater<RecordInfo, String>() {
        public void update(int index, RecordInfo object, String value) {
            // Called when the user changes the value.
            if(value.matches("(-)?(\\d){1,8}")){
                object.setColumnInRecordEdited(true);
                object.setValue(value);
                RecordData.get().refreshDisplays();
            }else{
                Window.alert("Specify valid integer value for parameter");
                // How to rest old value here? currently update value set to cell

            }

        }
    });

Any help or guidance in this matter would be appreciated.


You can do it like this:

// clear incorrect data cell.clearViewData(KEY_PROVIDER.getKey(object)); cellTable.redraw();

Where cell is the TextEditCell that you're using for that column.

It´s usefull for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消