1. Control element CheckBoxItem

    Article: AN0002374Updated: 10.05.2021

    Control, that inserts a checkbox into the page. Checkbox is used to pick up values YES or NO.

    Properties

    Name Description
    void Focus() Method passes focus to the control.
    string Text Description a the checkbox. If you are using also TitleItem at the same time, do not set this to anything.
    bool AutoPostBack Indication, whether PostBack (request to server) should be initiated after update.
    object GetData() Function returns value Yes/No from the control.
    void SetData(object value) Method sets a value to the control.
    bool GetDataAsBool() Function returns value Yes/No from the control.
    string ID ID of the frame.
    bool Mandatory Indication, whether the value is mandatory.
    bool ReadOnly Indication, whether the control is read-only.
    string Tag Text property for custom use.
    OGItem OGItem Parent OGItem. There is a frame inserted in this OGItem. If NULL is returned, then parent OGItem does not exist.

    Example

    Script adds a title with a checkbox into the page.

    gi = OGForm.CreateOGGroup( 'gicontact', 'Contact data', false, false);
    OGForm.AddControl( gi);

    var r = OGForm.CreateRow();
    var c1 = OGForm.CreateCol(true);
    var ti1 = OGForm.CreateOGTitle('ti1', 'Would you be interested in a quotation?', true);
    var c = OGForm.CreateOGCheckBox( 'chb');

    c1.Controls.Add( OGForm.CreateItem(ti1, c));
    r.Controls.Add(c1);
    gi.Controls.Add(r);

×