Sunday, March 26, 2017

Groovy Expressions

## if you want to display department name create transient attribute and then use below grrovy expression at VO level.

if(DepartmentId !=null && departmentViewAccessor.first()!=null) { departmentViewAccessor.first().getAttribute("DepartmentName"); }


DepartmentId -- attribute Name
departmentViewAccessor -- view accessorr name
if we edit view accessor passing DepartmentId value to it as a parameter.


#{bindings.NoOfEmployee.inputValue==0}" to diasble

LovAccessorName.count("KeyAttributeName")  -- gives count of VC filtered rows

Wednesday, January 18, 2017

Showing locations based on User country (by reading browser settings of User)

Showing locations based on User country (by reading browser settings of User), for this we need to create application with below structure



Step 2: create Lov for locationID





Step 3: created view criteria in Locations VO


Step 4: selected view accessor in department view and set expression for VC



Step 5: storing the value into above used expression using AMIMPL method as shown below



Step 6 : Interface looks like this

Step :7  drag method from DC to taskflow and set controlflow case as fixed outcome for navigation purpose.



when you double click on method in taskflow it will open below window where we need to set value for userLang parameter using expression .
#{view.locale.language} -- EL
#{view.locale.country} -- EL for getting country code from user browser
Save all and run.
output looks like below.