deveu
Posts: 0
Joined: Tue Apr 08, 2014 4:10 am

Service created 1 page is not working into another

I need to sync data.
I have several page
at login page i created a service and I run this in login page
this is with timer
I enter into into another page and service is not ruining

/*
*pass data to server
*/
function sync_up()
{
prepare_str_send_to_server("member");

}
/*

  • make str store in local and pass it to server
    */
    function prepare_str_send_to_server(table_name)
    {

    dataarr = [];

    db.transaction(function(tx) {
    sql = "SELECT "+table_name+".* FROM "+table_name+" WHERE flag='1'";

    Code: Select all

          tx.executeSql(sql, [],function(tx, results) {  
              if ( results.rows.length0)  
              { 
                 for(var i=0;i< results.rows.length;i++) 
                 { 
                    dataarr[i]= JSON.stringify(results.rows.item(i)); 
                 } 
              } 
              str = JSON.stringify(dataarr); 
    
              localStorage.setItem("local_sync_up",str); 
    
              alert(localStorage.getItem("local_sync_up")); 
    
              restservice_sync_up.execute(); 
             alert(1); 
              update_flag(table_name); 
    
          }); 

});
}

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Service created 1 page is not working into another

Hello!

Could you clarify if restservice_sync_up service isn't invoked? On what page this service is added? You need to invoke service on the same page where it is added.

deveu
Posts: 0
Joined: Tue Apr 08, 2014 4:10 am

Service created 1 page is not working into another

I created at login page and i call a function there with timer
restservice_sync_up.execute();
that will execute every 1 hr

fromn login that is coming immediately another page
and never back to login

i set alert after execute
i can see alert but service is not working

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Service created 1 page is not working into another

Service is not invoked or works in a wrong way? Please check errors in console, try debugging your app http://devcenter.appery.io/documentat...

Add breakpoints ans see what happens.

Return to “Issues”