Announcement Announcement Module
Collapse
No announcement yet.
2 formModels on a page Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 2 formModels on a page

    I am using form's Dirty flag to set dirty flag on the domain bean, domain bean relates to a record in the database. In my situation I have 2 beans on a page, these beans relate to different tables, I need to set dirty flags on these beans, but if I have one form model I have not way to separate "dirtiness" of domain beans.

    I was trying to pass Nested form model to a form derived from AbstractForm and add child, but I cannot do this, getFormModel returns Validating form model.

    What shold I do? Thanks.

  • #2
    I found better way, change in BeanPropertyAccessStrategy.java


    public void setValue(Object value) {
    // TODO: make this thread safe
    try {
    settingBeanProperty = true;
    beanWrapper.setPropertyValue(propertyPath, value);

    //BEGIN CHANGE
    String flagPath = "updated";
    if ( propertyPath.lastIndexOf(".") > 0 ) {
    flagPath = propertyPath.substring(0, propertyPath.lastIndexOf(".") + 1) + flagPath;
    }
    try {
    beanWrapper.setPropertyValue(flagPath, new Boolean(true));
    } catch (FatalBeanException e) {
    }
    //END CHANGE
    }
    finally {
    settingBeanProperty = false;
    }
    fireValueChange(savedPropertyValue, getValue());
    }

    The framework is great!

    Comment


    • #3
      what's your mean?

      I can't catch

      Comment

      Working...
      X