Hi,
What is new for 4.5.1 about web service?
I have a field need to have autocomplete function. That will need to call a web service to provide the promoted choices. I also need to create the web service which get data from a db table.
What the difference there will be between 4.5.1 and 4.4.2 for the above things I need to do
Thanks,
Xiaoli
what is new for web service on 4.5.1
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 272
- Joined: Fri Dec 14, 2012 2:55 pm
- Location: Ottawa
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Xiaoli,
There is a general browser security restriction that stops you calling a web service from your client-side Javascript unless the web service has the same domain as the current session. V4.5 introduces the client API that solves this problem by getting the server to call the web service. So, from your client-side Javascript you call a server-side Javascript function which in turn calls the web service and returns the result to the client.
Regards
Jon
There is a general browser security restriction that stops you calling a web service from your client-side Javascript unless the web service has the same domain as the current session. V4.5 introduces the client API that solves this problem by getting the server to call the web service. So, from your client-side Javascript you call a server-side Javascript function which in turn calls the web service and returns the result to the client.
Regards
Jon
0 x
-
- Ebase User
- Posts: 272
- Joined: Fri Dec 14, 2012 2:55 pm
- Location: Ottawa
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Here is the doc for the client API - this just lets you call the server from the client. You would then need to use a Web Services Resource on the server to call the web service i.e. normal server-side scripting.
http://dev-docs.verj.io/ufs/doc/Working ... nt_api.htm
You would use $eb.executeFunction() to invoke a function.
http://dev-docs.verj.io/ufs/doc/Working ... nt_api.htm
You would use $eb.executeFunction() to invoke a function.
0 x
-
- Ebase User
- Posts: 272
- Joined: Fri Dec 14, 2012 2:55 pm
- Location: Ottawa
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Take a look at this example http://forum.ebasetech.com/forum/viewtopic.php?t=522. It uses a combination of autocomplete and the client api to display a list then sets the values of additional form fields depending on the selection. Is this what you want to do?
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
-
- Ebase User
- Posts: 272
- Joined: Fri Dec 14, 2012 2:55 pm
- Location: Ottawa
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
That's right. You can only use $eb.setFieldValue on fields, and tables are read only via the client api. Instead you have to use $eb.executeFunction() which allows you to do anything. To use this you have to create a Javascript function in a script on the server and and add it to the Client Callable Functions in Form Properties > Events. Then you can call this passing and returning any data you want. If you want to return multiple values, use a Javascript array or object.
0 x
-
- Ebase User
- Posts: 272
- Joined: Fri Dec 14, 2012 2:55 pm
- Location: Ottawa
I can call $eb.executeFunction() to send back values.
However, how can I find the right row of the table in which I can set some of the column?
For example, I add a new row, then in first column, I use auto complete to get the value and also values for another two columns. and send these two values back to server, how sever find the right row to set the two columns?
And also, when I want to change the value of one of the rows in the table. How can the server know which row I am working on on the browser side?
Thank you.
However, how can I find the right row of the table in which I can set some of the column?
For example, I add a new row, then in first column, I use auto complete to get the value and also values for another two columns. and send these two values back to server, how sever find the right row to set the two columns?
And also, when I want to change the value of one of the rows in the table. How can the server know which row I am working on on the browser side?
Thank you.
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
You need a column (or columns) displayed in the table that you can use to uniquely identify the row, then use jquery to get this unique value and pass it to the server. The server can then use findRow() to find the row. See this post http://forum.ebasetech.com/forum/viewtopic.php?t=532.
0 x
-
- Ebase User
- Posts: 1
- Joined: Wed Apr 30, 2014 6:34 pm
- Location: 9 Evans Street
- Contact:
Jon wrote:That's right. You can only use $eb.setFieldValue on fields, and tables are read only via the client api. Instead you have to use $eb.executeFunction() which allows you to do anything. To use this you have to create a Javascript function in a script on the server and and add it to the Client Callable Functions in Form Properties > Events. Then you can call this passing and returning any data you want. If you want to return multiple values, use a Javascript array or object.
hello I'm a new here
How can the server know which row I am working on on the browser side?
0 x
Who is online
Users browsing this forum: No registered users and 5 guests