Save and navigate to

Hello,
lets say i have pages "A", "add A" and "B".
When i want to navigate to "C" and not to "A" after pressing Save on "Add A". How can i do this?

Regards
Thomas

Hello @Thomas!

If you opened "Add A" as a dialog from page "A", then you could navigate to "C" after closing the dialog. Here's an example from my app:

Hi kim,
Thank you for your Help :slight_smile:

Too bad am not opening the Add/Edit pages as Dialogs. I only have pages, no Dialogs.
With Dialogs it is no problem.

Thank you!

How does the "Add A" TemplateForm Submit event look like?

The "Save" has no event. Its the primary button which calls "Form0Submit" automatically so far as i know.

Oh!. I see what you mean...

image

i have overlooked this. i will have a look at it.

Thank you!

I can ivoke a method instead of "Navigateto". Thats enough for now. :grin:

Well from what you described in original post, you basically just need to update the "Navigate to" and replace page "angebot" with the referenced "C" page.

Thats not enough because i used the page as dialog, so i do not need an other page but only a dialogservice.close(xxx) if the page is opened as dialog . I changed it to a method call. In the method i decide where to navigate or simply close if opened as dialog.

@Thomas there is a Close dialog action already available in Radzen which does dialogService.Close().

I have written a method:

protected async void OnClose(int? partnerId)
{
    if (ParameterService.OpenedAsDialog)
    {
        DialogService.Close(partnerId);
    }
    else
    {
        UriHelper.NavigateTo("partner");
    }
}

This Method is defined as invoke custom method instead of navigatetto in the form submit event. Works perfect!

Thank you!

Thomas

PS: I wrote a ParameterService for Dependency Injection to send Parameters between pages. This is handier then the "the caller defines the parameter of the receiver" :slight_smile:

1 Like