Results 1 to 3 of 3

Thread: 2 formModels on a page

  1. #1
    Join Date
    Jun 2005
    Location
    IL USA
    Posts
    11

    Default 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. #2
    Join Date
    Jun 2005
    Location
    IL USA
    Posts
    11

    Default

    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!

  3. #3

    Default what's your mean?

    I can't catch

Similar Threads

  1. Servlet writing byte[] image in jsp page
    By xmartinx in forum Web
    Replies: 2
    Last Post: Apr 26th, 2012, 04:50 AM
  2. Replies: 0
    Last Post: Jun 10th, 2005, 08:22 AM
  3. Replies: 0
    Last Post: May 24th, 2005, 01:44 AM
  4. Replies: 2
    Last Post: May 13th, 2005, 05:42 AM
  5. Replies: 1
    Last Post: Jan 24th, 2005, 04:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •