Unable to call server side function within HTML entities

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Ian, Dave, jcoulson, Jon, Wai

Segi
Ebase User
Posts: 570
Joined: Mon Dec 09, 2013 6:37 pm

Unable to call server side function within HTML entities

#1

Postby Segi » Thu Feb 07, 2019 5:12 pm

I am having a very strange problem.

I attached a client callable script to my forms' CCF section.

The function is a simple one that only returns a string like this:

function test() {
return "TEST";
}

When I load the page and before I click on anything, if I open the dev console and run $eb.executeFunction("test"), "TEST" is returned.

My form has a table and one of the columns is a hyperlink with an HTML entities that looks like this:

Code: Select all

// Ignore click events if this cell does not contain any text
if ($(this).parent().html().indexOf("Hyperlink") == -1) {
     return false;	
}

debugger;

return false;
If I click on the link while the dev console is open, execution stops on the debugger line as expected. If I run the exact same command $eb.executeFunction("test") while in HTML entities, undefined is returned.

There is no error on the server to indicate that anything went wrong.

This is happening on 2 different instances of Ebase, one on 5.5 and another on 5.4

Edit: I also tested this out in a slightly different way by creating a new project with a new form with a new field that was set up as a hyperlink with debugger in HTML entities. The form was tied to a brand new script that I created with the test function above and this issue is still happening.

Sample project is available for you guys at Verj to try out here: https://ufile.io/5n7c5
0 x

Jon
Moderator
Moderator
Posts: 1243
Joined: Wed Sep 12, 2007 12:49 pm

Re: Unable to call server side function within HTML entities

#2

Postby Jon » Fri Feb 08, 2019 5:17 pm

I'm not too sure what I'm supposed to be looking at here. I imported your form and ran it and it stops at the debugger line and opens my Chrome debugger (I had to add jquery first). Is this what's supposed to happen?
0 x

Segi
Ebase User
Posts: 570
Joined: Mon Dec 09, 2013 6:37 pm

Re: Unable to call server side function within HTML entities

#3

Postby Segi » Fri Feb 08, 2019 5:23 pm

Jon,

Yes thats correct.

When I call $eb.executeFunction("test") while stopped at that debugger break point, the result is ALWAYS undefined. When you load the form but before you click on the link, if you open the dev console and run $eb.executeFunction("test") you get the expected response. I think it has something to do with the context of $eb while debugging
0 x

Jon
Moderator
Moderator
Posts: 1243
Joined: Wed Sep 12, 2007 12:49 pm

Re: Unable to call server side function within HTML entities

#4

Postby Jon » Fri Feb 08, 2019 5:42 pm

Ah I see. Yes I get the same result.
The $eb.executeFunction() does indeed attempt to pick up the local context. It looks like something is missing when it goes into "debugger" mode. I confess I didn't know that you could even do that!
0 x

Segi
Ebase User
Posts: 570
Joined: Mon Dec 09, 2013 6:37 pm

Re: Unable to call server side function within HTML entities

#5

Postby Segi » Wed Feb 13, 2019 7:33 pm

Jon,

Yea its very helpful when you want to test out your server side function in real time; when it works.
0 x


Who is online

Users browsing this forum: Google [Bot] and 0 guests