18 November 2010

Access the current row of my master VO from the RowImpl

Make soure that you enable the Source Accessor


code
public class EmployeesViewRowImpl extends ViewRowImpl {
....
    /**
    public void setFirstName(String value) {
        DepartmentsViewRowImpl masterRow = (DepartmentsViewRowImpl)this.getDepartmentsView1();
        System.out.println("Setting name for Department: " + masterRow.getDepartmentName());

        setAttributeInternal(FIRSTNAME, value);
    }

...
}


Alternatively (but not recommended):
    public void setLastName(String value) {
        DepartmentsViewRowImpl masterRow = 
            (DepartmentsViewRowImpl)((AppModuleImpl)this.getApplicationModule())
                  .getDepartmentsView1().getCurrentRow();
        System.out.println("Setting name for Department: " + masterRow.getDepartmentName());

        setAttributeInternal(LASTNAME, value);
    }


No comments:

Post a Comment

You might also like:

Related Posts Plugin for WordPress, Blogger...