XPages filter by column value. How to display 2 va

2019-09-05 03:01发布

The view is a list of staffs and first sorted column is 'Department'. There are 8 department: A,B,C,D,E,F,G,H. Under certain conditions, I need to display only staff from department C & G only(or maybe from 3, 4 or more department under different conditions). Something like in view selection formula(@Formula) where:

SELECT (Form="Staff") && (Department="C" || Department="G")

In the 'Filter by Category Name', I put static value:Department.

In the 'Filter by column value', I test static values: C,G and C;G. Both won't display any result. I test compute value with following code still can't:

var newArr=new Array("C");
newArr.push("G");
return newArr;

For the real view, Department column, I turn on/off Categorized but no success.

Any workaround for my requirement? Or the 'Filter by column value' simply can't accept multiple value? Currently I'm trying to code everything in the view selection formula(which I'm not sure if possible since I want to create something like:

SELECT (Form="Staff") && ----the part here will be dynamically generated multiple (Department=" " || Department=" " and so on)

My designer and notes are 8.5.3(with extlib but without any fixpacks. if this will help)

标签: xpages
2条回答
我命由我不由天
2楼-- · 2019-09-05 03:07

Filter by column value takes ONE value. What you could do is either a view.FTSearch where you specify the department in the search query or you "cheat" and load one department first and amend the loaded data with an Ajax call retrieving the second one.

查看更多
再贱就再见
3楼-- · 2019-09-05 03:24

For small amount of combinations you can change your view accordingly: make extra categories with key combinations and look for that values.

Example of column formula:

tmpGroups := "CG":"AB":"DE";
tmpDepGroups := @Trim( @Replace( tmpGroups; @ReplaceSubstring( tmpGroups; Department; "" ); "" ));
@Trim( Department : tmpDepGroups )

Make sure you will allow ussers to look up only keys prepared in category (tmpGroups list).

查看更多
登录 后发表回答