I try to build a simple form.
Calc: 开发者_Python百科 [____] 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);
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"));
精彩评论