I’m currently trying to create my own control and add it to AppStudio.
I already
created my own toolbox folder and configured it in AppStudio preferences
made a copy of the original “Toolbox.json” file (and removed unnecessary categories or added my own control category)
set up a trivial control with static (literal) “_htmltemplate” and saved the associated “.json” file in a subfolder of my own toolbox folder
After restarting AppStudio, everything worked as desired.
But now I would like to add my own (JS) code and let “_htmltemplate” invoke a function - and that fails because AppStudio does not find the file I mentioned in “_requiredfiles”!
The actual error message I get in the IDE whenever I try to add my new custom control to a form looks like
with varying paths depending on what I’m currently trying…
PS: everything works fine if I specify the full absolute file path in “_requiredfiles” - but that’s something I would like to avoid and use Toolbox-relative paths instead.
Is there a list of AppStudio variables with some explanation? (e.g., what is the meaning of “_nsbdir”? is it the web apps folder? or that of the toolbox folder(s)?)
Or even better: is there an explanation of how to add one’s own controls?
given a folder X, which has been configured as a “Toolbox Path” in AppStudio “Preferences”, what is the proper way to reference a file Z located in subfolder Y of X such that AppStudio is able to copy that file during the design/build process?
“_requiredfiles”: [ “{_nsbdir}Y/Z” ], or
“_requiredfiles”: [ “{_nsbdir}toolbox/Y/Z” ],
will all fail.
Just to be complete:
the author’s modified version of X/Toolbox.json is found and respected,
additional *.json files in subfolders of X are found and respected
but neither any *.js nor *.css file is.
PS: I’ve been able to use a URL for “_requiredfiles” (referring to a file served by a web server) which shows me that my JS is correct - but now I would like to refer to a local file. How can I achieve that?
…but the AppStudio toolbox also contains (.png, .js, .css) files (some of them in subdirectories) which are “required” by other .json files - how do they get copied to the project? This happens automatically, and I would like to exploit that mechanism for my own custom controls.