Very imporant new feature for me - possibility to define multiple LOV's per one attribute. Previously it was possible to have only one LOV defined in Model layer per attribute. In this post I will describe how it works, based on mentioned Steve Muench presentation, and will publish sample application I have developed - LOV_Multiple.zip. You will not be able to run this sample in TP4, only in production when it will be available (I hope very soon).
My sample is based on HR schema, it contains one main View object - EmployeesView and two read-only View objects for LOV's - DepartmentsView and DepartmentsEuropeView. Those two LOV's are based on different SQL statements:
With multiple LOV's per attribute feature, we can use now two or more View objects with different SQL statements for the same attribute. For example, basic SQL statment in DepartmentsView, returns all departments:
And SQL statment in DepartmentsEuropeView, returns departments only from Europe:
Here is a sample screen, where you can see multiple LOV's per attribute defined:
I have defined in this sample, two LOV's for DepartmentId attribute - LOV_Department and LOV_Department_Europe. There is List of Values Switcher attribute defined - lovAttr. This attribute returns LOV name to be used, I have created it as Transient attribute in Employees View object. In its getter method I'm doing a check - if current region is Europe I'm using LOV only with European departments, otherwise default LOV with all departments is used:
On runtime, if employee is based in European department - DepartmentId LOV will use DepartmentsEuropeView and will list only departments from Europe:
In other case, default LOV will be used with all available departments listed:
0 comments:
Post a Comment