Issue 166: Unable to check if the view has been initialized in subclasses TableFacadeImpl
Status:  Fixed
Owner: ----
Closed:  Dec 2008
Reported by bgo...@e1b.org, Dec 3, 2008
If I'm trying to do something like this:

    public View getView() {
        if (view != null) {
            return view;
        }

        if (getLimit().isExported() &&
getLimit().getExportType().equals(ExportType.PDF)) {
            return new MyPdfView((HtmlTable) getTable(), getToolbar(),
getWebContext(), getCoreContext());
        } else {
            return super.getView();
        }
    }

in a subclass of TableFacadeImpl, the 'view' instance variable is not
visible.  private is probably the appropriate modifier for the variable,
but perhaps protected methods named view(), table(), toolbar(), etc. could
be added to allow subclasses to read the value of the variable without
initializing it.  I can create a patch if you think that is alright.
Dec 3, 2008
Project Member #1 jeff.johnston.mn@gmail.com
This has been something I have been wanting to take care of for some time now. After
thinking about it for awhile I think the simplest approach would be to have protected
methods for the exports. There are now a few new protected methods in the
TableFacadeImpl...

protected Table getExportTable(ExportType exportType);
protected View getExportView(ExportType exportType);
protected void renderExport(ExportType exportType, View view)

These are checked in on the trunk...let me know if this works for you!


Labels: -Type-Defect Type-Enhancement
Dec 6, 2008
Project Member #2 jeff.johnston.mn@gmail.com
(No comment was entered for this change.)
Status: Fixed