This is a migrated thread and some comments may be shown as answers.

Force Navigate of Frame

7 Answers 225 Views
Navigation
This is a migrated thread and some comments may be shown as answers.
TWT
Top achievements
Rank 1
TWT asked on 05 Jan 2009, 03:20 PM
I created an app based on the navigation model of your BooksExample... I have a child page that has many different views for the user to enter criteria.. based on the left nav menu I set the Frame to the same page but have the page render differently based on the View Type.  When I click on the Left Nave link the first time it navigates to the page and displays the correct view, however on all other view types it does not navigate... or referesh the pages view.  On the subsequent calls the Frame.Navigate never calls the child page_load.  It appears it's caching that the page is already loaded and does not load.  I want it to reload so the view can change on the page and I don't want to create a seperate page for each view type.... Is there a force method or a way to clear whatever is caching this page information?

Thanks

7 Answers, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 05 Jan 2009, 05:11 PM
Hi TWT,

The page information is not cached.
I suggest you do the following:

1.Check that you correctly use
GetPageFromBookmark , GetBookmarkFromUri ,GetUriFromBookmark events (for more information view app.xaml.cs in BooksExample or the online documentation).
2.Make sure that NavigationIdentifier property is set to a different value for all the views.
3.Make sure that you use some identifier (property, variable etc.) that holds different value for all the views.

If this does not help you, could you please provide a sample code so that we can try to reproduce the problem at our side and locate what causes it.

All the best,
Boryana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
TWT
Top achievements
Rank 1
answered on 05 Jan 2009, 06:23 PM

Here is the code where I set the page to the RadFrame on the MainPage.  This event is fired from the PanelBar when a new item is clicked....

 

private

 

void PriorReleaseChildBarItem_Selected(object sender, Telerik.Windows.RadRoutedEventArgs e)

 

{

 

if (e.OriginalSource != null && e.OriginalSource is RadPanelBarItem)

 

{

 

RadPanelBarItem target = e.OriginalSource as RadPanelBarItem;

 

 

MenuItem item = (MenuItem)target.Tag;

 

 

PriorReleaseCriteria page = new PriorReleaseCriteria();

 

page.PriorReleaseID = item.Id.ToString();

 

 

this.Frame.Navigate(page);

 

 

}

}

I'm creating a new instance of the page each time but after the first time the page load does not fire on the Prior Release Criteria page... If I create a new instance of the page shouldn't the page_load fire, it only fires the first time this type of page is loaded into the Frame?  The PriorReleaseId tells the calling page how to render it's UI.

thanks

0
TWT
Top achievements
Rank 1
answered on 05 Jan 2009, 07:37 PM
Resolved: based on your recommendation I set the NavigationIdentifier property before calling this.Frame.Navigate(page)

page.NavigationIdentifier =

"priorReleaseCriteria_" + item.Id.ToString();

Not sure why I have to do this since you said your not storing anything internally, but based on having to do this I have to assume you are and the NavigationIdentifier is the key to your internal collection of IFrame pages. 

I would assume if new page is passed then the load event of the page would fire.

Thanks Boryana for the help in resolving.


 

private

 

void PriorReleaseChildBarItem_Selected(object sender, Telerik.Windows.RadRoutedEventArgs e)

 

{

 

if (e.OriginalSource != null && e.OriginalSource is RadPanelBarItem)

 

{

 

RadPanelBarItem target = e.OriginalSource as RadPanelBarItem;

 

 

MenuItem item = (MenuItem)target.Tag;

 

 

PriorReleaseCriteria page = new PriorReleaseCriteria();

 

page.NavigationIdentifier =

"priorReleaseCriteria_" + item.Id.ToString();

 

page.PriorReleaseID = item.Id.ToString();

 

 

this.Frame.Navigate(page);

 

 

}

}

0
qq
Top achievements
Rank 1
answered on 25 Feb 2009, 02:23 AM
Hello, may I ask how the two Silverlight page transmission parameters, such as inside Request.QueryString in asp.net
 Thanks
0
Bobi
Telerik team
answered on 25 Feb 2009, 06:53 AM
Hi qq,

In RadNavigation the transition between pages is simply an animated replacement of one page with another.
In the DefaultTransition method there is no parameter. If you use FadeTransition then you can set the duration of the animation. If you want to have some parameter that is specific to a particular page then use the NavigationUri property to customize the Uri that represents the current state of your page navigation.

I hope this answers your question.

Greetings,
Boryana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
qq
Top achievements
Rank 1
answered on 25 Feb 2009, 07:22 AM

I beg your pardon, you can give me example code?

 Such as Silverlight page page1? Id = 12, navigate to page2, then in page2 page, id = 12 shows a detailed product information. Thank you

0
Bobi
Telerik team
answered on 27 Feb 2009, 08:18 AM
Hi Trent,

You can add a property to RadPage and change this property  when selecting a new item from the listbox (see the attached sample project). There are two options:  

1) NavigationService.UseHistoryBookmark = true;
(if you prefer to use simple navigation without WebApplication and BrowserHistory)

 2) NavigationService.UseBrowserHistory = true;
(if you use Webapplication and browser history).

If you do not want to use a different BrowserIdentifier for each page instance then the NavigationFramework will navigate to the same page each time because of the same NavigationIdentifier property value.(Note: Each RadPage has its own NavigationIdentifier and that’s why  if you want to navigate to this page several times with different content you have to change this property!)
So, if you want to use nested page navigation with different instances of one page you have to do the following in the page that you want to navigate to:

public string PageID
            {
                  get
                  {
                        return this.pageID;
                  }
                  set
                  {
                        this.pageID = value;
                        NavigationIdentifier = "AdminPage" + this.pageID ;
                  }
            }
 
Note: It is important to set NavigationIdentifier to some custom value in order to have navigation to one page multiple times with different content!
The next step is to enable Back and Forward functionality as well as DeepLinking support for your custom page instances if you prefer to have this functionality. To do that you have to call 3 events in the App.xaml.cs Application_Startup method:

service.GetPageFromBookmark += new EventHandler<FrameInfoEventArgs>(this.Service_GetPageFromBookmark);
                  service.GetBookmarkFromUri += new EventHandler<UriInfoEventArgs>(this.Service_GetBookmarkFromUri);
                  service.GetUriFromBookmark += new EventHandler<UriInfoEventArgs>(this.Service_GetUriFromBookmark);
 
After that add the next methods to App.xaml.cs:

private void Service_GetUriFromBookmark(object sender, UriInfoEventArgs e)
            {
                  string bookmark = e.Bookmark;
            }
 
            private void Service_GetBookmarkFromUri(object sender, UriInfoEventArgs e)
            {
                  string uri = e.Uri;
            }
 
private void Service_GetPageFromBookmark(object sender, FrameInfoEventArgs e)
            {
                  if (e.FrameType.Contains("AdminPage"))
                  {
                        AdminPage page = new AdminPage();
                        string frameType = e.FrameType.Substring(0, e.FrameType.Length );
                        page.PageID = frameType.Substring(frameType.LastIndexOf("_") + 1);
                        e.Frame = page;
                  }
            }

For more details please refer to the attached sample project.
For more composite scenarios please visit :
http://blogs.telerik.com/boryanamiloshevska/posts/08-12-20/RadNavigation_deep_linking.aspx
(Here you can find full source code of example with custom bookmarks and web application)

I hope this answers your question.

Greetings,
Boryana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Navigation
Asked by
TWT
Top achievements
Rank 1
Answers by
Bobi
Telerik team
TWT
Top achievements
Rank 1
qq
Top achievements
Rank 1
Share this question
or