First I want to mention is that I didn’t have this problem in Vaadin 7 using the old Form. After I changed the code to work new FieldGroup it stopped working. Also, setting of ReadOnly also stopped working. I have no idea what may cause this. I’d appreciate any input.
FieldGenerator is a class has overloaded methods for certain commonly used settings for fields such as setImmediate, nullSelectionAllowed etc.
....
private final ResultTextField topASMEHeight =
new ResultTextField("Top ASME Height Test"); //Extends TextField but is set to look like ReadOnly.
....
I set up the layout and stuff. Some fields gets added and some are others are added as needed basis.
FieldGroup binder = new FieldGroup(TankData instance)
private void attachAndBindFields()
{
...
binder.bind(topASMEHeight, TankData.TOP_ASME_HEIGHT);
...
}
@Override
public void valueChange(Property.ValueChangeEvent event)
{
topDimensionLayout.removeAllComponents();
switch (index)
{
....
case 3: //ASME
topDimensionLayout.addComponent(
binder.getField(TankData.TOP_ASME_HEIGHT));
break;
....
}
markAsDirty();
}
later …
tankData.getItemProperty(TankData.TOP_ASME_HEIGHT).setValue(50)