setting combobox width dynamicall

Hi Team,

i have one vaadin table in that i have only one row

(please find the screen shot for better view)

, in that i have few comboboxes defined.

bases on first combob box value i am getting the values for second combo box, but i have width issue .

i resolved this by adding empty space in my table header (container property), i know this is ugly solutino, can anybody suggest me ?

private IndexedContainer buildContainer(UnbalanceErrorType newUnbalanceErrorType) {
container.addContainerProperty(ErrorManagementEnum.SALES_MARKET.getText(), String.class, null);
container.addContainerProperty(ErrorManagementEnum.TRANSACTON_DATE.getText(), Date.class, null);
container.addContainerProperty(ErrorManagementEnum.CATEGORY_DESCRIPTION, ComboBox.class, null);

container.addContainerProperty("Type ", ComboBox.class, null);

container.addContainerProperty(ErrorManagementEnum.TAX.getText(), ComboBox.class, null);
container.addContainerProperty(ErrorManagementEnum.REGION.getText(), String.class, null);
container.addContainerProperty(ErrorManagementEnum.DEBITCREDIT.getText(), TextField.class, null);
container.addContainerProperty(ErrorManagementEnum.ACCOUNT_ID.getText(), ComboBox.class, null);
container.addContainerProperty(ErrorManagementEnum.COSTCENTER.getText(), ComboBox.class, null);
container.addContainerProperty(ErrorManagementEnum.AMOUNT.getText(), TextField.class, null);
container.addContainerProperty(ErrorManagementEnum.CURRENCY.getText(), ComboBox.class, null);
container.addContainerProperty(ErrorManagementEnum.CUSTOMER_ID.getText(), Long.class, null);
container.addContainerProperty(ErrorManagementEnum.ORDER_DATE.getText(), Date.class, null);
container.addContainerProperty(ErrorManagementEnum.ORDER_ID.getText(), String.class, null);
container.addContainerProperty(ErrorManagementEnum.SPEC_NO.getText(), DateField.class, null);
container.addContainerProperty(ErrorManagementEnum.USER_ID.getText(), String.class, null);
container.addContainerProperty(ErrorManagementEnum.VER_NO_SERIES.getText(), TextField.class, null);
addItem(container, newUnbalanceErrorType);
return container;
}

13546.png

anybody suggest me ???

Set the width of the combobox to 100% and then set an explicit width for the table column using Table.setColumnWidth method.

thanks for the reply…

its not resolving my issue.

please find my class (its bit big but , you can see addNewRow logic)
13547.java (23.2 KB)

Hi,

I glanced at your code, and tried searching for ‘setColumnWidth’ or ‘setColumnExpandRatio’, but couldn’t find either. Try setting the width of the column where you have the combobox.

hi,
thanks for your help, its worked.