🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Navigate Automatically Without User Interaction
This page was created by Wikiadmin on 2026-07-29. Last edited by Wikiadmin on 2026-07-29.

You can automatically open a navigating action when a condition becomes true, for example to move a signed-in user from an Index page to their dashboard.

Use a Period action for condition-based navigation

A Period action is an action on a form that runs repeatedly at the configured interval. Configure it with a navigating action and a disabled expression so that it runs only when navigation is allowed.

This pattern is useful when the page is already open and a change in application state should move the user on without requiring a click. A common example is an Index web page that remains visible before login and opens a user dashboard after login.

Configure automatic navigation

  1. Open the form that should initiate navigation in MDriven Designer. For the login example, this is the Index web page.
  2. Add a Period action to the form.
  3. Configure the Period action as a navigating action. Select the ViewModel that should open when the condition is met.
  4. Set the action's Disabled expression so that the action is disabled until navigation is valid.
  5. Set Interval to a value other than -1. The value is in milliseconds; for example, use 10 to check frequently. An interval of -1 disables the Period action.
  6. Run the application and verify both states: before the condition is met the user remains on the current page; after it is met the target ViewModel opens.

Example: open a dashboard after login

On an Index page, configure a Period action that navigates to the user dashboard.

The disabled expression must evaluate to true while the user is not logged in, and false after login. In other words, the Period action becomes enabled when the login condition becomes true.

Setting Example value or intent
Action type Period action
Action behavior Navigate to the user-dashboard ViewModel
Disabled expression Disabled when the user is not logged in
Interval 10 milliseconds

For example, if your model exposes a Boolean expression that represents whether the user is logged in, use its inverse as the disabled expression. Replace <user is logged in> with the expression used by your model:

not <user is logged in>

The result is that the action does not run before login. Once login succeeds, the disabled expression becomes false, the Period action can run, and its navigating action opens the dashboard.

Supply a root object when the target requires one

A root object is the object supplied as the context for a ViewModel. If the ViewModel you navigate to requires a root object, you must provide that object in the navigating action. If no required root object is sent, the action does not run.

The Index page is called without a root object. Therefore, do not rely on an Index-page root object when configuring this pattern. Use SysSingleton.oclSingleton as the context instead.

For the login-to-dashboard example:

  1. Keep the Period action on the Index page.
  2. Use SysSingleton.oclSingleton for the state and context needed by the action.
  3. Configure the navigating action to supply the required root object for the dashboard ViewModel.
  4. Test with a dashboard ViewModel that requires a root object; confirm that it opens only when that object is supplied.

Choose the right pattern

Use automatic navigation only when the destination is an expected next step, such as continuing after login. Do not use it for an operation that changes data or needs the user to make a choice.

Need Use
Move the user to another ViewModel after a condition becomes true A Period action with a navigating action
Save changed data automatically Auto save
Open a ViewModel as a dialog and process a selection after it closes Modal views

Troubleshooting

Symptom Check
The navigation never occurs Confirm that Interval is not -1 and that the disabled expression becomes false when the condition is met.
The navigation occurs before login Reverse the disabled expression so it is true while the user is not logged in.
The action does not run when navigating to a ViewModel with context Confirm that the navigating action supplies the required root object.
The Index page has no usable root object Use SysSingleton.oclSingleton; the Index page is called without a root object.

See also