1. Script object OGForm

    Article: AN0001974Updated: 25.01.2021

    This object is used for work with page controls. You can add controls into the page (e.g. buttons or text fields), set BreadCrumb Navigation or add buttons to the toolbar by means of functions stated below.

    You can also add also your own controls or use standard ASP.NET controls and create a form / html according to your needs.

    Script functions 

    Name Description
    Page Page ASP.NET object Page.
    void AddControl(Control control) Function adds a new control into the form.
    void ClearControl() Function deletes all previously added controls.
    Control GetControl(string id) Function returns control by the input ID.
    bool ExistControl(string id) Function determines, whether there is control of the input ID in the form.
    OGRow CreateRow() Function returns object for a row in the form.
    OGCol CreateCol(bool oneColumn) Function returns object for a column in the form.
    OGItem CreateItem(TitleItem title, Control control) Function returns object for a single control in the form. The object is immediately filled with a title and own contril for display.
    void SetLinkNavigation(string navigations) Set up of the Breadcrumb Navigation.
    void SetInfo(string message) Set up of the Info message.
    void SetError( string message) Set up of the Error message.
    void SetSuccess(string message) Set up of the Success message.
    void SetNextRequestInfo(string message) Setting of Info message. The message is displayed in the next web request.
    void SetNextRequestSuccess(string message) Setting of Success message. The message is displayed in the next web request.
    void SetNextRequestError(string message) Setting of Error message. The message is displayed in the next web request.
    void SetNextRequestInfoList(StringCollection messages) Setting of list of Info messages. The messages are displayed in the next web request.
    void SetNextRequestSuccessList(StringCollection messages) Setting of list of Success messages. The messages are displayed in the next web request.
    JSFormStyle Style Object for work with styles.
    JSFormToolbar Toolbar Object for work with toolbar.
    JSFormJavaScript JavaScript Object for work with JavaScript.
    LiteralControl CreateLiteralControl( string id, string text) Function creates the control LiteralControl.
    Label CreateLabel(string id, string text) Function creates the control Label.
    Panel CreatePanel(string id, string groupText) Function creates the control Panel.
    TitleItem CreateOGTitle(string id, string title, bool mandatory, string helpText) Function creates the control TitleItem.
    GroupItem CreateOGGroup(string id, string title) Function creates the control GroupItem.
    GroupItem CreateOGGroup(string id, string title, bool enableCollapse, bool defaultCollapse) Function creates the control GroupItem.
    TextItem CreateOGText(string id, bool mandatory) Function creates the control TextItem.
    TextItem CreateOGText(string id, bool mandatory, string text) Function creates the control TextItem.
    TextItem CreateOGText(string id, bool mandatory, string text, int? rows, int? maxLength) Function creates the control TextItem.
    CheckboxItem CreateOGCheckBox(string id) Function creates the control CheckboxItem.
    CheckboxItem CreateOGCheckBox(string id, bool? check) Function creates the control CheckboxItem.
    ColorItem CreateOGColor(string id, bool showHexa, bool showRGB) Function creates the control ColorItem.
    ColorItem CreateOGColor(string id, bool showHexa, bool showRGB, int? color) Function creates the control ColorItem.
    DateTimeItem CreateOGDateTime(string id, DateTimeType dateTimeType) Function creates the control DateTimeItem.
    DateTimeItem CreateOGDateTime(string id, DateTimeType dateTimeType, DateTime? date) Function creates the control DateTimeItem.
    DoubleItem CreateOGDouble(string id) Function creates the control DoubleItem.
    DoubleItem CreateOGDouble(string id, double? value) Function creates the control DoubleItem.
    DropDownItem CreateOGDropDown(string id) Function creates the control DrowDownItem.
    FileItem CreateOGFile(string id) Function creates the control FileItem.
    GuidItem CreateOGGuid(string id) Function creates the control GuidItem.
    GuidItem CreateOGGuid(string id, Guid? guid) Function creates the control GuidItem.
    HtmlTextItem CreateOGHtmlText(string id, int rows, string text) Function creates the control HtmlTextItem.
    IntegerItem CreateOGInteger(string id) Function creates the control IntegerItem.
    IntegerItem CreateOGInteger(string id, int? value) Function creates the control IntegerItem.
    LabelItem CreateOGLabel(string id, string text) Function creates the control LabelItem.
    RadioButtonItem CreateOGRadioButton(string id) Function creates the control RadioButtonItem.
    RadioButtonItem CreateOGRadioButton(string id, bool? check) Function creates the control RadioButtonItem.
    ServerImageItem CreateOGServerImage(string id, string imageUrl) Function creates the control ServerImageItem.
    UserItem CreateOGUserSingle(string id, PersonInfo pi) Function creates the control UserItem.
    UserItem CreateOGUserMulti(string id, int rows, PersonInfoList piList) Function creates the control UserItem.
    YesNoDropDownItem CreateOGYesNoDropDown(string id) Function creates the control YesNoDropDownItem.
    YesNoDropDownItem CreateOGYesNoDropDown(string id, bool? check) Function creates the control YesNoDropDownItem.
    TabControl CreateOGTabControl(string id) Function creates the control TabControl.
    void RedirectToAccessDenied() Function redirects the user to the page Access denied.
    void RedirectToAccessDenied(string errorText) Function redirects the user to the page Access denied with additional text.
    void RedirectToErrorPage(string errorText) Function redirects the user to the page Error with additional text.
    void RedirectToDefault() Function redirects the user to the default page of ObjectGears system.
    void RedirectTo(string url) Function redirects the user to the given page.

    Work with controls

    You can add both standard ASP.NET controls, ObjectGears system controls and your owncontrols into the form. Add controls by means of function AddControl. If you want to clear the whole form, use the method Clear. In order to get a particular control according to the ID use method GetControl.

    You have to set ID for each control that you add into the form. You can then work with controls by means of this ID.

    Controls ...Item ObjectGears

    ObjectGears system has a set of its own controls for particular data types. You can use these as you choose. The page is design for 1-2 controls to a single line. The controls are grouped into groups (GroupItem). Use the same design in order your forms are same for the user like other parts of the ObjectGears system.

    Breadcrumb Navigation

    There is function SetLinkNavigation for the Breadcrumb navigation. You can pass a list of links, that will be displayed in the navigation, to this function. The navigation is available only at the page display, not at the page design.

    Format of the navigation definition:

    Input particular links in form of name pipe link. You can add an unlimited number of links one behind another. Separate them by means of character >.

    name 1|url 1>name 2|url 2

    OGForm.SetLinkNavigation( 'System|system.aspx>Server|machine.aspx');

     

×