-
Aug 26th, 2006, 06:48 PM
#1
problem with array-binding
Hi all,
I have a problem to add some values of an array to TableFormBuilder. The error is: "Invalid property 'parameter[0]' of bean class [businessobjects.Report]: No property 'parameter[0]' found"
// The parameter-array in the pojo
private Object[] parameter=null;
public Object[] getParameter() {return parameter;}
public void setParameter(Object[] para) {this.parameter = para;}
// The form
protected JComponent createFormControl() {
TableFormBuilder formBuilder = new TableFormBuilder(getBindingFactory());
SwingBindingFactory sbf=(SwingBindingFactory) getBindingFactory();
formBuilder.add(sbf.createBoundComboBox("name", report.getNames()));
formBuilder.row();
int paralen = report.getJrparameter().length;
String type = "";
String para = "";
for (int i=0; i<paralen; i++) {
type = report.getJrparameter(i).getValueClassName();
para = "parameter[" + i + "]";
if (type==report.Date_type) {
formBuilder.add(new JCalendarBinding(getFormModel(), para, "dd.MM.yyyy"));
} else {
formBuilder.add(para);
}
formBuilder.row();
}
I need an array of objects to hold reportparameters. And I want to collect each parameter in a separate line on the form to edit it. How can I do this by using binding? I have experimented now some hours with different getters/setterts with index and so on, but nothing helps. Where is my mistake? Or is it impossible to bind an array on a form?
All Help is highly welcome.
regards
divo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules