0

I am working on adding functionality to where the URL takes in a parameter as defined by an MVC style looking way. eg. (www.myurl.com/#viewName/Id/12345 ) where 12345 is the corresponding Id number that I want to get.

I have this functionality working. I am using Internet Explorer 7.

My issue is that when a user attempts to enter a new query string id into the URL, the page doesn't refresh when the user hits enter or the refresh button. (The user can navigate to the url/#/Id/12345 only when opening a new window/tab)

Does anyone know if this is a feature that doesn't work in Flex or if there is some code or configuration needed to allow this? Thanks.

Garrett
  • 1,658
  • 2
  • 17
  • 29
  • I'm confused. If a user types in a new URL, or changes the URL, and presses enter, I would expect the page to reload no matter what they typed. Nothing I know of in a Flex/Flash app would prevent the user from reloading the page, or going to another page. – JeffryHouser Oct 26 '11 at 16:17
  • Maybe the page reloads, but maybe not the main data panel? The trouble I'm having is that I want the application to show the data from the new ID that is entered into the URL. The data panel in the swf object does not change when a new ID is entered in to the URL. I want this to display the new data values for the new corresponding ID. – Garrett Oct 26 '11 at 17:28
  • It is entirely possible the SWF could be cached by the browser; but it should still "reset" to the current state if the page / URL reloads. I think a screen recording would help demonstrate your issue in this case. – JeffryHouser Oct 26 '11 at 18:52

1 Answers1

0

This has nothing to do with Adobe Flex. Is just the browser(most of them I think).

You see, the way how your link is built is exactly how "scroll to anchors on the page" is implemented in links. For example on a blog post page http://example.com/blogPost1.html adding #comments on the end of the link and pressing Enter on the address bar will not reload the page, just scroll the page to the comments section. A browser w

Real word example: go to link https://blog.stackoverflow.com/2011/10/se-podcast-23 after the page loads add at the end of the link #comments and press enter. You will see that the browser will not refresh but just scroll the page to the comments area.

If you want the page to behave in your way without modifying the link structure I think that JavaScript will help you. One example on SO: How can I detect an address bar change with JavaScript?

Community
  • 1
  • 1
Chris Ghenea
  • 12,473
  • 1
  • 29
  • 36