CodeCharge Studio All ASP PHP Java C#.NET VB.NET Perl ColdFusion

Referencing Objects

The objects in the Web applications generated by CodeCharge Studio can be referenced in a variety of ways. In many cases, to work with a specific object within a program you will need to know  its position within the program hierarchy. For example, an object that is placed directly on the page may need to be addressed differently compared to an object placed within a form (which is also an object).

ASP

Examples of working with objects Syntax
Form object placed in a page <form>.Visible = False
Control object placed within a form <form>.<control>.Value = "123"
Control object placed in a page <control>.Value = "ABC"
Control object placed in an  included page  <page>.<control>.Visible = False
Form object placed in an included page <page>.<form>.Visible = False
Control object placed in a form within an  included page  <page>.<form>.<control>.Visible = False 
Assigning an object to a variable Set <variable> = <object>
Generic addressing of the current object EventCaller.Value = "123"

Note: When using ASP/VBScript you can refer to objects in a generic way as "EventCaller". This may be beneficial for example when renaming objects, since the object's name would not be used in the code.

PHP

Examples of working with objects Syntax
Form object placed in a page $<form>->Visible = false;
Control object placed within a form $<form>-><control>->SetValue("123");
Control object placed in a page $<control>->SetValue("ABC");
Control object placed in an included page $<page>-><control>->Visible = false;
Form object placed in an included page $<page>-><form>->Visible = false;
Control object placed in a form within an  included page  $<page>-><form>-><control>->Visible = false;
Assigning an object to a variable $<variable> = $<object>;

Perl

Examples of working with objects Syntax
Form object placed in a page $<form>->{Visible} = 0;
Control object placed within a form $<form>->{<control>}->SetValue("123");
Control object placed in a page $<control>->SetValue("ABC");
Control object placed in an included page $<page>->{<control>}->{Visible} = 0;
Form object placed in an included page $<page>->{<form>}->{Visible} = 0;
Control object placed in a form within an included page  $<page>->{<form>}->{<control>}->{Visible} = 0;
Assigning an object to a variable $<variable> = $<object>;

Java

Examples of working with objects Syntax
Form object placed in a page Page's Events e.getPage().getComponent("<form>").setVisible(false);
Form's Events e.getComponent().setVisible(false);
Control object placed within a form Page's Events e.getPage().getComponent("<form>").getControl("<control>").setValue("123");
Form's Events e.getComponent().getControl("<control>").setValue("123");
Control's Events e.getControl().setValue("123");
Control object placed in a page Page's Events e.getPage().getControl("<control>").setValue("ABC");
Control's Events e.getControl().setValue("ABC");
Assigning an object to a variable <variable> = <object>;

Note: The syntax for accessing objects in an included page from events within the same included page is the same as specified above. The syntax for accessing objects in an included page from events within the including page is not supported. The syntax for accessing objects in the including page from events within the included page is also not supported.

C#

Examples of working with objects Syntax
Form object placed in a page Grid and Editable Grid Events <form>Repeater.Visible = false;
Record Events <form>Holder.Visible = false;
Directory and Path Events <form>.Visible = false;
Control object placed within a Record form <form><control>.Visible = false;
Control object placed within a Grid, Editable Grid, Directory and Path form Control's Before Show Event <form><control>.Visible = false;
Form's Before Show and Before Show Row Event Object reference should be retrieved from the FormControls collection.
See the ItemDataBound Event MSDN example.
Control object placed in a page <control>.Visible = false;
Assigning an object to a variable <variable> = <object>;

Note: The syntax for accessing objects in an included page from events within the same included page is the same as specified above. The syntax for accessing objects in an included page from events within the including page is not supported. The syntax for accessing objects in the including page from events within the included page is also not supported.

VB.Net

Examples of working with objects Syntax
Form object placed in a page Grid and Editable Grid Events <form>Repeater.Visible = False
Record Events <form>Holder.Visible = False
Directory and Path Events <form>.Visible = False
Control object placed within a Record form <form><control>.Visible = False
Control object placed within a Grid, Editable Grid, Directory and Path form Control's Before Show Event <form><control>.Visible = False
Form's Before Show and Before Show Row Event Object reference should be retrieved from the FormControls collection.
See the ItemDataBound Event MSDN example.
Control object placed in a page <control>.Visible = False
Assigning an object to a variable <variable> = <object>

Note: The syntax for accessing objects in an included page from events within the same included page is the same as specified above. The syntax for accessing objects in an included page from events within the including page is not supported. The syntax for accessing objects in the including page from events within the included page is also not supported.

ColdFusion

Examples of working with objects Syntax
Form variable placed in a page or a form <CFSET blnReadAllowed<form>=false>
Control variable placed within a form or a page <CFSET fld<control> = "abc">

Note: The syntax for accessing objects in an included page from events within the same included page is the same as specified above.


On-line, printable versions and updates