开发者

How do I use an editable NumberCell in GWT Celltable?

开发者 https://www.devze.com 2023-03-12 01:31 出处:网络
Does anybody know how to achieve this? I want to add a NumberCell to a GWT CellTable and want to use inline editing as with EditTextCell.

Does anybody know how to achieve this?

I want to add a NumberCell to a GWT CellTable and want to use inline editing as with EditTextCell.

For a EditTextCell I use:

    Column<Parameter, String> editableColumn = new Column<Parameter, String>(
            new EditTextCell()) {
        @Override
        public String getValue(Parameter parameter) {
            return parameter.getString();
        }
    };

I want to use an "editable NumberCell", but don't have a clue how to do this.

开发者_开发知识库HELP me please! :)

For a NumberCell:

    Column<Parameter, Number> column = new Column<Parameter, Number>(
            new NumberCell()) {
        @Override
        public Number getValue(Parameter parameter) {
            return (Number) parameter.getNumberValue();
        }
    };


There isn't a editable cell for numbers in GWT. You could copy paste the EditTextCell and change it to use numbers instead of Strings. Plus you have to check on every keydown if the pressed key was a number key.

0

精彩评论

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