Announcement Announcement Module
Collapse
No announcement yet.
problem with array-binding Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
Working...
X