Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. var igId = 'emp';
  2. var region = apex.region(igId);
  3. var actions = region.call('getActions');
  4. var actionList = [... new Set(actions.list().map(a => a.name))];
  5. var toInvoke = [];
  6. var toGetSet = [];
  7. var toToggle = [];
  8.  
  9. for(i in actionList){
  10. var action = actions.lookup(actionList[i]);
  11. if(action.action){
  12. toInvoke.push(action);
  13. } else if(action.get && action.set && action.choices){
  14. toGetSet.push(action);
  15. } else {
  16. toToggle.push(action);
  17. }
  18. }
  19.  
  20. // var actions = apex.region(regionId).call('getActions');
  21. // the following actions can be invoked via:
  22. // actions.invoke(actionName);
  23. console.log('actions to invoke', toInvoke);
  24. // the follwing actions have get and set methods:
  25. // var value = actions.get(actionName);
  26. // actions.set(actionName, value);
  27. console.log('actions to get/set', toGetSet);
  28. // the following actions can be toggled
  29. // note they also have getters and setters which accept true/false as parameter
  30. // actions.toggle(actionName);
  31. console.log('actions to toggle', toToggle);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement