1
votes

System information:
  Test server:
    domino 9 on Windows 7
    extension libraries version 900v00_02.20130515-2200
  development server:
    domino 8.5.3 FP3 on windows server 2008
    extension libraries version 853.20121022-1354
  development client
    Notes 8.5.3 FP3 on windows 7
    extension libraries version 853.20121022-1354
  Browsers used
    IE8*, IE9
    Firefox
    chrome
      * = project defined browser

issue:
  A portal application was developed in order for the end users to select a desired database from a selection (from a combobox) and have that database be displayed. All databases displayed in this portal use the same design template, but are very highly configurable. In order to keep a slim design, and to prevent the need for countless hidden view panels, the extension library dynamic view panel control was used.
  Part of the problem I am currently having is that the \ character is used in either the first or second column in order to create subcategories. It is not known how many times this character is used, nor is it known how many sub categories there may be. With the normal notes client, this is not an issue as the view will always be correctly displayed. This is not so using either xe:dynamicViewPanel, or the xp:viewPanel controls. Instead of indenting the new subcategories, they are all displayed directly below one another. Closing the Main category will however close the subcategory. I have also tested to see if this is a bug that was corrected in the new notes/domino 9 environment, but lo, it is still there.

questions:
  Does anyone have any ideas as to how the problem of displaying these categories/subcategories can be fixed, or perhaps, another way of showing the information so that it looks like the background view? I'd rather stay with a dynamic view panel if I can.

thank you in advance
Greg

1
Good ol' Notes standard to use backslash in Notes categories is troublesome in new releases. For example, composite views (like in mail template) are not able to show sub categories properly, nor standard view controls in XPages. If it is acceptable by customer, I tend to replace \ with / or >. I know, it has different results, but helps to find documents quick enough.Frantisek Kossuth

1 Answers

3
votes

Categorized views are not built for the web. I would create a bean you feed with a view navigator and replace the view with a list/tree combination. There are some UI inspirations to check out. In your bean you can process the view to your liking.

Off my head (probably doesn't compile):

public class SampleClass {

private final Map<String,List<List<String>>> viewData = new HashMap<String,List<List<String>>>();

// it isn't a MANAGED bean since in the constructor
// there's a parameter - use it in a ObjectDataSource or a datacontext
public SampleClass (lotus.domino.ViewNavigator vn) {

    try {
        ViewEntry ve = vn.getFirst();
        while (ve != null) {
            ViewEntry veNext = vn.getNextSibling(ve);
            this.createCategoryAndEntries(ve);
                            ve.recycle();
            ve = veNext;
        }
    } catch (NotesException e) {
        e.PrintStacktrace();
    }
}

private void(createCategoryAndEntries(ViewEntry ve) {
   String cateogry = ve.getColumnValues()[0]; // You might need more columns
   List<List<String>> catMembers = new ArrayList<List<String>>();
   int subEntryCount = ve.getChildCount();
   // If that's bigger than 0 get the children, each makes a list entry
   // containing a list with all the column values
   this.viewData.put(category,catMembers);

}   

public Collection<String> getKeys() {
    return this.viewData.keySet();
}

public List<List<String>> getEntries(String category) {
    return this.viewData.get(category);
  } 
}

you would use the getKeys() to populate your dojo tree - you need to take care of the splitting in subcategories there yourself. The trick is to SHOW the categories in the tree as split values, but to return a single string (as it is actually stored in the document) The datatable or repeatcontrol then can be bound to getEntries(...) and the columns to the individual entries.