Act as For Actions
No edit summary
No edit summary
Line 1: Line 1:
In the ViewModelEditor, the property "Act As For Actions" helps you in the following ways:
In the ViewModel Editor, the property "Act As For Actions" helps you in the following ways:
* If you have a grid with objects of type B, but many of the actions you want to expose on these objects reside in class A, enter an expression in the "Act As For Actions" that navigates from type B to type A (the expression must end up in 1 or 0 objects). This saves you the trouble of creating new class actions on B that repeat the logic for the class actions on A. This will make your B's act as A's when deciding what actions to expose.
* If you have a grid with objects of type B, but many of the actions you want to expose on these objects reside in class A, enter an expression in the "Act As For Actions" that navigates from type B to type A (the expression must end up in 1 or 0 objects). This saves you the trouble of creating new class actions on B that repeat the logic for the class actions on A. This will make your B's act as A's when deciding what actions to expose.
This scenario is common for association objects (multi-link between A and C with a link to class B in between). You want the precision B offers in the grid but with the actions of A also available. In this case, the context is B, and the expression would be <code>self.A</code>.
This scenario is common for association objects (multi-link between A and C with a link to class B in between).  
 
You want the precision B offers in the grid but with the actions of A also available. In this case, the context is B, and the expression would be <code>self.A</code>.
[[Category:ViewModel Editor]]
[[Category:ViewModel Editor]]
[[Category:Actions]]
[[Category:Actions]]

Revision as of 06:12, 7 September 2023

In the ViewModel Editor, the property "Act As For Actions" helps you in the following ways:

  • If you have a grid with objects of type B, but many of the actions you want to expose on these objects reside in class A, enter an expression in the "Act As For Actions" that navigates from type B to type A (the expression must end up in 1 or 0 objects). This saves you the trouble of creating new class actions on B that repeat the logic for the class actions on A. This will make your B's act as A's when deciding what actions to expose.

This scenario is common for association objects (multi-link between A and C with a link to class B in between).

You want the precision B offers in the grid but with the actions of A also available. In this case, the context is B, and the expression would be self.A.

This page was edited 98 days ago on 02/10/2024. What links here