Am using OnNavigatedTo for passing values while navigating between page, am getting the values in OnNavigatedTo.
That is working fine and now the problem is,
For sample i have screen A, B and C.
When i send data from A to B i can able to collect data in B.
So B has OnNavigatedTo method, when i navigate from B to C and come back to B OnNavigatedTo is called once when i come back to screen B.
Can some one help me to solve this problem.
In your OnNavigatedTo handler of screen B, you can check whether the navigation is backwards or a fresh navigation
if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
{
//Navigation is not backwards
//Your code
}
Related
I have page A and with a button, I go to page B
Now I want to close page B and "page A" appear
(But I don't want to call her again, since the page To make assessments if there is internet, ping the Server, etc. and I don't want to make these checks again.
That is why I want page A to appear once I have closed page B
(As if it were a kind of PopUp (But I don't want to use PopUp because of the type of page and data on page B)
Thank you.
If you go to PageB from PageA with:
NavigationService.NavigateAsync("PageB");
Then you can go back with :
NavigationService.GoBackAsync();
If you go to PageB from PageA with Model style(like PopUp as you mentioned in the question):
NavigationService.NavigateAsync("PageB", useModalNavigation: true);
You can use below codes to go back:
NavigationService.GoBackAsync(useModalNavigation: true);
But I don't want to call her again
To achieve that, you can make the button in Page1 not visible after Page1 appear again.
In Oracle Apex 5.1, I am having issues with Ajax call in my code. There is no error shown as well. Request help in debugging the below scenario.
I created a report with check boxes. This page also has 4 buttons A, B, C, D. I created a page process which is a pl/sql block. Upon clicking on bUtton A OR B this process is being called and executed properly as expected.
For buttons C and D, I wanted to take a user input and pass it to page process.After that only, the process should get executed. For this, I have written an on click dynamic action which prompts for user input upon clicking on buttons C or D.
var order= prompt("Please enter order number", "");
$s('P1_UPDATED_ORDER_NUMBER',order);
alert ($v(P1_UPDATED_ORDER_NUMBER)); // Until this the code is working
apex.server.process ('my_process',{}, {"dataType": "text"});
In the above code, the last line is not showing any result or error. I am not sure if the call is actually made or not?
This issue is resolved by removing apex.server.process() and triggering page submit after above java script is executed.
I believe the actual solution to request the AJAX Callback is to use this:
apex.server.process ('my_process',null, {"dataType": "script"});
hi i created an app which contains three pages,
if go from MainPage to Page1 and reversely 3 to 4 times it ts working fine, but when i Navigate from Mainpage to Page 2 it is working but when i navigate back from Page 2 to Main Page it is opening MainPage after 1 second it is going back to Page2
can you please tell me the solution for this
Okay i am going to give this a wild guess seeing that you have not given code ,
on each page there is a override method you can use, onNavigatedTo.
what i will do is put an OnNavigatedTo event on each page and put a break point in that event and step to see what each individual page does, here is a quick example where i use onnavigated to test if the navigation to this page was a 'back' navigation!
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
//Check if navigation was back!
// you can add the breakpoint here if you want to.
if (e.NavigationMode == NavigationMode.Back)
{
messagebox.show("Nav is back!");
}
now you can easily see what each individual page does when navigated to :) hope this helps a bit.
I have a viewmodel tied to a view used in a region. I'm trying to find a way that when that view is navigated to from a particular view (say view A), it does some work internally, like initializing some lists, setting some stuff, whatever. But if it has been navigated to from view B, it needs to NOT reinitialize everything, and just display the data it already has.
I could pass a parameter I suppose, saying whether this is a new operation or if we are going back to work on the old one, but I thought it would be nicer to be able to state that if we came from this view, we do one thing, and if we came from that one we do another.
If that makes sense :)
You can implement the INavigationAware interface which contains 3 methods. One of these methods is the OnNavigatedTo method. There you can access the journal and check the current entry. From there you should be able to determine if it came from View A or View B.
public void OnNavigatedTo(NavigationContext navigationContext)
{
var journal = navigationContext.NavigationService.Journal;
//use journal.CurrentEntry
}
I have the following layout:
ButtonA has a specific left and right side layout, while ButtonB and ButtonC have a common left side but a different right side. My question is how I should determine what needs to updated via ajax when the various Button combinations and their respective Controller/Actions are called?
For example, if the current page is ButtonB and then I click ButtonA (same for current page ButtonA then clicking ButtonB or C) both the left and right sides need to be updated (in this case it would be the entire wrapper div). However, if the current page is ButtonB and then I click ButtonC only the right side would need to be updated. Here are a couple options that might work:
Have a current page layout id and pass that to the controller/action as a parameter. The action would then determine based upon the current layout to either render the right side or both the left and right side. This would work but is it a MVC best practice?
Have the client side ajax know the current page layout and get the left and right side data separately.
Does anyone have any other suggestions or proper ways to do this with MVC?
I'd have something in your content that's in either div.
For exampel
$("#buttonA").click(function() {
var boxA = $(#boxA).find(".myunique");
if (boxA)
... do update
}
Or if it's a matter of what's clicked and not what's in the boxes, then just use global variables:
var lastClicked = "X";
$("#buttonA").click(function() {
if (lastClicked =="A")
... do update
else
... different update
lastClicked = "A";
}