How to Remove page from stack in prism xamarin forms - xamarin

I have two pages when user open application first page get data ,
I created another page and when click add in first one it navigate to the second page , I want when adding the required data in the second page and click submit first page is removed and created again with the newest data
first page is CustomerAddressesPage and second one is AddNewAddressPage
this is my code
await _navigationService.NavigateAsync("/CustomerAddressesPage/AddNewAddressPage/CustomerAddressesPage");
It got me error
Removing views using the relative '../' syntax while navigating is only supported within a NavigationPage

The error tells you exactly how you can fix the issue.
_navigationService.NavigateAsync("/NavigationPage/CustomerAddressesPage/AddNewAddressPage/CustomerAddressesPage");
This of course assumes that you have registered the base NavigationPage from Xamarin.Forms for Navigation or have a custom NavigationPage that was registered with that key.

Related

How to controll Auto-scroll up in laravel NOVA?

I am using laravel package called Nova for my UI ,i have one page in that page it contains several blocks each block contains pagination. if i scroll down some page and if click on any pagination next button the page is automatically scrolling to the top instead of opening next page in that block itself ,is there any way to control this behavior..?

Liferay 7.2: Open asset publisher viewURL in a Display Page Template

I am using Liferay 7.2. I want to display the viewURL link of an asset publisher in a Display Page Templates page. I couldn’t solve the problem. After searching, I realized that this problem can be solved in three ways:
Method 1:
1- As and admin, in Web Content>Structures create a structure (News Article) and make a Template for that structure.
2- Create page A and add an asset publisher. In this asset publisher: In Asset Selection choose Web Content Article as Asset Type and choose News Article as sub structure. In Display Setting tab choose View in Context as Asset Link Behavior.
3-In Site Builder>Pages create a Display Page Template (page B). Edit it and add an asset publisher similar to page A. However, in page B, in Configuration of asset publisher, in Display Settings choose Show Full Content as Asset Link Behavior and tick Set as the Default Asset Publisher for This Page and Show only assets with Page B as its display page template.
4-Create some News Article. In Display Page Template section, choose Specific Display Page Template and Page B.
In page A, everything is OK. However, when I click on ViewURL of an asset entry, it will redirect to page B. But, in asset publisher section of page B, no results is shown (There are no results.). Means that the chosen asset of page A is not shown in Display Page Template of page B.
Method 2:
Maybe the simplest method is editing Display Page Template (page B) in Section Builder>Content Display add Display Page Template. However, as stated in this issue , the display page content section only shows the summary and no style can be shown. Maybe it is necessary to edit abstract.jsp file. But, I don’t know how to do this.
Method 3:
Create a Widget Template and add it to page B. The article data of the selected asset can be obtained from the URL. However, I couldn’t get the data of the selected article.
I appreciate for any help in this regard.
An Asset Publisher instantiated in a Display Page Template won't show the page Web Content. One way to show an Web Content in a Display Page Template, is to instantiate a Fragment and map the Web Content fields to it, as shown here.
So, to solve your problem, you would need to change Page's B Asset Publisher to one or more Fragments, and map your News Article fields to them.
You could also map the Web Content to your own custom Fragmets, using Fragments lfr-editable fields
<lfr-editable id="unique-id" type="text">
This is editable text!
</lfr-editable>
Another way is to get the Web Content Java Object instance inside a Freemarker (a Fragment, Widget Template, Web Content Template, etc) with this snippet (only works for 7.3+)
${Request.INFO_ITEM}

How do I get the Router navigate extra "replaceUrl" to work correctly?

I have a contact addition form that can be navigated to from multiple screens in our application.
Once the form is submitted, I then take the user to a screen to view the contact that was added.
When the user then makes use of the back button it should take them back to the screen that they originated from.
This might be the Android back button or one that calls the RouterExtensions back function.
I have made use of the navigate extra replaceUrl when navigating away from the form to the view page.
I have also tried using the skipLocationChange extra when navigating to the form but this creates more issues.
I have created a simple playground page flow that creates not quite the same issue but does throw an error that I don't know what to do with either:
https://play.nativescript.org/?template=play-ng&id=BfVcGZ&v=2
In our app, by making use of the replaceUrl extra, the back button does take the user to the correct page.
However, there is a brief moment where they see the form again. This isn't an ideal user experience.
In the linked Playground I do get an error:
Cannot reattach ActivatedRouteSnapshot created from a different route.
This seems to tell me that replaceUrl is indeed removing the page from the route table.
However, the page isn't destroyed yet and so the app is trying to show a page that it shouldn't.
replaceUrl is not yet supported by Page Router Outlet, there is an open feature request, you might want to register your vote on the feature and follow up there for further updates.

asp.net mvc3 formauthentication,custom role provider-Jquery auto load tabs not working..

I am creating dynamically loading tabs using jquery Ui tabs in my ASP.NET mvc3 project.
Here i have a product page. The product page contains left menus like Customer,Address,Contact,etc..
Here my process is when i click one my left menus, the tab created dynamically with Grid records.
And,
I'm creating a custom role provider and I set a Authorize attribute specifying a role in my controller and it's working just fine, like this:
[Authorize(Roles="SuperAdmin")]
public class SuperAdminController : Controller
...
If one user doens't have access to this controller, And click one of my left menu means,
he's redirected to login page. Its also working fine.
The problem is after the user logged in it didn't redirect the proper page in tab content area.
If my problem not understandable means please let me know..
Thanks Advance...
If you carefully check the URL in the browser, you will see that the URL does not change when you load something by Ajax. That is the point of Ajax actually, you do not load the whole page, right?
Now as the state is not saved when you try to load the content using Ajax, your redirect URL is only the page you loaded initially. That is why you cannot go back to the tab you wanted to load.

wp7 application bar without navigation

My problem is that the application bar is not displayed on a page if I don't use the navigationservice to navigate to that page. My code is : frame.content = page, but I need an application bar. Any help would be appreciated.
After reading your comments to Derek's answer. can't you have the second page be a static empty XAML file with just some sort of container, a ContentPresenter for instance. Then the user generated content could be placed into that instead of a dynamically generated page.
That way, you can just navigate to the page and populate the content, instead of messing with frame's content property directly.
When your page is loaded, what is the value of the ApplicationBar.IsVisible property?
UPDATE: So, I would imagine that the problem is to do with updating the Content property of the PhoneApplicationFrame, rather than navigating to it using the NavigationService. Presumably, under the hood, it's doing whatever is necessary to show the application bar.

Resources