NimbleKit - fast iOS app development

onPageShown(caller) not working on 3G 3GS

Please post here if you think only NimbleKit developers can solve your problem

onPageShown(caller) not working on 3G 3GS

Postby sash1024 » Tue May 15, 2012 11:20 am

hi there the function onPageShown(caller) doesn't work on 3G and 3GS so don't use it if you plan to distribute for older devices.
On iPhone 4 it works, but does not behave as told in the documentation after page is fully loaded. Use onLoad in the body tag instead or NKExecuteJavascriptOnPage
Last edited by sash1024 on Wed May 16, 2012 8:35 pm, edited 1 time in total.
sash1024
 
Posts: 23
Joined: Sat Jan 21, 2012 12:58 pm

Re: onPageShown(caller) not working on 3G 3GS

Postby ryubr » Tue May 15, 2012 4:39 pm

I have a 3GS for testing here and it works just fine , never had a problem with this. Did you have any chance to try this on other devices? :-)
ryubr
NimbleKit Expert
 
Posts: 445
Joined: Fri Jun 19, 2009 5:36 am

Re: onPageShown(caller) not working on 3G 3GS

Postby sash1024 » Wed May 16, 2012 9:03 pm

hmm... ok, this is the case, I paste some of the code:

I have a page with a table made after SQLite query, so when I delete or modify one of the records (in the modify page) I have to refresh the table when I go back to it...

refreshTable () executes the SQLite query and show up the records in a NKtableView

so...

Code: Select all
function onPageShown(caller) {
            
            if (settings.getValueForKey("refresh")==1){
               
               sectionName = settings.getValueForKey("categoryName");
               
               refreshTable ();
               
            }
            
            
   }


on iPhone 4, all iPads it works, no issues

on iPhone 3G and 3GS does not work, the App just show up a white blank page, the issue is the onPageShown function, detected by a step by step NKLog output, so I removed the onPageShown and now I call the preRefreshTable function with NKExecuteJavascriptOnPage from the modify page before going back to the page with the table

Code: Select all
function preRefreshTable () {
            
            if (settings.getValueForKey("refresh")==1){
               
               sectionName = settings.getValueForKey("categoryName");
               
               refreshTable ();
               
            }
            
   }


basically the same thing, just not executed with onPageShown(caller)

then, another problem with onPageShown(caller) is when you have divisions <div> in the html and you have functions generating html code. Won't work. You have to use the onLoad in the body.

looks like onPageShown(caller) is not executed really at last when everything is loaded.
sash1024
 
Posts: 23
Joined: Sat Jan 21, 2012 12:58 pm

Re: onPageShown(caller) not working on 3G 3GS

Postby ryubr » Thu May 17, 2012 8:48 pm

Well to me none of this happens :-/ My apps use onPageShown all the time to update content on the page, divs with innerHTML and so on. in the past I had problems regarding memory usage of the app since the3G and 3GS have less memory and processing power so heavy load would kill the app.

It all depends on how the code is, the features you need to reload etc but to me it works :-)
ryubr
NimbleKit Expert
 
Posts: 445
Joined: Fri Jun 19, 2009 5:36 am

Re: onPageShown(caller) not working on 3G 3GS

Postby sash1024 » Mon May 21, 2012 8:10 pm

hmm, maybe I have an idea about it.

I am working on a new app, and I got a 3G iPhone to try physically on it, and the function works when the things are simple so the processor is not heavy loaded.

Thing is... that the function triggers 3 times if you don't specify the caller.

Loading a 95 records table (to refresh the page when coming back from the record detail page) is slow, doing that 3 times at the same time KILLS the app with slower devices.
sash1024
 
Posts: 23
Joined: Sat Jan 21, 2012 12:58 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest