SamplePageForButtonsInNestedViewModel
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Adding Buttons in Nested View Models ==
== Adding Buttons in Nested View Models ==
There are two ways to create buttons in a nested ViewModel;
An action column within a ViewModel is used for adding a button. There are two ways to set execution expressions in a nested ViewModel button;


* Using class actions (recommended)
* Using class actions (recommended)
Line 7: Line 7:


=== Using Class Action ===
=== Using Class Action ===
 
Adding a class action requires root on a view model.
# Add action column in ViewModel.
# Add action column in ViewModel.
# Go to ViewModel Actions and click Class Action to create New Class Action.
# Go to ViewModel Actions and click Class Action to create New Class Action.
# DoubleClick on the created Class Action to open actions editor menu where you can edit class action name and execute expression for action.
# DoubleClick on the created Class Action to open actions editor menu where you can edit class action name and execute expression for action.
# Go to the ViewModel and click on the  new action column to show its settings on their right where you can link the column to the class action.
# Go to the ViewModel and click on the  new action column to show its settings on their right where you can link the column to the class action.
[[File:Adding-Nested-ViewModel-Button-Using-Class-Action.png|alt=Nested ViewModel Button using Class Action|none|thumb|931x931px]]


=== Using ViewModel Action ===
=== Using ViewModel Action ===
Line 22: Line 23:
# Go back to the ViewModel and click on the  new action column to show its settings on their right. Make sure the Name for the column is the same as the one for the new ViewModel action.
# Go back to the ViewModel and click on the  new action column to show its settings on their right. Make sure the Name for the column is the same as the one for the new ViewModel action.


  Note: Do not link the created ViewModel action to the action column. The button/action column will work automatically.
  Note: Do not link the created ViewModel action to the action column. The button/action column will work automatically and execute the ViewModel action expression.
[[File:Adding-Nested-ViewModel-Button-Using-ViewModel-Action.png|alt=Adding Nested ViewModel Button Using ViewModel Action|none|thumb|935x935px]]

Latest revision as of 22:42, 4 June 2024

Adding Buttons in Nested View Models

An action column within a ViewModel is used for adding a button. There are two ways to set execution expressions in a nested ViewModel button;

  • Using class actions (recommended)
  • Using ViewModel actions

Using Class Action

Adding a class action requires root on a view model.

  1. Add action column in ViewModel.
  2. Go to ViewModel Actions and click Class Action to create New Class Action.
  3. DoubleClick on the created Class Action to open actions editor menu where you can edit class action name and execute expression for action.
  4. Go to the ViewModel and click on the new action column to show its settings on their right where you can link the column to the class action.
Nested ViewModel Button using Class Action

Using ViewModel Action

For this option to work action column name must be the same as the ViewModel Action name.

  1. Add action column in ViewModel.
  2. Go to ViewModel Actions and click ViewModel Action to create a new ViewModel Action.
  3. DoubleClick on the created ViewModel Action to open actions editor menu where you can edit ViewModel action name and execute expression for action.
  4. Set a name that will be the same as the name of the action column.
  5. Go back to the ViewModel and click on the new action column to show its settings on their right. Make sure the Name for the column is the same as the one for the new ViewModel action.
Note: Do not link the created ViewModel action to the action column. The button/action column will work automatically and execute the ViewModel action expression.
Adding Nested ViewModel Button Using ViewModel Action
This page was edited more than 7 months ago on 06/05/2024. What links here