Passing in Lists/variables from a function to a web page

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
ReiGuy
Posts: 2
Joined: Tue Jul 23, 2019 1:06 am

Passing in Lists/variables from a function to a web page

Post by ReiGuy »

Recently I was able to create a line chart within Lansa with the help of Chartjs. I have a widget, a reusable part, and a web page that accomplishes this.

I created the widget/reusable part so the calls to various methods that create the chart mainly have lists as parameters. Now that I have the chart created (and building the various lists on the web page itself) I need to call the function that creates the real data for my chart. I tried just passing in this function on the reusable part and on the web page but I get errors. Specifically: "The CALL command is not supported on the Web." Then, I tried adding the Reusable Part to a standard form and got the error of: "testChartjsInterface is only supported on the Web."
I did some digging around and looked into Server Modules but I don't know if this is the best route to take (and there weren't a whole lot of resources on them).

In short, I am looking for a way to pass in lists generated by a function to a web page. And then from there, those lists create a graph.
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Passing in Lists/variables from a function to a web page

Post by atostaine »

Your reusable part should call a server function to get the data.
Art Tostaine
ReiGuy
Posts: 2
Joined: Tue Jul 23, 2019 1:06 am

Re: Passing in Lists/variables from a function to a web page

Post by ReiGuy »

A function or Srvroutine? Using the Use Builtin(CALL_SERVER_FUNCTION ... gives the error of "The USE command is not supported on the web."
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Passing in Lists/variables from a function to a web page

Post by atostaine »

srvroutine.
Art Tostaine
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: Passing in Lists/variables from a function to a web page

Post by MarkD »

This example shows some simple client side code calling a server module to get a list back:

https://docs.lansa.com/14/en/lansa017/i ... 1_0500.htm

https://docs.lansa.com/14/en/lansa017/i ... 1_0505.htm
Post Reply