This custom control receives a series of parameters and will dynamically build a view on page load. This control is beneficial where you need to have display one of many views but do but want to build each one and hide them depending on the selection. This can also be useful where you want to allow non-developers or users the option to tailor a view.



You can read more about how I built the custom control here: http://www.jmackey.net/groupwareinc/johnblog/johnblog.nsf/d6plinks/XPages_Dynamic_View_OpenNTF



The custom control name is ccDynamicView. It requires one style sheet to format the row colors for alternating colors: ccDynamicViewStyle.css. It takes the following parameters:

  • viewName: The name of the Notes View
  • columns: The fields to display separated by a semi colon
  • linkColumn: What number column will be the link (1,2,3 etc)
  • xpageName: The XPage to open when the link is clicked
  • viewWidth: Width of the view
  • alternatingRowColors: true or false
  • categoryFilter: show single category value (null will display all)
  • fullTextSearch: fulltext string to search on (null will display all)
  • defaultMode: read or edit
  • viewRows: the number of rows to display



    Here's an example of setting session variables to pass as parameters:

    sessionScope.altColors="true";

    sessionScope.catFilter=null;

    sessionScope.columns="Project;ProjectID;StartDate;EndDate";

    sessionScope.defaultMode="edit";

    sessionScope.fullTextSearch=null;

    sessionScope.linkColumn="1";

    sessionScope.viewName="Projects";

    sessionScope.viewRows="20";

    sessionScope.viewWidth="500px";

    sessionScope.xpageName="Project";



    The database that contains the custom control has an example of it in use.