ObjectGears Help

Forum   ObjectGears (Version:

Example of form creation

The script will create two groups and adds couple of controls (text, checkbox) to them. In the end breadcrumb navigation is created.

/* creating text on the page */
OGForm.AddControl( OGForm.CreateLiteralControl("Example of a free text."));

var gi = OGForm.CreateOGGroup( 'gi1', 'First group', true, false);
OGForm.AddControl( gi);

var ti1 = OGForm.CreateOGTitle('ti1', 'Code', true, 'Enter the code.');
var t1 = OGForm.CreateOGText( 't1', true, 'codes');
var ti2 = OGForm.CreateOGTitle('ti2', 'Name', false, null);
var t2 = OGForm.CreateOGText( 't2', false, null);

var tr = OGForm.CreateOGTrItem( 'tr1', ti1, t1, ti2, t2);
gi.Controls.Add( tr);

var gi2 = OGForm.CreateOGGroup( 'gi2', 'Settings');
OGForm.AddControl( gi2);

var ti3 = OGForm.CreateOGTitle('ti3', 'Receive', false, null);
var chb1 = OGForm.CreateOGCheckBox( 'chb1');
var tr2 = OGForm.CreateOGTrItem( 'tr2', ti3, chb1, null, null);
gi2.Controls.Add( tr2);

var ti4 = OGForm.CreateOGTitle('ti4', 'Give', false, null);
var chb2 = OGForm.CreateOGCheckBox( 'chb2', true);
var tr3 = OGForm.CreateOGTrItem( 'tr3', null, null, ti4, chb2);
gi2.Controls.Add( tr3);

OGForm.SetLinkNavigation( 'hi|First.aspx>second|end.aspx');

This website is using cookies files to provide services and analyse visits. You agree with that by using this website.     Further information