Pre-filtering list view

0
Hi guys, I’ve got an entity: Region with one attribute: Name (String) that is associated with entities: Company and Person.  Wondering if there’d be a way to create a pre-filter so once a region is added to the user’s profile, it would only show the companies that are associated with the chosen region as you can see below on My Account > preferred region/s:
asked
2 answers
1

You can use xpath for this. On your listview, add the xpath constraining the Regions shown to only those “preferred” by the user. The xpath would be something like:
 

// show the regions preferred by the current user
[MyFirstModule.Region_Account__Preferred = '[%CurrentUser%]']

 

answered
1

Alternative to Conner's approach would be to use the Listview Controls widget – that one allows you to add various filters with a default value. It has the advantage over the Xpath approach that people can still uncheck the filter and see the entire result set, instead of only the filtered result set.

answered