Announcement Announcement Module
Collapse
No announcement yet.
IllegalArgumentException on null properties Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • IllegalArgumentException on null properties

    Hi all,

    When using a parent-child form-model configuration if the child property on top of which the child form model is set is null, there is a IllegalArgumentException thrown .
    On my use case there are several forms that are generic CRUD forms and should be disabled if "their" bean property is null.

    PS: I cannot set a new bean instance on the null property because the parent bean will be sent to a hibernate based service and there should not be any unnecessary bean creation.

    Is there any way to configure this behavior?

    Bellow is the test case:
    Code:
    TestBean parentBean1 = new TestBean();
    TestBean childBean1 = new TestBean();
    
    parentBean1.setNestedProperty(childBean1);
            
    TestBean parentBean2 = new TestBean();
            
    AbstractFormModel pfm = new TestAbstractFormModel(parentBean1);
            
    AbstractFormModel fm = new TestAbstractFormModel(pfm.getValueModel("nestedProperty"),true);
    pfm.addChild(fm);
            
    pfm.setFormObject(parentBean2); //<-- IllegalArgumentException :(
    THA
Working...
X