0
votes

I am using a dynamic view panel along with a customizer bean (as demonstrated by Paul Calhoun on NotesIn9 back in episode 79 https://www.youtube.com/watch?v=AQOGgVZpAcw).

The customizer bean is currently very simple, just to ensure the documents are opened in read mode :-

    public void afterCreateColumn(FacesContext context, int index,
        ColumnDef colDef, IControl column) {

        //Get a map of the session variables to read the view session scope variable
        Map svals = context.getExternalContext().getSessionMap();

        //Create a variable for the current component
        UIComponent columnComponent = column.getComponent();

        //Create a reference to the column and set the links to open in read mode
        DynamicColumn dynamicColumn = (DynamicColumn) columnComponent;

        //To have every view open the selected documents in read mode add the following
        dynamicColumn.setOpenDocAsReadonly(true);

        super.afterCreateColumn(context, index, colDef, column);
    }

The dynamic view panel currently shows the first non-categorised column as a link to open the document. Can I add further customisation to show other columns as links, either instead of or as well as the first column?

1

1 Answers

3
votes

Yes - you should be able to do this in a couple ways. The way I've done it in my customizer bean before is to handle it when fetching the column information at the front, since the goal of the bean is to match the view's design as closely as possible.

In your code there, though, you could also call dynamicColumn.setDisplayAs("link") or dynamicColumn.setDisplayAs("text") as appropriate to turn on or off link display.