Button as Field

I want to use a button as a field in a Form. So when the user clicks the button a popup will appear.
Button is an AbstractField. So there should be no problems.
Still, when I do that the caption is not drawn. What i do is


public class CustomForm extends Form {
	List<Object> complexPropertyIds = new ArrayList<Object>();
	@Override
	protected void attachField(Object propertyId, Field field) {
		if (complexPropertyIds.contains(propertyId)) {
			[b]
super.attachField(propertyId, new Button(propertyId.toString()));
[/b]
		} else {
			super.attachField(propertyId, field);
		}
	}

Simply using a button instead of the created field. The caption gets painted onto the button, but not in front of the field like other field captions.

[i]
Is there some way to get a caption painted like other field captions left of the button/field, and having still another “caption” drawn onto the button ???

[/i]
I get confused what on the term caption in vaadin. at least when a button is also a field.

Have a look at the CustomField add-on, it will help you get this done.

Button should not be a Field (won’t be in Vaadin 7) as it most likely won’t work as you would expect (it’s value is always false).

I took a look at the addon u mentioned. That does work. Thx for the answer. (cant wait to get my hands on Vaadin 7 -_- )