TableFormBuilder bind a component 2 times.
Code:
public JComponent[] addTextArea(String propertyName, String attributes) {
return addBinding(getBinding(propertyName, getTextArea(propertyName)), attributes, getLabelAttributes()
+ " valign=top");
}
in AbstractFormBuilder:
Code:
protected JComponent getTextArea(String propertyName) {
JTextArea textArea = GuiStandardUtils.createStandardTextArea(5, 40);
JComponent component = new JScrollPane(getBindingFactory().bindControl(textArea, propertyName).getControl());
return component;
}
This is the first time JTextArea is binded.
Code:
protected Binding getBinding(String propertyName, JComponent component) {
return getBindingFactory().bindControl(component, propertyName);
}
This is the second time JTextArea is binded.
And, the second binded throw a exception.
Code:
java.lang.IllegalArgumentException: Control must be an instance of JTextComponent.
at org.springframework.util.Assert.isTrue(Assert.java:64)
at org.springframework.richclient.form.binding.swing.TextComponentBinder.doBind(TextComponentBinder.java:38)
at org.springframework.richclient.form.binding.support.AbstractBinder.bind(AbstractBinder.java:86)
at org.springframework.richclient.form.binding.support.AbstractBindingFactory.bindControl(AbstractBindingFactory.java:84)
at org.springframework.richclient.form.binding.support.AbstractBindingFactory.bindControl(AbstractBindingFactory.java:62)
at org.springframework.richclient.form.builder.AbstractFormBuilder.getBinding(AbstractFormBuilder.java:77)
at org.springframework.richclient.form.builder.TableFormBuilder.addTextArea(TableFormBuilder.java:95)
at org.springframework.richclient.form.builder.TableFormBuilder.addTextArea(TableFormBuilder.java:91)