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

successs of service

str = JSON.stringify(dataarr);
localStorage.setItem('local_sync_up',str);
localStorage.setItem('local_table_name',table_name);
//b_number : localStorage.setItem("b_number");

Code: Select all

              restservice_sync_up.execute(); 

I am running this code with timer.
How may i get service success here

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

successs of service

Hello Deveu,

You can add an event handler success on page restservice_sync_up, or add this feature during the service call, as it is shown here: https://getsatisfaction.com/apperyio/...

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

successs of service

function str_prepare_send_to_server(table_name)
{ str = JSON.stringify(dataarr);
localStorage.setItem('local_sync_up',str);
localStorage.setItem('local_table_name',table_name);
//b_number : localStorage.setItem("b_number");

Code: Select all

              restservice_sync_up.execute({ 
                                  data:{ 
                                             sync_up:str, 
                                             table_name:table_name, 
                                             b_number : b_number 
                                        },  
                            success  : onSuccess 
              }); 

}

function onSuccess()
{
alert(1);
}

at login page i created service and execute the code with timer in main.js
but I need to move immediately another page

why service is not working

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

successs of service

I never get alert
but ajax is ok to sending data but not getting success
$.ajax({
type: "POST",
url: 'http://dev.eu.com.au/rest-api-sync/sy...=?',
data: {
sync_up:str,
table_name:table_name,
b_number : b_number
},
success: function(data) {
alert(1);
//update_flag(table_name,results);
}
});

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

successs of service

restservice_sync_up is created in login page
I want this service into another page
is this possible?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

successs of service

Hi Deveu,

You need know that "restservice_sync_up" is a datasource for certain service.

So you can add some other datasource of this service to other page and call it when you need.

Note: the name of the datasource should be diffrent from the first datasource name.

Regards.

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

successs of service

I need to execute with a Thread/Timer in a function when Page is noving one page to another

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

successs of service

Hi Deveu,

For this goal you can add for each page JS "page show" event handler with following code:

pre

//Adjust delay here. In ms.
var delay = 3000;

var onDelay = function(){
pageDatasource.execute({});
};
window.setTimeout(delay, onDelay);

/pre

See details: http://prntscr.com/4bj72q/direct

Regards.

Return to “Issues”