Discussion:
Populate form drop down values from script
(too old to reply)
Scott Ellis
2017-01-19 20:01:43 UTC
Permalink
Raw Message
In tdi 7.1.1, is there a way to populate the drop down values of a connector's form field from the results of a javascript call automatically without requiring the user to press a button?
Eddie Hartman
2017-01-20 17:54:48 UTC
Permalink
Raw Message
Post by Scott Ellis
In tdi 7.1.1, is there a way to populate the drop down values of a connector's form field from the results of a javascript call automatically without requiring the user to press a button?
Yessir, and you can load the Connector form with all sorts of Javascript to do things like even redrawing the form as switches are thrown by the user. It's all very internal, but you can learn from examples. Here is a Connector that you can drag into a project to look at: https://ibm.biz/BdsJYB

Use Open With > Forms Editor to see the script loaded into the Connection tab (form). There is both an initial script that is loaded when the Connector is loaded, and then the functions defined to be called from the Form itself (i.e. when items are selected/clicked). As you can see, there's no way to easily test this, apart from copy-pasting the script into an editor to Lint/Syntax check it, and then use the Test Form button to check functionality.

Hope this helps!

-Eddie
Scott Ellis
2017-02-28 22:44:15 UTC
Permalink
Raw Message
Post by Eddie Hartman
Post by Scott Ellis
In tdi 7.1.1, is there a way to populate the drop down values of a connector's form field from the results of a javascript call automatically without requiring the user to press a button?
Yessir, and you can load the Connector form with all sorts of Javascript to do things like even redrawing the form as switches are thrown by the user. It's all very internal, but you can learn from examples. Here is a Connector that you can drag into a project to look at: https://ibm.biz/BdsJYB
Use Open With > Forms Editor to see the script loaded into the Connection tab (form). There is both an initial script that is loaded when the Connector is loaded, and then the functions defined to be called from the Form itself (i.e. when items are selected/clicked). As you can see, there's no way to easily test this, apart from copy-pasting the script into an editor to Lint/Syntax check it, and then use the Test Form button to check functionality.
Hope this helps!
-Eddie
Scott Ellis
2017-02-28 22:46:17 UTC
Permalink
Raw Message
Post by Eddie Hartman
Post by Scott Ellis
In tdi 7.1.1, is there a way to populate the drop down values of a connector's form field from the results of a javascript call automatically without requiring the user to press a button?
Yessir, and you can load the Connector form with all sorts of Javascript to do things like even redrawing the form as switches are thrown by the user. It's all very internal, but you can learn from examples. Here is a Connector that you can drag into a project to look at: https://ibm.biz/BdsJYB
Use Open With > Forms Editor to see the script loaded into the Connection tab (form). There is both an initial script that is loaded when the Connector is loaded, and then the functions defined to be called from the Form itself (i.e. when items are selected/clicked). As you can see, there's no way to easily test this, apart from copy-pasting the script into an editor to Lint/Syntax check it, and then use the Test Form button to check functionality.
Hope this helps!
-Eddie
Hi Eddie, thanks for the reply. I only just saw this and didn't realize that it was here. This is really good news and I'll take a look at this sample to see if I can make a go of it. My forms could stand to be smarter and this would be a big help.

Thanks,

Scott
Scott Ellis
2017-03-02 21:20:05 UTC
Permalink
Raw Message
Post by Eddie Hartman
Post by Scott Ellis
In tdi 7.1.1, is there a way to populate the drop down values of a connector's form field from the results of a javascript call automatically without requiring the user to press a button?
Yessir, and you can load the Connector form with all sorts of Javascript to do things like even redrawing the form as switches are thrown by the user. It's all very internal, but you can learn from examples. Here is a Connector that you can drag into a project to look at: https://ibm.biz/BdsJYB
Use Open With > Forms Editor to see the script loaded into the Connection tab (form). There is both an initial script that is loaded when the Connector is loaded, and then the functions defined to be called from the Form itself (i.e. when items are selected/clicked). As you can see, there's no way to easily test this, apart from copy-pasting the script into an editor to Lint/Syntax check it, and then use the Test Form button to check functionality.
Hope this helps!
-Eddie
So I'm looking at your code but I'm not seeing any logic that can initiate the population of a drop down unless the user selects the button next to in on the form. You have three drop downs as I see it, provider, dataset and datasource. What I'd like to do is have some event handler trigger when the form is loaded during configuration time. I don't even mind if I have to trick it into working by simulating that the button was clicked, but I need a hook in the form init or events script that gives me that opportunity, very much like an onload handler in a web page.
Eddie Hartman
2017-03-03 19:32:33 UTC
Permalink
Raw Message
Post by Scott Ellis
Post by Eddie Hartman
Post by Scott Ellis
In tdi 7.1.1, is there a way to populate the drop down values of a connector's form field from the results of a javascript call automatically without requiring the user to press a button?
Yessir, and you can load the Connector form with all sorts of Javascript to do things like even redrawing the form as switches are thrown by the user. It's all very internal, but you can learn from examples. Here is a Connector that you can drag into a project to look at: https://ibm.biz/BdsJYB
Use Open With > Forms Editor to see the script loaded into the Connection tab (form). There is both an initial script that is loaded when the Connector is loaded, and then the functions defined to be called from the Form itself (i.e. when items are selected/clicked). As you can see, there's no way to easily test this, apart from copy-pasting the script into an editor to Lint/Syntax check it, and then use the Test Form button to check functionality.
Hope this helps!
-Eddie
So I'm looking at your code but I'm not seeing any logic that can initiate the population of a drop down unless the user selects the button next to in on the form. You have three drop downs as I see it, provider, dataset and datasource. What I'd like to do is have some event handler trigger when the form is loaded during configuration time. I don't even mind if I have to trick it into working by simulating that the button was clicked, but I need a hook in the form init or events script that gives me that opportunity, very much like an onload handler in a web page.
That's all stuff for the topmost of the script spots: Init Script. This gets run at load time, so here you can do your initial populating.
Loading...