How to create template page in Webview
What is the best way to create a template page that I can use to create new pages with the same properties?
You could add a page-level script that contains some definitions, like:
SET("DataDomain", "machine1");
SET("NoxPoint", "Nox");
etc.
Then in the controls, bind the points like:
=VAL("DataDomain") + ":" + VAL("NoxPoint") + GETP("GeneratorLabel3@Value")
which would produce a point name like "machine1:Nox103".
If you need to create a new page for machine2, you just need to change the SET("DataDomain", "machine1") to "machine2" in the page script.
This method has a few advantages:
- The point names are recomputed at runtime. This would allow you to select the machine number in a combo box or entry field and all of the point bindings would automatically update
- You could potentially get away without copying the page at all. The settings for "DataDomain", "NoxPoint", etc. could be read from an XML document or passed as arguments to the page URL.