Jose Gandia Ferrero
Posts: 0
Joined: Tue Dec 10, 2013 11:48 pm

Call a Service Database

I have a problem with this JavaScript in a Event Component Click.

code
var user = Appery('campuser').val();
var pass = Appery('camppass').val();

Usuarios_Usuarios_list_service.execute({
where:{"pass":user,"user":pass},
success:function(data){
alert("Logueado" + data.length);
Apperyio.navigateTo("Enviar_Notificacions");
},
error:function(jqXHR, textStatus, errorThrown){
alert("error!!!");
}
});
/code

The service works correctly (as you can see in the picture), but I have no response to the event: success

Image

I've tried changing the parameters of the service call:
where:{"pass":user,"user":pass},
where:'{"pass":user,"user":pass}',
data: {where:{"pass":user,"user":pass}},

Help me please!

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Call a Service Database

Hi Jose,

See the following example please:
https://getsatisfaction.com/apperyio/...

Jose Gandia Ferrero
Posts: 0
Joined: Tue Dec 10, 2013 11:48 pm

Call a Service Database

Hi Katya,

the same problem with

{data:{where:'{"pass":"jose","user":"jose"}'},

code
Usuarios_Usuarios_list_service.execute(
{data:{where:'{"pass":"jose"}'},
success:function(data, textStatus, jqXHR){
//alert("Logueado" + data.length);
Apperyio.navigateTo("Enviar_Notificacions");
},
error:function(jqXHR, textStatus, errorThrown){
alert("error!!!");
}
});
/code

Jose Gandia Ferrero
Posts: 0
Joined: Tue Dec 10, 2013 11:48 pm

Call a Service Database

I can not find the problem, but the error in Firefox's console is:

TypeError: consulta_user.execute is not a function

anyone have any idea?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Call a Service Database

Hi Jose,

Please pay attention to quotation mark (as specified by the reference), you should pass strings, rather than objects.

Return to “Issues”