0

I have a table that contains input cells for quantities. I cannot change the default size of TextInputCellCustom even if I already set the column width.

Is there a way to resize the TextInputCellCustom? Maybe through css but I can't figure out how.

my code is something like this:

private Column<PpmpItem, String> getQ1QuantityColumn() {
   if (q1QuantityColumn == null) {
      final TextInputCellCustom inputCell = new TextInputCellCustom();
      q1QuantityColumn = new Column<PpmpItem, String>(inputCell) {
         @Override
         public String getValue(PpmpItem object) {
            return Integer.toString(object.getQ1Qty());
         }
      };
      FieldUpdater<PpmpItem, String> fieldUpdater = new QuantityFieldUpdater(1);
      q1QuantityColumn.setFieldUpdater(fieldUpdater);
   }
   return q1QuantityColumn;
}
Mr. Xymon
  • 1,053
  • 2
  • 11
  • 16
  • What is TextInputCellCustom? Does it render as a div/input elements in view/edit modes respectively, or it always renders as input element? – Andrei Volgin Sep 20 '12 at 18:50
  • TexInputCellCustom extends to AbstractInputCell. According to the documentation, it is used to render a text input. – Mr. Xymon Sep 22 '12 at 04:47

1 Answers1

0

Add this style to your table:

.myTable td input {
    width:  100%;
}
Andrei Volgin
  • 40,755
  • 6
  • 49
  • 58
  • Thank you Andrei, this answered the question but I don't know yet how to assign myTable as a class name for my table so that it would only affect the desired table. I'm using CellTable. – Mr. Xymon Sep 25 '12 at 12:52
  • 1
    myCellTable.addStyleName("myTable"); – Andrei Volgin Sep 25 '12 at 13:13