简体   繁体   中英

How do I use an editable NumberCell in GWT Celltable?

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.

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