Page 1 of 1

REST Service Error

Posted: Wed Aug 14, 2013 5:34 pm
by Chem Swift

I get "Uncaught ReferenceError: Rest web service not defined error." How can I resolve this issue?


REST Service Error

Posted: Wed Aug 14, 2013 7:24 pm
by Kateryna Grynko

Hi Chem,

Is there a Rest service in your app? Are there any other errors in console?
Could you give us a public link to a page with error?


REST Service Error

Posted: Wed Aug 14, 2013 7:32 pm
by Chem Swift

Hi Katya,

My issues are as follows:

  1. When I configured the web service and tested it, it worked correctly. I used the "Automatically Generate Service Response" tool to generate the response. In my page I clicked on the "data" tab and added the service and mapped it correctly. When I call the service on page load i get the Uncaught Reference error I mentioned.

  2. Every time I configure a service to load when the page is loaded and I save and refresh the page or I go back to the project list I lose all of the configurations I setup during page load. On page load I set it to execute a Javascript function call which then execute the web service calls.

    I like Appery but its frustrating having to configure web service calls multiple times per day. I've created versions for my project and in some versions some calls work while other versions they don't work. Any help would be greatly appreciated.


REST Service Error

Posted: Wed Aug 14, 2013 8:09 pm
by Kateryna Grynko

Chem,

Without seeing the code it's difficult to suggest something.

Do you have a JS-code that you wrote in your app? If there is a syntax error, it can provoke a situation where the service object isn't created before call it.

Not sure I understand what kind of service configuration you mean. Can't you save event handler where the service call? You click the "Add event" button?


REST Service Error

Posted: Thu Aug 15, 2013 5:27 pm
by Chem Swift

Here is a problem I'm having. I've defined the web service but when I try to call it on load nothing happens. Here is a public URL http://appery.io/app/mobile-frame?src.... Screenshots are below. Can you help please?

Image Image


REST Service Error

Posted: Thu Aug 15, 2013 6:16 pm
by Kateryna Grynko

Hi Chem,

We can't log in without credentials.
Try using Page Show event instead of Page Load.


REST Service Error

Posted: Thu Aug 15, 2013 8:13 pm
by Chem Swift

I moved the web service calls from the "Events" tab in the UI designer to the "onLoad" method in the page's javascript file. How do I enable the "Page Show" event from Javascript?


REST Service Error

Posted: Thu Aug 15, 2013 8:49 pm
by Kateryna Grynko

Chem,

You don't need to edit page source code. You had to delete old event handler and create a new one.

Now if you edited file on Source tab you'd better delete it and call Undo in the folder properties. Otherwise the further actions in editor won't change the file.


REST Service Error

Posted: Thu Aug 15, 2013 9:05 pm
by Chem Swift

So basically I can't make any changes to the Javascript files Appery creates for me? For example "MyPage.js"? I can only make changes to the Javascript files I create? Also, when I create an event in the "Event" tab for example "Invoking a service", when I close the project and open a new project, then return to the previous project the events I defined are no longer in the "Events" tab. However, if I look at the Javascript file for the page for example "Mypage.js" I can see the service being called in the "onLoad" function. Is there a way to not have the services I defined in the "Events" tab not disappear?


REST Service Error

Posted: Fri Aug 16, 2013 4:02 am
by maxkatz

You can make changes however, once you start editing the source directly, the visual part will no longer be updated. The issue is, you can write any JavaScript but it's impossible for us to know what to render/display.