-
Notifications
You must be signed in to change notification settings - Fork 2.4k
duplicateCachedPage delete wrong page if using REST principles #1537
Comments
Thanks, we'll take a look at this soon as we're re-factoring the URL handling in navigation already:https://github.com/jquery/jquery-mobile/wiki/Refactor:-navigation-paths |
Kin - was this covered in the URL re-write? |
@asyraf9 - is this still an issue with the latest code? |
so far so good, but i'll test again just to make sure. On Tue, Sep 27, 2011 at 11:26 AM, Todd Parker <
Asyraf Abdul Rahman |
I have an issue with duplicates when submitting form, maybe its related. |
Sounded like the original issue was resolved so closing. @Savvkin - if you're still seeing an issue, please post as a new issue. |
Hi there folks,
if using REST, (i'm using rails here) - when for example, you want to work with a database of patients
http://localhost/patients/ - GET retrieves a list of all the patients, BUT
http://localhost/patients/ - POST creates a new record of the patients.
this creates some confusion on the pages due to duplicateCachedPage - lets say - you want to return a page that shows the particular created record after form submission, then jquerymobile deletes the wrong page and returns another in its stead (with the wrong data-url). if no data-url is defined on the returned page, it then gets the url we submitted it to (which in this case is /patients/) thereby ruining the meaning of the page (in this particular use case).
Of course the returned page after form submission can be handled by defining data-url on it, but the page with the list of patients is still removed due to duplicateCachedPage. On mobile view this may seem to not be a problem, since the deleted page will then be reloaded again when requested, but in splitview it simply clears an entire panel - breaking it.
my suggestion is, if a data-url is defined on the returned page (the one returned after form submission) - which jquerymobile is checking for when doing an ajax request - then we need to clear duplicateCachedPage because it means that the url requested is not the url returned, thus it is not a page refresh.
NOTE - the ajax request I'm talking about is in line 570 of jquery.mobile.navigation.js
The text was updated successfully, but these errors were encountered: