In this chapter, the interrelationship of Forms is described with more concrete schematics.
Notation
It describes the notation used when the interrelationship of Frame.
Box
It is an item on collection but doesn’t mean the real name. |
Connection Line
1:1 connection and the diamond side is Child. | |
1:N connection and the round side is Child. |
Description
The Script syntax between Items is marked on the connection line.
The Script to Child at Parents is marked without Prefix.
The Script to Parents at Child uses"▲" Prefix.
The above marks mean as follows:
The relationship between parents and child is 1:N.
On the Script, child is accessible with"parents.id".
On the Script, child is accessible with parents.child [index].
On the Script, parents are accessible with child.parent.
Definition of Terms
term | description |
---|---|
element | The property, method, event of component is collectively called as the element of component. |
Syntax Used Commonly
Display mark, [", "]"can be replaced with"(", ")".
Or this.all[0] and this.all(0) are the same.
Inside of "[", "]"and "(", ")", index or "id" can come.
Or both of this.all[0] and this.all["btn0"] can indicate the same component.
Form
Relationship Schematic
For the General Form
For container component
Example Screen for Script
The order of index is assumed as btn0, btn1, cmb0, dtset1, bind1, div0, div1.
In a form on the same level, id cannot be duplicated. In other words, since btn0 and div0_btn0 and div2_btn are not the same levels, they may be designated to the same id
Script approach to component / invisible object / bind
this.classname == "frm0" this.name == "frm0"
Approach to btn0
this.all["btn0"].name == "btn0" this.all[0].name == "btn0" this.btn0.name == "btn0" this.components[0].name == "btn0" this.components["btn0"].name == "btn0"
Approach to dtset1
this.all["dtset1"].name == "dtset1" this.all[3].name == "dtset1" this.dtset1.name == "dtset1" this.objects[0].name == "dtset1" this.objects["dtset1"].name == "dtset1"
Number of component / invisible object / bind
this.all.length == 7 this.components.length == 5 //btn0, btn1, comb0, div0, div1 this.binds.length == 1
Script approach tocontainer component
The container component without connection to form can’t have invisible object / bind but only have component.
Approach to div0_btn0 inside div0
this.div0. btn0.name== "div0_btn0" this.div0.all[0]. name == "div0_btn0" this.components[3].components[0]. name == "div0_btn0"
Approach to div2_btn0 inside div2
this.div0.div2.div2_btn0.name == "div2_btn0" this.all["div0"].all["div2"].all["div2_btn0"].name == "div2_btn0" this.components["div0"].components["div2"].components["div2_btn0"].name == "div2_btn0"
Script approach to container component which connects form
Approach to dtset1 in frm1 (in case of approaching the script in frm1)
this.name== "div1" // as this value is the id of the container component which connects form, it is changeable. this.btn0.name== this.all["btn0"].name == "btn0"
Approach to dtset1 in frm1 (in case of approaching to the script in frm0)
this.name == "frm0" this.div1.btn0.name == "btn0" //It is approachable only with "divl" which absorbs"frm1".
Script use for parent
this.div1.dtset2.parent.parent.classname == "frm0" this.div1.dtset2.parent.name == "div1"// As frm1 is connected to div1, it becomes to lose its characteristics. this.div1.dtset2.parent.classname == undefined// As frm1 is connected to div1, it becomes to lose its characteristics and the classname doesn’t exist. this.div1.dtset2.parent.name == "div1"
Use of the element of container component
The container component which connects form can have components, invisible object, bind (sub-element) like form.
The container component which doesn’t connect form can’t have invisible object nor bind but can have only component.
The component, invisible object and bind which do not have the function of container can’t have element.
The container component has the characteristics of the connected form.
When this is approached at form script, approach not only to the element in the connected form but also to the element of the container component is available.
When this.component_name is approached at the form where container component is involved, the approach to all the elements of the connected form is available.
Application for the Single Frame Form
Relationship Schematic
The component / bind / invisible object in the form doesn’t have either .getOwnerFrame() or .getOwnerForm().
Example Screen for Script
In case of single Frame, MainFrame can have only one between ChildFrame and TabFrame.
Form Approach to Script at Application
Approach to frm0 (in case of ChildFrame)
application.mainframe.frame.form.name =="frm0" application.mframe0.frame.form.name == "frm0" application.mframe0.chdframe0.form.name == "frm0" application.all[0].all[0].form.name == "frm0" application.all["mframe0"].all["chdframe0"].form.name == "frm0" mainframe.frame.form.name == "frm0"
Approach to frm1 (in case of TabFrame)
application.mainframe.frame.tabframepages[0].form.name == "frm1" application.mainframe.frame.tabframepages["tabframeP0"].form.name == "frm1" application.all[0].all[0].all[0].form.name == "frm1" application.all["mframe0"].all["tabframe0"].all["tabframeP0"].form.name == "frm1"
Application Approach to Script at Form
approach to application at frm0 (in case of ChildFrame)
this.parent.name == "chdframe0" this.parent.parent.name == "mframe0" this.getOwnerFrame().getOwnerFrame().name == "mframe0" this.getOwnerFrame().getOwnerFrame().parent.mainframe.name == "mframe0"
approach to mainframe at frm1 (in case of TabFrame)
this.parent.name == "tabframeP0" this.parent.parent.name == "tabframe0" this.parent.parent.parent.name == "mframe0" this.getOwnerFrame().getOwnerFrame().getOwnerFrame().name == "mframe0"
Application for the Multi Frame Form
Relationship Schematic
Example Screen for Script
Each of FrameSet in frameset_n can have the structure of"frameset0".
It approaches with the same method as that of single frame except frames[].
Form approach to script at application
application.mainframe.frame == application.mainframe.frameset0
Approach to frm1
application.mainframe.frame.chdframe0.form.name== "frm1" // application.mainframe.frame.frames[0].form.name == "frm1" application.mainframe.frame.frames["chdframe0"].form.name == "frm1"
Approach to frm2
application.mainframe.frame.frames[1].tabframepages[0].form.name == "frm1"
Forms of Modal and Modaless Form
Relationship Schematic
Method to use Script at nested ChildFrame
The way to generate and to erase nested ChildFrame
// ********** Generate ChildFrame.*************** var frameobj = new ChildFrame("childfrm0", 10, 10, 100, 100, "url"); or var frameobj = new ChildFrame("childframe"); frameobj.init ("childframe", 10, 10, 100, 100); // ********** Connect ChildFrame to Frameset. ********** mainframe.frameset.addChild("chd0", frameobj); or frameset.inertChild(1, "chd0", frameobj); // ********** Show ChildFrame on the screen. ********** frameobj.show(); // ********** Show ChildFrame on the screen. ********** mainframe.frameset.removeChild("chd0"); frameobj.destroy(); frameobj = null;
Script flow
Method to use Script at modal/modaless ChildFrame
The method to generate modal / modaless ChildFrame
var frameobj = new ChildFrame("childfrm0", 10, 10, 100, 100, "url"); or var frameobj = new ChildFrame("childframe"); frameobj.init ("childframe", 10, 10, 100, 100); var parentframeobj = mainframe.frameset.ChildFrame0; frameobj.showModal(parentframeobj); or frameobj.showModeless(parentframeobj);
Script flow