XPages 动态视图面板 - 将列显示为链接

XPages Dynamic View Panel - show columns as links

我正在使用动态视图面板和定制器 bean(如 Paul Calhoun 在第 79 集中在 NotesIn9 上演示的那样 https://www.youtube.com/watch?v=AQOGgVZpAcw)。

定制器 bean 目前非常简单,只是为了确保文档以读取模式打开:-

    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);
    }

动态视图面板当前将第一个未分类的列显示为 link 以打开文档。我可以添加进一步的自定义以将其他列显示为 links,而不是第一列或与第一列一样吗?

是的 - 您应该可以通过多种方式完成此操作。我之前在我的定制器 bean 中完成的方法是在前面获取列信息时处理它,因为 the bean 的目标是尽可能匹配视图的设计。

不过,在您的代码中,您还可以根据需要调用 dynamicColumn.setDisplayAs("link")dynamicColumn.setDisplayAs("text") 来打开或关闭 link 显示。