-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blank page when calling changePage on dynamically generated page #23
Comments
hm. If you can post your basic html, I could have a quick look (also deadline on Monday....) For now I can only guess: Multiview navigation works similar to the dynamic page example, BUT I'm not preventdefaulting the original changePage. The dynamic page example (a) catches the changePage on pagebeforechange,(b) modifies parameters, (c) STOPS IT and (d) fires a NEW changePage, while I'm only re-directing the incoming changePage. If you are tampering with the original event, this may be a reason it's not working (latest version here). If you want to track your changePage call through the multiview plugin, set consoles at the following points: Incoming:
Forward transitions: Cleanup Let me know, what you get from the consoles. Then we see, where we go from there |
Hello, Thank you so much for your (very) quick reply ! I'm not sure if the HTML would help in it's current state since it has a lot of non-multiview code and I would probably need to simplify it greatly to send it here. I'll see if I can get that done. Also I had a quick question, I'm no big javascript expert: do you have a recommendation to dump object to the console log ? Because I tried adding a console.log to the pagebeforechange but I get something like :
produces: 2012-06-22 20:53:37.635 Wise[3770:13403] [INFO] multiview.pagebeforechange data=[object Object] I'm still working on integrating all the suggestions you made, as soon as I have done that I'll send some logs. Btw the deadline I have is actually a webinar, if you're interested here is the invitation info: http://www.jahia.com/cms/home/about-us/events/content-main/events-list/jahia-webinar---native-multi-pla.html Best regards, |
Ok I've added a few logs, hopefully in the right locations, here is the log extract I get from clicking on a link with a data-panel='main' from a panel menu. Please note that I am indeed implementing the changePage with the preventDefault mechanism as in the JQM example, and also that I am changing to a DOM page (not of type string) in the second call. I think this is possibly the problem, see my (beginner's) analysis below. Here is the log : 2012-06-22 21:19:43.980 Wise[3925:13403] [INFO] multiview.pagebeforechange data=[object Object] I think the problem occurs in the following code:
As my toPage is not of type string, and I don't set any role (not sure what this is btw), the method stop executing here and returns. I hope this is enough to help diagnose the problem, please let me know how I can assist you in getting to the bottom of this, your helps is GREATLY appreciated. Best regards, |
Don't put any text in the console.log, when you want to see the object.
will give you object object
will give you the full object with all parameters |
Then if you get the data object, check what:
are. If any of these are empty or wrong or toPage is an object, you have your false transition. Not sure how to handle prevDefault, but if you have to use it, you have to make sure, that what initially gets "passed into" the multiview pageBeforeChange handler also gets "passed out" (including your changes I assume). If you have an object as data.toPage... which I'm just rechecking is probably the case depending on what this is:
then you have to create the data-url or path you want to go to by hand and pass it in as a string: If you can use data-url, try either one of those:
To see how to make an object into a string check my BACKFIX option in MAINEVENTBINDINGS. I'm doing the same there, because the last backwards transition before reaching the first page only passes on object as far as I noticed. So I need to convert the object to string to trigger the transition. Try the same. |
Hi, Thanks again for your help, the week-end was a frustrating one. I tried adding console logs for the data, for example in the following form : console.log("multiview.pagebeforechange"); console.log(data.toPage); console.log(data.options.fromPage); console.log(data.options.pageContainer); But then in the output I would always get : 2012-06-25 08:50:38.478 Wise[1341:13403] [INFO] multiview.pagebeforechange 2012-06-25 08:50:38.479 Wise[1341:13403] [INFO] file:///Users/loom/Library/Application Support/iPhone Simulator/5.1/Applications/FE030000-C095-45AF-91C1-9B2818C7559A/Wise.app/www/index.html#viewNode_jnt_folder?nodePath=%2Fsites%2Fdocspaces%2Ffiles%2Fdocspaces%2Fdocspace2 2012-06-25 08:50:38.480 Wise[1341:13403] [INFO] error JSON.stringify()ing argument: TypeError: JSON.stringify cannot serialize cyclic structures. 2012-06-25 08:50:38.480 Wise[1341:13403] [INFO] error JSON.stringify()ing argument: TypeError: JSON.stringify cannot serialize cyclic structures. I then tried to use the decycle Javascript code from https://github.com/douglascrockford/JSON-js and tried to modify this to look like console.log(JSON.stringify(JSON.decycle(data)) but this was even worse, I was getting infinite loops (so much for decycling :(). I then started writing my own object dumping code, but this was not trivial for someone still a bit young in Javascript code but at least I got some results. I used the following code : var alreadyVisited = []; var currentPath = []; function dumpObjectProperties(curObject) { recurseDumpObjectProperties(curObject, 0); alreadyVisited = []; currentPath = []; } function getNodePath(htmlNode) { var path = []; do { path.unshift(htmlNode.nodeName + (htmlNode.id ? ' id="' + htmlNode.id + '"' : '') + (htmlNode.className ? ' class="' + htmlNode.className + '"' : '')); } while ((htmlNode.nodeName.toLowerCase() != 'html') && (htmlNode = htmlNode.parentNode)); return path.join(" > "); } function recurseDumpObjectProperties(curObject, depthPadding) { var depthPaddingString = ""; for (i =0; i < depthPadding; i++) { depthPaddingString += " "; } if ($.inArray(curObject, alreadyVisited) !== -1) { console.log(depthPaddingString + 'already visited object at ' + currentPath); return; } if (depthPadding > 4) { console.log(depthPaddingString + 'aborting output because of depth'); return; } alreadyVisited.push(curObject); currentPath.push(curObject); console.log(depthPaddingString + '{'); for (var objectPropertyKey in curObject) { var objectPropertyValue = curObject[objectPropertyKey]; if (objectPropertyKey == 'outerHTML' || objectPropertyKey == 'innerHTML') { console.log(depthPaddingString + ' ' + objectPropertyKey + ' : \'HTML stripped\''); } else if (objectPropertyKey == 'outerText' || objectPropertyKey == 'innerText') { console.log(depthPaddingString + ' ' + objectPropertyKey + ' : \'Text stripped\''); } else if (typeof objectPropertyValue == 'object') { if (objectPropertyValue instanceof Node) { console.log(depthPaddingString + ' ' + objectPropertyKey + ' : ' + getNodePath(objectPropertyValue)); } else { console.log(depthPaddingString + ' ' + objectPropertyKey + ' : '); recurseDumpObjectProperties(objectPropertyValue, depthPadding + 2); } } else if (typeof objectPropertyValue == 'function') { // don't dump functions, they are not needed most of the time. } else { console.log(depthPaddingString + ' ' + objectPropertyKey + ' : ' + curObject[objectPropertyKey]); } } console.log(depthPaddingString + '}'); currentPath.pop(); } I got the following result for a single page click: 2012-06-25 08:59:52.344 Wise[1500:13403] [INFO] multiview.pagebeforechange data= 2012-06-25 08:59:52.344 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.345 Wise[1500:13403] [INFO] toPage : file:///Users/loom/Library/Application Support/iPhone Simulator/5.1/Applications/FE030000-C095-45AF-91C1-9B2818C7559A/Wise.app/www/index.html#viewNode_jnt_folder?nodePath=%2Fsites%2Fdocspaces%2Ffiles%2Fdocspaces%2Fdocspace2 2012-06-25 08:59:52.346 Wise[1500:13403] [INFO] options : 2012-06-25 08:59:52.346 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.347 Wise[1500:13403] [INFO] reverse : false 2012-06-25 08:59:52.347 Wise[1500:13403] [INFO] changeHash : true 2012-06-25 08:59:52.347 Wise[1500:13403] [INFO] fromHashChange : false 2012-06-25 08:59:52.348 Wise[1500:13403] [INFO] showLoadMsg : true 2012-06-25 08:59:52.348 Wise[1500:13403] [INFO] allowSamePageTransition : false 2012-06-25 08:59:52.349 Wise[1500:13403] [INFO] pageContainer : 2012-06-25 08:59:52.349 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.350 Wise[1500:13403] [INFO] 0 : HTML class="ui-mobile overthrow-enabled multiview ui-plain-mode notouch pushstate ui-multiview-active ui-splitview-mode" > BODY class="ui-mobile-viewport ui-overlay-c" 2012-06-25 08:59:52.350 Wise[1500:13403] [INFO] length : 1 2012-06-25 08:59:52.351 Wise[1500:13403] [INFO] prevObject : 2012-06-25 08:59:52.351 Wise[1500:13403] [INFO] aborting output because of depth 2012-06-25 08:59:52.352 Wise[1500:13403] [INFO] context : #document 2012-06-25 08:59:52.352 Wise[1500:13403] [INFO] selector : :jqmData(role='page'), :jqmData(role='dialog').slice(0,1).parent() 2012-06-25 08:59:52.353 Wise[1500:13403] [INFO] jquery : 1.7.1 2012-06-25 08:59:52.353 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.354 Wise[1500:13403] [INFO] fromPage : 2012-06-25 08:59:52.354 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.355 Wise[1500:13403] [INFO] 0 : HTML class="ui-mobile overthrow-enabled multiview ui-plain-mode notouch pushstate ui-multiview-active ui-splitview-mode" > BODY class="ui-mobile-viewport ui-overlay-c" > DIV class="ui-page ui-body-c ui-page-footer-fixed ui-page-active" 2012-06-25 08:59:52.355 Wise[1500:13403] [INFO] length : 1 2012-06-25 08:59:52.356 Wise[1500:13403] [INFO] prevObject : 2012-06-25 08:59:52.356 Wise[1500:13403] [INFO] aborting output because of depth 2012-06-25 08:59:52.357 Wise[1500:13403] [INFO] context : #document 2012-06-25 08:59:52.357 Wise[1500:13403] [INFO] selector : :jqmData(role='page'), :jqmData(role='dialog').slice(0,1) 2012-06-25 08:59:52.358 Wise[1500:13403] [INFO] jquery : 1.7.1 2012-06-25 08:59:52.358 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.359 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.359 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.360 Wise[1500:13403] [INFO] multiview.panelTrans data= 2012-06-25 08:59:52.360 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.361 Wise[1500:13403] [INFO] toPage : file:///Users/loom/Library/Application Support/iPhone Simulator/5.1/Applications/FE030000-C095-45AF-91C1-9B2818C7559A/Wise.app/www/index.html#viewNode_jnt_folder?nodePath=%2Fsites%2Fdocspaces%2Ffiles%2Fdocspaces%2Fdocspace2 2012-06-25 08:59:52.361 Wise[1500:13403] [INFO] options : 2012-06-25 08:59:52.362 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.362 Wise[1500:13403] [INFO] reverse : false 2012-06-25 08:59:52.363 Wise[1500:13403] [INFO] changeHash : true 2012-06-25 08:59:52.363 Wise[1500:13403] [INFO] fromHashChange : false 2012-06-25 08:59:52.364 Wise[1500:13403] [INFO] showLoadMsg : true 2012-06-25 08:59:52.364 Wise[1500:13403] [INFO] allowSamePageTransition : false 2012-06-25 08:59:52.365 Wise[1500:13403] [INFO] pageContainer : 2012-06-25 08:59:52.366 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.366 Wise[1500:13403] [INFO] 0 : HTML class="ui-mobile overthrow-enabled multiview ui-plain-mode notouch pushstate ui-multiview-active ui-splitview-mode" > BODY class="ui-mobile-viewport ui-overlay-c" 2012-06-25 08:59:52.367 Wise[1500:13403] [INFO] length : 1 2012-06-25 08:59:52.367 Wise[1500:13403] [INFO] prevObject : 2012-06-25 08:59:52.368 Wise[1500:13403] [INFO] aborting output because of depth 2012-06-25 08:59:52.368 Wise[1500:13403] [INFO] context : #document 2012-06-25 08:59:52.369 Wise[1500:13403] [INFO] selector : :jqmData(role='page'), :jqmData(role='dialog').slice(0,1).parent() 2012-06-25 08:59:52.369 Wise[1500:13403] [INFO] jquery : 1.7.1 2012-06-25 08:59:52.370 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.370 Wise[1500:13403] [INFO] fromPage : 2012-06-25 08:59:52.371 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.371 Wise[1500:13403] [INFO] 0 : HTML class="ui-mobile overthrow-enabled multiview ui-plain-mode notouch pushstate ui-multiview-active ui-splitview-mode" > BODY class="ui-mobile-viewport ui-overlay-c" > DIV class="ui-page ui-body-c ui-page-footer-fixed ui-page-active" 2012-06-25 08:59:52.372 Wise[1500:13403] [INFO] length : 1 2012-06-25 08:59:52.372 Wise[1500:13403] [INFO] prevObject : 2012-06-25 08:59:52.373 Wise[1500:13403] [INFO] aborting output because of depth 2012-06-25 08:59:52.373 Wise[1500:13403] [INFO] context : #document 2012-06-25 08:59:52.374 Wise[1500:13403] [INFO] selector : :jqmData(role='page'), :jqmData(role='dialog').slice(0,1) 2012-06-25 08:59:52.374 Wise[1500:13403] [INFO] jquery : 1.7.1 2012-06-25 08:59:52.379 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.380 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.381 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.381 Wise[1500:13403] [INFO] multiview.panelTrans = JQM transition 2012-06-25 08:59:52.393 Wise[1500:13403] [INFO] multiview.pagebeforechange data= 2012-06-25 08:59:52.393 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.394 Wise[1500:13403] [INFO] toPage : file:///Users/loom/Library/Application Support/iPhone Simulator/5.1/Applications/FE030000-C095-45AF-91C1-9B2818C7559A/Wise.app/www/index.html#viewNode_jnt_folder?nodePath=%2Fsites%2Fdocspaces%2Ffiles%2Fdocspaces%2Fdocspace2 2012-06-25 08:59:52.395 Wise[1500:13403] [INFO] options : 2012-06-25 08:59:52.396 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.396 Wise[1500:13403] [INFO] reverse : false 2012-06-25 08:59:52.399 Wise[1500:13403] [INFO] changeHash : false 2012-06-25 08:59:52.400 Wise[1500:13403] [INFO] fromHashChange : true 2012-06-25 08:59:52.400 Wise[1500:13403] [INFO] showLoadMsg : true 2012-06-25 08:59:52.401 Wise[1500:13403] [INFO] allowSamePageTransition : false 2012-06-25 08:59:52.401 Wise[1500:13403] [INFO] pageContainer : 2012-06-25 08:59:52.402 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.402 Wise[1500:13403] [INFO] 0 : HTML class="ui-mobile overthrow-enabled multiview ui-plain-mode notouch pushstate ui-multiview-active ui-splitview-mode" > BODY class="ui-mobile-viewport ui-overlay-c" 2012-06-25 08:59:52.403 Wise[1500:13403] [INFO] length : 1 2012-06-25 08:59:52.403 Wise[1500:13403] [INFO] prevObject : 2012-06-25 08:59:52.403 Wise[1500:13403] [INFO] aborting output because of depth 2012-06-25 08:59:52.417 Wise[1500:13403] [INFO] context : #document 2012-06-25 08:59:52.419 Wise[1500:13403] [INFO] selector : :jqmData(role='page'), :jqmData(role='dialog').slice(0,1).parent() 2012-06-25 08:59:52.420 Wise[1500:13403] [INFO] jquery : 1.7.1 2012-06-25 08:59:52.420 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.421 Wise[1500:13403] [INFO] fromPage : 2012-06-25 08:59:52.422 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.423 Wise[1500:13403] [INFO] 0 : HTML class="ui-mobile overthrow-enabled multiview ui-plain-mode notouch pushstate ui-multiview-active ui-splitview-mode" > BODY class="ui-mobile-viewport ui-overlay-c" > DIV class="ui-page ui-body-c ui-page-footer-fixed ui-page-active" 2012-06-25 08:59:52.423 Wise[1500:13403] [INFO] length : 1 2012-06-25 08:59:52.425 Wise[1500:13403] [INFO] prevObject : 2012-06-25 08:59:52.426 Wise[1500:13403] [INFO] aborting output because of depth 2012-06-25 08:59:52.428 Wise[1500:13403] [INFO] context : #document 2012-06-25 08:59:52.429 Wise[1500:13403] [INFO] selector : :jqmData(role='page'), :jqmData(role='dialog').slice(0,1) 2012-06-25 08:59:52.430 Wise[1500:13403] [INFO] jquery : 1.7.1 2012-06-25 08:59:52.430 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.431 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.432 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.433 Wise[1500:13403] [INFO] multiview.panelhash data= 2012-06-25 08:59:52.434 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.434 Wise[1500:13403] [INFO] toPage : file:///Users/loom/Library/Application Support/iPhone Simulator/5.1/Applications/FE030000-C095-45AF-91C1-9B2818C7559A/Wise.app/www/index.html#viewNode_jnt_folder?nodePath=%2Fsites%2Fdocspaces%2Ffiles%2Fdocspaces%2Fdocspace2 2012-06-25 08:59:52.435 Wise[1500:13403] [INFO] options : 2012-06-25 08:59:52.435 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.436 Wise[1500:13403] [INFO] reverse : false 2012-06-25 08:59:52.436 Wise[1500:13403] [INFO] changeHash : false 2012-06-25 08:59:52.437 Wise[1500:13403] [INFO] fromHashChange : true 2012-06-25 08:59:52.438 Wise[1500:13403] [INFO] showLoadMsg : true 2012-06-25 08:59:52.438 Wise[1500:13403] [INFO] allowSamePageTransition : false 2012-06-25 08:59:52.439 Wise[1500:13403] [INFO] pageContainer : 2012-06-25 08:59:52.439 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.440 Wise[1500:13403] [INFO] 0 : HTML class="ui-mobile overthrow-enabled multiview ui-plain-mode notouch pushstate ui-multiview-active ui-splitview-mode" > BODY class="ui-mobile-viewport ui-overlay-c" 2012-06-25 08:59:52.441 Wise[1500:13403] [INFO] length : 1 2012-06-25 08:59:52.441 Wise[1500:13403] [INFO] prevObject : 2012-06-25 08:59:52.442 Wise[1500:13403] [INFO] aborting output because of depth 2012-06-25 08:59:52.442 Wise[1500:13403] [INFO] context : #document 2012-06-25 08:59:52.443 Wise[1500:13403] [INFO] selector : :jqmData(role='page'), :jqmData(role='dialog').slice(0,1).parent() 2012-06-25 08:59:52.443 Wise[1500:13403] [INFO] jquery : 1.7.1 2012-06-25 08:59:52.443 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.444 Wise[1500:13403] [INFO] fromPage : 2012-06-25 08:59:52.445 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.445 Wise[1500:13403] [INFO] 0 : HTML class="ui-mobile overthrow-enabled multiview ui-plain-mode notouch pushstate ui-multiview-active ui-splitview-mode" > BODY class="ui-mobile-viewport ui-overlay-c" > DIV class="ui-page ui-body-c ui-page-footer-fixed ui-page-active" 2012-06-25 08:59:52.445 Wise[1500:13403] [INFO] length : 1 2012-06-25 08:59:52.449 Wise[1500:13403] [INFO] prevObject : 2012-06-25 08:59:52.450 Wise[1500:13403] [INFO] aborting output because of depth 2012-06-25 08:59:52.451 Wise[1500:13403] [INFO] context : #document 2012-06-25 08:59:52.452 Wise[1500:13403] [INFO] selector : :jqmData(role='page'), :jqmData(role='dialog').slice(0,1) 2012-06-25 08:59:52.453 Wise[1500:13403] [INFO] jquery : 1.7.1 2012-06-25 08:59:52.453 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.453 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.454 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.455 Wise[1500:13403] [INFO] panelTransitionCleaner data= 2012-06-25 08:59:52.455 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.456 Wise[1500:13403] [INFO] toPage : file:///Users/loom/Library/Application Support/iPhone Simulator/5.1/Applications/FE030000-C095-45AF-91C1-9B2818C7559A/Wise.app/www/index.html#viewNode_jnt_folder?nodePath=%2Fsites%2Fdocspaces%2Ffiles%2Fdocspaces%2Fdocspace2 2012-06-25 08:59:52.456 Wise[1500:13403] [INFO] options : 2012-06-25 08:59:52.457 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.457 Wise[1500:13403] [INFO] reverse : false 2012-06-25 08:59:52.457 Wise[1500:13403] [INFO] changeHash : false 2012-06-25 08:59:52.458 Wise[1500:13403] [INFO] fromHashChange : true 2012-06-25 08:59:52.459 Wise[1500:13403] [INFO] showLoadMsg : true 2012-06-25 08:59:52.459 Wise[1500:13403] [INFO] allowSamePageTransition : false 2012-06-25 08:59:52.460 Wise[1500:13403] [INFO] pageContainer : 2012-06-25 08:59:52.460 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.461 Wise[1500:13403] [INFO] 0 : HTML class="ui-mobile overthrow-enabled multiview ui-plain-mode notouch pushstate ui-multiview-active ui-splitview-mode" > BODY class="ui-mobile-viewport ui-overlay-c" 2012-06-25 08:59:52.461 Wise[1500:13403] [INFO] length : 1 2012-06-25 08:59:52.462 Wise[1500:13403] [INFO] prevObject : 2012-06-25 08:59:52.462 Wise[1500:13403] [INFO] aborting output because of depth 2012-06-25 08:59:52.463 Wise[1500:13403] [INFO] context : #document 2012-06-25 08:59:52.464 Wise[1500:13403] [INFO] selector : :jqmData(role='page'), :jqmData(role='dialog').slice(0,1).parent() 2012-06-25 08:59:52.464 Wise[1500:13403] [INFO] jquery : 1.7.1 2012-06-25 08:59:52.465 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.465 Wise[1500:13403] [INFO] fromPage : 2012-06-25 08:59:52.466 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.467 Wise[1500:13403] [INFO] 0 : HTML class="ui-mobile overthrow-enabled multiview ui-plain-mode notouch pushstate ui-multiview-active ui-splitview-mode" > BODY class="ui-mobile-viewport ui-overlay-c" > DIV class="ui-page ui-body-c ui-page-footer-fixed ui-page-active" 2012-06-25 08:59:52.467 Wise[1500:13403] [INFO] length : 1 2012-06-25 08:59:52.468 Wise[1500:13403] [INFO] prevObject : 2012-06-25 08:59:52.468 Wise[1500:13403] [INFO] aborting output because of depth 2012-06-25 08:59:52.469 Wise[1500:13403] [INFO] context : #document 2012-06-25 08:59:52.469 Wise[1500:13403] [INFO] selector : :jqmData(role='page'), :jqmData(role='dialog').slice(0,1) 2012-06-25 08:59:52.470 Wise[1500:13403] [INFO] jquery : 1.7.1 2012-06-25 08:59:52.470 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.471 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.471 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.472 Wise[1500:13403] [INFO] todo= 2012-06-25 08:59:52.473 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.473 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.474 Wise[1500:13403] [INFO] link= 2012-06-25 08:59:52.474 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.475 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.475 Wise[1500:13403] [INFO] jahiawise.pagebeforechange data= 2012-06-25 08:59:52.483 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.484 Wise[1500:13403] [INFO] toPage : file:///Users/loom/Library/Application Support/iPhone Simulator/5.1/Applications/FE030000-C095-45AF-91C1-9B2818C7559A/Wise.app/www/index.html#viewNode_jnt_folder?nodePath=%2Fsites%2Fdocspaces%2Ffiles%2Fdocspaces%2Fdocspace2 2012-06-25 08:59:52.484 Wise[1500:13403] [INFO] options : 2012-06-25 08:59:52.485 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.485 Wise[1500:13403] [INFO] reverse : false 2012-06-25 08:59:52.486 Wise[1500:13403] [INFO] changeHash : false 2012-06-25 08:59:52.487 Wise[1500:13403] [INFO] fromHashChange : true 2012-06-25 08:59:52.487 Wise[1500:13403] [INFO] showLoadMsg : true 2012-06-25 08:59:52.488 Wise[1500:13403] [INFO] allowSamePageTransition : false 2012-06-25 08:59:52.488 Wise[1500:13403] [INFO] pageContainer : 2012-06-25 08:59:52.489 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.489 Wise[1500:13403] [INFO] 0 : HTML class="ui-mobile overthrow-enabled multiview ui-plain-mode notouch pushstate ui-multiview-active ui-splitview-mode" > BODY class="ui-mobile-viewport ui-overlay-c" 2012-06-25 08:59:52.490 Wise[1500:13403] [INFO] length : 1 2012-06-25 08:59:52.490 Wise[1500:13403] [INFO] prevObject : 2012-06-25 08:59:52.491 Wise[1500:13403] [INFO] aborting output because of depth 2012-06-25 08:59:52.491 Wise[1500:13403] [INFO] context : #document 2012-06-25 08:59:52.492 Wise[1500:13403] [INFO] selector : :jqmData(role='page'), :jqmData(role='dialog').slice(0,1).parent() 2012-06-25 08:59:52.492 Wise[1500:13403] [INFO] jquery : 1.7.1 2012-06-25 08:59:52.493 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.494 Wise[1500:13403] [INFO] fromPage : 2012-06-25 08:59:52.494 Wise[1500:13403] [INFO] { 2012-06-25 08:59:52.495 Wise[1500:13403] [INFO] 0 : HTML class="ui-mobile overthrow-enabled multiview ui-plain-mode notouch pushstate ui-multiview-active ui-splitview-mode" > BODY class="ui-mobile-viewport ui-overlay-c" > DIV class="ui-page ui-body-c ui-page-footer-fixed ui-page-active" 2012-06-25 08:59:52.495 Wise[1500:13403] [INFO] length : 1 2012-06-25 08:59:52.496 Wise[1500:13403] [INFO] prevObject : 2012-06-25 08:59:52.496 Wise[1500:13403] [INFO] aborting output because of depth 2012-06-25 08:59:52.497 Wise[1500:13403] [INFO] context : #document 2012-06-25 08:59:52.497 Wise[1500:13403] [INFO] selector : :jqmData(role='page'), :jqmData(role='dialog').slice(0,1) 2012-06-25 08:59:52.498 Wise[1500:13403] [INFO] jquery : 1.7.1 2012-06-25 08:59:52.498 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.499 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.500 Wise[1500:13403] [INFO] } 2012-06-25 08:59:52.500 Wise[1500:13403] [INFO] Event pagebeforechange using string=file:///Users/loom/Library/Application Support/iPhone Simulator/5.1/Applications/FE030000-C095-45AF-91C1-9B2818C7559A/Wise.app/www/index.html#viewNode_jnt_folder?nodePath=%2Fsites%2Fdocspaces%2Ffiles%2Fdocspaces%2Fdocspace2 2012-06-25 08:59:52.501 Wise[1500:13403] [INFO] Setting up AJAX node data request 2012-06-25 08:59:52.501 Wise[1500:13403] [INFO] Executing AJAX query to http://10.0.1.60:8080/cms/wise/default/en/sites/docspaces/files/docspaces/docspace2.full.json 2012-06-25 08:59:52.542 Wise[1500:13403] [INFO] pageSelector=#viewNode_jnt_folder node=[object Object] 2012-06-25 08:59:52.543 Wise[1500:13403] [INFO] Node /sites/docspaces/files/docspaces/docspace2: 2012-06-25 08:59:52.543 Wise[1500:13403] [INFO] resolvePageName: Found childPageName=#viewNode_jnt_folder 2012-06-25 08:59:52.544 Wise[1500:13403] [INFO] resolvePageName: Found childPageName=#viewNode_docnt_notesContainer 2012-06-25 08:59:52.544 Wise[1500:13403] [INFO] resolvePageName: Found childPageName=#viewNode_jnt_file 2012-06-25 08:59:52.545 Wise[1500:13403] [INFO] showNodeDetails: Setting up click functions... 2012-06-25 08:59:52.545 Wise[1500:13403] [INFO] Calling page init call back jnt_folder_pageInit 2012-06-25 08:59:52.546 Wise[1500:13403] [INFO] Initializing page controls for /sites/docspaces/files/docspaces/docspace2... 2012-06-25 08:59:52.546 Wise[1500:13403] [INFO] showNodeDetails: Now changing page dynamically...options.pageContainer=[object Object] As you can see it seems that the multiview event handler is always called before my own pagebeforechange code, which is the one that actually builds the page. As you have correctly analyzed I do pass an object to the changePage method (the second time), but I haven't had the time to try your suggestions yet, as I am not sure how to integrate them yet. I should mention that I am also using the page parameters the same way they are provided in the example provided by the JQuery Mobile documentation here: http://jquerymobile.com/test/docs/pages/page-dynamic.html |
Hi Serge, I have my deadline in 2hrs. I will check once I'm back home and cought some sleep... I also did a lot of improv over the weekend. I will commit this afternoon. Then you can try again with the latest version, which is running ok on my project site (regular JQM pages with popovers and main/menu with popovers) Regards, Sven
|
Thanks a lot Sven for all your help, and good luck with your deadline ! On my side I will try to see if I can do anything about the ordering of Best regards, On Mon, Jun 25, 2012 at 9:16 AM, Sven Franck <
|
Ok here is the latest from my analysis. Basically I am building URLs for pages that look like this : I was using the "pagebeforechange" event as it was provided in the JQuery example to remove the parameters, prevent the default event, and then perform a call to the "#viewNode_jnt_folder" page dynamically. This seems to be completely incompatible with the current version of multiview, because I cannot seem to be able to put a hook in the proper location to perform this rewrite. I tried using the click, but it seems that a "hashchange" is also being triggered and basically it seems that for each page change both a click and a hashchange are being generated ? The hashchange is also listened to by multiview so I wasn't sure how to get around this. Maybe multiview could add it's own events so that we could plugin such logic ? I didn't try yet with the https://github.com/jblas/jquery-mobile-plugins/tree/master/page-params but I'm not sure how well that works with multiview ? At this point with my dead line I think I will probably have to look for another way of doing layouts that using multiview, I just can't get it to work properly. I think that there definitely needs to be a best practice for building dynamically generated pages with this plugins, because I'm really struggling for the lack of this. Regards, |
Agree on best practice. Currently they are not supported very well I think. Regarding your links: This is what I get:
I can only guess a file ending would be helpful as in 23.html Anyways:
Most of the time working on Multiview goes into trying to identify the correct event and blocking everything else whithout creating infinite loops. I'd say this is about half the plugin code, which I hoped to shrink in size, but which just keeps getting larger... Also I'm having to rely a lot on JQMs data-url, because if you get string in a link like this:
it's not possible to identify an existing page by id only. I can only take one (string preferred), because taking both string and object usually end in infinite loops. Anyway, sorry I can't help right now with your dynamic links. I'm happy I can get basic deeplinks to work, which is hard enough. |
Hello Sven, Unfortunately I couldn't get it to work on time, but I found one of the problem I was having. I was assuming that links that didn't point to another panel did not need the data-panel attribute but it seems that after debugging it was required. I'm not sure if this was due to the dynamic pages, but this helped solve the pageContainer resolution which was causing some problems. After that I had some navigation issues, mostly the back navigation that wasn't working and this is where I ran out of time. Also some of the dynamically inserted components were not being properly being created, despite the fact that I was sending "create" triggers. It seems to me that this is more a global JQM problem than a multiview problem, and that these two libraries are not yet very focus on dynamic pages creationg and insertion, and rely more on server-side generated pages, even if they are loaded through AJAX. Does this assumption seem right ? Anyway I really wanted to thank you for your help, you have been really great about answering my questions quickly despite being on your own dead line. I hope that I can come back to multiview in the near future. In the end I chose to go with the basic JQM Docs layout for both smartphone and tablet layouts, despite being a lot less powerful it was simpler for me to get working. I really think that multiview should become a central part of JQM because it makes no sense to make to have a mobile framework that doesn't handle multiple layouts natively. Best regards, |
Hello Serge, re dynamic pages. I'm currently also trying to stay from them. I load a shell page and then add/remove content via Ajax. Right now more of a time contraint, so I haven't been able to give this more thought in multiview. In general, multiview should be able to handle dynamic pages and even content sections, because I have added the pageContainer to JQM urlHistory. The default JQM urlHistory stores pages without reference to where they are in the document (since default JQM is the body tag). By adding pageContainer to the history, I can tell JQM the page is going on the body (regular JQM page) or on a panel (multiview page). You could to the same with content sections I assume. Regarding the back button. That is the trickiest part, especially since all browser handle it differently and you have little insight into what is stored. Regarding multiview, there were still some bugs which I'm about to fix up, so the next commit should be ok. Of course... there is also the forward button... So your project went ahead well. Give multiview some time to sort things out and JQM some time to find a solution that works cross-browser/device for panel layouts. Cheers, Sven |
Hello,
First of all thanks for the work on multiview, it looks really powerful and actively maintained, which is great. I really believe this functionality should go into the core of JQuery Mobile because it is so essential !
I'm having a real issue. I've started my code using the examples from : http://jquerymobile.com/test/docs/pages/page-dynamic.html before actually integrating with multiview, and all seemed to work fine.
Now I'm trying to get it to work with multiview but whenever I click a link I get a blank page. I've seen that maybe I should specify the pageContainer myself, so I've tried adding that. Right now here is the code I'm using :
Despite specifying the pageContainer (and I checked by debugging that I to get a valid object), whenever I change the page it becomes completely blank, as if the pageContainer was being ignored or something.
I'd appreciate any help, especially since I have to demo this in two days and would love to give multiview a nice plug :)
Regards,
Serge Huber.
The text was updated successfully, but these errors were encountered: