Page 1 of 1

Custom component unable to invoke database service

Posted: Fri Feb 21, 2014 8:17 am
by ang .

I have a custom component, with a panel containing 3 buttons.
On button click, I would like to invoke database service which will query database.
But when I click it, the browser console gives me the error "nameofservice is not undefined"

Is there restriction that custom component cannot invoke service?


Custom component unable to invoke database service

Posted: Fri Feb 21, 2014 10:13 am
by Kateryna Grynko

Hi,

This should work. Please check other actions, for example run JS:prealert("test event");/pre


Custom component unable to invoke database service

Posted: Fri Feb 21, 2014 10:17 am
by ang .

Hi,

run javascript is running fine.
only fail on invoke database service.

I found that the service is not defined as other database service
code
/*
* Nonvisual components
*/
var datasources = [];

Code: Select all

 getGames = new Appery.DataSource(WarehouseDB_GameList_list_service, { 
     'onComplete': function(jqXHR, textStatus) { 

         $t.refreshScreenFormElements("Home"); 
     }, 
     'onSuccess': function(data) {}, 
     'onError': function(jqXHR, textStatus, errorThrown) {}, 
     'responseMapping': [{ 
         'PATH': ['$'], 
         'ID': 'listitem_games', 
         'SET': [{ 

etc etc....
/code


Custom component unable to invoke database service

Posted: Fri Feb 21, 2014 10:18 am
by ang .

Hi,

Anyway, I have workaround by defining the service myself, inspired by your thread here: https://getsatisfaction.com/apperyio/...

You may close this issue now.


Custom component unable to invoke database service

Posted: Fri Feb 21, 2014 10:21 am
by Kateryna Grynko

Thank you for the update!