1
votes

I try to build a simple form.

Calc: [____] bar

So the Textfield with the prefix is no problem. But the postfix "bar". Currenty I have no idea to fix this problem. Here ist the current code:

TextField<String> field = new TextField<String>();      
field.setFieldLabel("Calc");
field.setAllowBlank(false);
1

1 Answers

0
votes

The FormPanel renders all Fields in a LABEL: INPUTFIELD way. To render other widgets within a FormPanel I would use the AdpaterField that contains the real TextField and the postfix.

    HorizontalPanel container = new HorizontalPanel();
    AdapterField field = new AdapterField(container);
    field.setFieldLabel("Calc");
    TextField<String> inputField = new TextField<String>();
    inputField.setAllowBlank(false);
    container.add(inputField);
    container.add(new Html("bar"));