#IsExpandable for Xpages - xpages

I have a requirement to hide column headers on a categorized view if all of the categories are collapsed. I've seen many posts on how to expand or collapse all but not how to tell if even a single one is expanded. Any ideas?

Related

Xpages Repeat Controls Tabular display

I have a situation wherein I need to display all documents in view. Issue is I need to display multivalued fields (can be achieved by modifying view column to display new line). Now issue comes when a column value is also multivalued. E.g. first column is created by looping through 50 fields (single value) and second column is created by looping through corresponding 50 fields but these fields are multivalued.
I am looking for ideas about how to nest repeats in this case. Issue is in first repeat I get the handle of documents but in nested one i am not able to get this handle to be able to loop through fields. And it is not simply one column or value I want to display, there are 4-5 such columns.
Any ideas are welcome.
Thanks in advance.
You want to start looking at a repeat control, not a view control. Have the outermost control loop through the entries in the view and populate the data source of a containing panel with a Notes document. Then inside the panel you only refer to the inner document data source.

XPages newbie - view columns in discussion database

I'm a traditional domino developer just beginning XPages. I'm working on modifying the standard 8.5.3 Domino discussion database. I've added some fields on the Main Topic and response forms, one called category. I've added a categorised column in the ($xpAllDocuments) view to the left of "Topic" for the category field. This works fine in Notes as you'd expect, but when the view is rendered in the All Documents xpage, the category twiste displays without any label. I'm not sure how to modify the column data for the xpage, as it seems to use a repeat? instead of a view?
Any help greatly appreciated, and apologies for the presumably basic enquiry!
You have to add the categories column to custom control allDocumentsView which renders the view for browser.
How to find out where to set the new categorized column? A good way is to look at the "All properties" of a certain element. For that, open the Source pane of custom control allDocumentsView, position cursor on <xe:dataView and look at "All Properties". If you hover over the properties' labels you get a helper window with a short explanation.
In your case, property categoryColumn is what you are looking for. Assuming you added a categorized column Categories to view ($xpAllDocuments) then you would have to put into property categoryColumn:
With that, your source code gets expanded by
<xe:this.categoryColumn>
<xe:viewCategoryColumn
columnName="Categories"
columnTitle="Categories">
</xe:viewCategoryColumn>
</xe:this.categoryColumn>
and you will see the added categorized column in your rendered XPage.
I don't know the discussion template in detail, but when the All Documents Xpage is using a repeat control, then you cannot expect an automatic category expand/collapse feature as in a Notes view.
If you want that, you need a View control on the Xpage.

Collapsing remaining categorised columns in a filtered view

I have a view with 4 categorised columns and the first category is the person's name.
I have created a viewPanel and I would like to filter the view so that it only shows the current user's records. The category filter works as expected but all the categorised columns display as expanded. So I added expandLevel="1" and all the documents disappear.
Is there a way to collapse all categorised columns in a filtered view?
I have since tried setting expandLevel to "1", "2", "3" and "4". The documents disappear until it is set to "4" and the it just displays the 3 categorised columns in expanded mode anyway.
Firstly, with a typical scenario this should work! Category filtering and the property 'expandLevel' set to 1 should work for you. You should see all the categorized columns collapsed for that categoryFilter and the parent documents associated with that last subcategory.
If your data contains response documents, these will not display. Though setting 'indentResponses=true' on the column in the viewPanel will get them to display for you.
This is a bug in the viewpanel. You can :
Create your own viewpanel using repeat controls
Use a grid container like this one or this one

How to prevent a viewPanel with category filter showing empty rows if filter is not set

I'm having this categorized view displayed in a view panel where the category column itself is not shown. Instead I'm displaying a combobox above the viewPanel where users can select from all the categories available (see screenshot below). The combo is bound to a scopeVariable and is refreshing the viewPanel onChange. The viewPanel has a computed categoryFilter reading from the same scopeVar. That all works nicely.
Now I also have implemented an additional wildcard (*) value in the selection list which (if selected) programmatically sets the cat filter to NULL. This way I'm forcing the viewPanel to show all entries. Again, this works fine, but with the drawback that now the view is showing empty rows where the category entries would be shown normally (in the screenshot you see empty rows above each entry, with 2 entries for the category "edcom GmbH" obviously belonging to the same category; those aren't separated by an empty row):
One way to at least hide those empty rows would be through means of css coding. But I would prefer those rows not being rendered at all.
Can this be done at all using a viewPanel, and how? Or do I have to use other controls like a repeat or a dataTable maybe?
Thanks in advance,
Lothar
One "hack" (an ugly one I admit) would be to change your categorization column from Firma to Firma:"--All--" or Firma:"*" and then instead of setting the category filter to NULL you set it to "--All--" (or "*").
The double category hits the indexer, but should do what you need.
Obviously there's no easy way. So meanwhile I'll stick to this css-style solution:
In the view panel und All Properties - data I set var = "entry". Then, under All Properties - styling I set a programatic value for the rowClasses property:
if(entry.isCategory()){
return "rowStyleHidden";
}
return "";
The style class "rowStyleHidden" hides those rows using
display: none;
Don't know yet how this turns out performance-wise, I'll have to observe this once I implement it in a copy of the real database.
You can also switch to a none categorized view, by having the viewname calculated based on the value in combobox.

Have text in row overflow into right column

I have a view with multiple columns that's showing documents with response documents underneath.
I have a field on the parent document that is long that i'm putting in the first column.
I've got another column that has a field specific to my response document.
I want to have the first column be very small (width), so the responses aren't indented by much.
The problem is that the parent document's field gets cut off.
How can i allow the parent property column to overrun into the child property column?
This would be similar to a categorised view, except that the 'category' is a parent document.
I'd like a solution where i can get a child's property to overrun into a sub-child's property too, i.e. Document->Response->Response of response
There are two ways to set up a parent/child relationship between the rows in a NotesView. First works with one or more types of documents where you take a flat view of documents, pick a column to group by, and set its type to Categorized. The Category row then shows up above the entries that have their field set to the category value.
The second way is to have two types of documents using the built in document / response (and optionally response to response) relationship. In your form selection criteria, you make sure you select all the documents you want, and then tack on the descendants. In the view settings you need to select "Show response documents in a hierarchy". Then the parent documents will show above all their child documents.
I think you're trying to use the second method, but it seems like something is missing. When it is set up, the parent row can show any number of columns, and usually the child row shows only one (see the design of the built-in discussion databases). To designate a column to be for responses, select the Show Responses Only option in the column properties. Otherwise the column will appear for just the parent document.
To get what you want to do you should just need a couple of columns. The first one would be for the response documents and can be very narrow, but will automatically stretch across the whole window. The second would be for the parent document. Lastly you can select the "Extend last column to window width" option so the parent column fills the screen, or just stretch the parent's column wide enough to fit everything. You can even set the view properties to allow that column to show on multiple lines (up to 9) if it doesn't fit on one.
Hopefully this fills in any gaps. If I missed something please let me know in the comments.

Resources