protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        lblCategoryCaption.AssociatedControlClientID    = EditingFormControl.GetInputClientID(txtCategoryCaption.NestedControl.Controls);
        lblCollapsible.AssociatedControlClientID        = EditingFormControl.GetInputClientID(chkCollapsible.NestedControl.Controls);
        lblCollapsedByDefault.AssociatedControlClientID = EditingFormControl.GetInputClientID(chkCollapsedByDefault.NestedControl.Controls);
        lblVisible.AssociatedControlClientID            = EditingFormControl.GetInputClientID(chkVisible.NestedControl.Controls);
    }
Example #2
0
    /// <summary>
    /// Show default value control and required control according to attribute type.
    /// </summary>
    public void ShowDefaultControl()
    {
        plcDefaultValue.Visible = true;
        SetFieldForTranslations();
        SetReferenceToField();

        var dataType = DataTypeManager.GetDataType(TypeEnum.Field, AttributeType);

        HandleRequiredVisibility(dataType);

        // Hide all default value controls first
        txtDefaultValue.Visible      = false;
        chkDefaultValue.Visible      = false;
        rbDefaultValue.Visible       = false;
        txtLargeDefaultValue.Visible = false;
        datetimeDefaultValue.Visible = false;

        if ((dataType != null) && dataType.HasConfigurableDefaultValue)
        {
            var systemType = dataType.Type;

            // Date and time types
            if (systemType == typeof(DateTime))
            {
                // Use date time picker for date and time types
                datetimeDefaultValue.Visible = true;

                var calendarControl = ((FormEngineUserControl)datetimeDefaultValue.NestedControl);

                lblDefaultValue.AssociatedControlClientID = EditingFormControl.GetInputClientID(calendarControl.Controls);
            }
            else if (systemType == typeof(bool))
            {
                // Use checkbox or radio button for boolean types
                chkDefaultValue.Visible = !AllowEmpty;
                rbDefaultValue.Visible  = AllowEmpty;
                lblDefaultValue.AssociatedControlClientID = AllowEmpty ? EditingFormControl.GetInputClientID(rbDefaultValue.NestedControl.Controls) : EditingFormControl.GetInputClientID(chkDefaultValue.NestedControl.Controls);
            }
            else if (AttributeType == FieldDataType.LongText)
            {
                // Special case for long text to provide rich editor
                txtLargeDefaultValue.Visible = true;
                lblDefaultValue.AssociatedControlClientID = EditingFormControl.GetInputClientID(txtLargeDefaultValue.NestedControl.Controls);
            }
            else
            {
                // Use textbox for other types
                txtDefaultValue.Visible = true;
                lblDefaultValue.AssociatedControlClientID = EditingFormControl.GetInputClientID(txtDefaultValue.NestedControl.Controls);
            }
        }
        else
        {
            // Hide default value for types without default value
            plcDefaultValue.Visible = false;
        }
    }
Example #3
0
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        lblFieldCssClass.AssociatedControlClientID       = EditingFormControl.GetInputClientID(txtFieldCssClass.NestedControl.Controls);
        lblCaptionCellCssClass.AssociatedControlClientID = EditingFormControl.GetInputClientID(txtCaptionCellCssClass.NestedControl.Controls);
        lblCaptionCssClass.AssociatedControlClientID     = EditingFormControl.GetInputClientID(txtCaptionCssClass.NestedControl.Controls);
        lblCaptionStyle.AssociatedControlClientID        = EditingFormControl.GetInputClientID(txtCaptionStyle.NestedControl.Controls);
        lblControlCellCssClass.AssociatedControlClientID = EditingFormControl.GetInputClientID(txtControlCellCssClass.NestedControl.Controls);
        lblControlCssClass.AssociatedControlClientID     = EditingFormControl.GetInputClientID(txtControlCssClass.NestedControl.Controls);
        lblInputStyle.AssociatedControlClientID          = EditingFormControl.GetInputClientID(txtInputStyle.NestedControl.Controls);
    }
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        if (DefaultValueControlName.EqualsCSafe(TEXTAREA, StringComparison.InvariantCultureIgnoreCase))
        {
            // Disable Tab key for large text area
            defaultValue.SetValue("enabletabkey", false);
        }

        // Set associated control IDs
        lblLabel.AssociatedControlClientID           = EditingFormControl.GetInputClientID(txtLabel.Controls);
        lblDefaultValue.AssociatedControlClientID    = EditingFormControl.GetInputClientID(defaultValue.Controls);
        lblExplanationText.AssociatedControlClientID = EditingFormControl.GetInputClientID(txtExplanationText.Controls);
        lblTooltip.AssociatedControlClientID         = EditingFormControl.GetInputClientID(txtTooltip.Controls);

        RegisterStartupScripts();
    }
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        lblFieldCaption.AssociatedControlClientID     = EditingFormControl.GetInputClientID(txtFieldCaption.NestedControl.Controls);
        lblFieldDescription.AssociatedControlClientID = EditingFormControl.GetInputClientID(txtDescription.NestedControl.Controls);
        lblExplanationText.AssociatedControlClientID  = EditingFormControl.GetInputClientID(txtExplanationText.NestedControl.Controls);

        // Check if the form control is allowed for selected data type
        var control = FormUserControlInfoProvider.GetFormUserControlInfo(drpControl.Value.ToString());

        string dataTypeColumn = FormHelper.GetDataTypeColumn(AttributeType);

        if ((control != null) && !String.IsNullOrEmpty(dataTypeColumn))
        {
            bool allowType = ValidationHelper.GetBoolean(control[dataTypeColumn], false);
            if (!allowType)
            {
                ShowWarning(String.Format(GetString("fieldeditor.controlnotallowedfordatatype"), control.UserControlDisplayName));
            }
        }
    }
Example #6
0
    /// <summary>
    /// Show default value control and required control according to attribute type.
    /// </summary>
    public void ShowDefaultControl()
    {
        plcDefaultValue.Visible = true;
        SetFieldForTranslations();
        SetReferenceToField();
        HandleRequiredVisiblity();

        switch (AttributeType)
        {
        case FieldDataType.DateTime:
        case FieldDataType.Date:
        {
            datetimeDefaultValue.Visible = true;
            chkDefaultValue.Visible      = false;
            rbDefaultValue.Visible       = false;
            txtLargeDefaultValue.Visible = false;
            txtDefaultValue.Visible      = false;

            var calendarControl = ((FormEngineUserControl)datetimeDefaultValue.NestedControl);

            lblDefaultValue.AssociatedControlClientID = EditingFormControl.GetInputClientID(calendarControl.Controls);
        }
        break;

        case FieldDataType.Boolean:
        {
            bool showRb = (AllowEmpty && SystemContext.DevelopmentMode);
            chkDefaultValue.Visible      = !showRb;
            rbDefaultValue.Visible       = showRb;
            txtLargeDefaultValue.Visible = false;
            txtDefaultValue.Visible      = false;
            datetimeDefaultValue.Visible = false;
            lblDefaultValue.AssociatedControlClientID = showRb ? EditingFormControl.GetInputClientID(rbDefaultValue.NestedControl.Controls) : EditingFormControl.GetInputClientID(chkDefaultValue.NestedControl.Controls);
        }
        break;

        case FieldDataType.LongText:
        {
            txtLargeDefaultValue.Visible = true;
            chkDefaultValue.Visible      = false;
            rbDefaultValue.Visible       = false;
            txtDefaultValue.Visible      = false;
            datetimeDefaultValue.Visible = false;
            lblDefaultValue.AssociatedControlClientID = EditingFormControl.GetInputClientID(txtLargeDefaultValue.NestedControl.Controls);
        }
        break;

        case FieldDataType.Binary:
            plcDefaultValue.Visible = false;
            break;

        case FieldDataType.File:
        case FieldDataType.DocAttachments:
            // Hide default value for File and Document attachment fields within Document types
            if ((Mode == FieldEditorModeEnum.ClassFormDefinition) || (Mode == FieldEditorModeEnum.AlternativeClassFormDefinition))
            {
                plcDefaultValue.Visible = false;
            }
            // Display textbox otherwise
            else
            {
                txtDefaultValue.Visible      = true;
                chkDefaultValue.Visible      = false;
                rbDefaultValue.Visible       = false;
                txtLargeDefaultValue.Visible = false;
                datetimeDefaultValue.Visible = false;
                lblDefaultValue.AssociatedControlClientID = EditingFormControl.GetInputClientID(txtDefaultValue.NestedControl.Controls);
            }
            break;

        default:
        {
            txtDefaultValue.Visible      = true;
            chkDefaultValue.Visible      = false;
            rbDefaultValue.Visible       = false;
            txtLargeDefaultValue.Visible = false;
            datetimeDefaultValue.Visible = false;
            lblDefaultValue.AssociatedControlClientID = EditingFormControl.GetInputClientID(txtDefaultValue.NestedControl.Controls);
        }
        break;
        }
    }
Example #7
0
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        lblErrorMessage.AssociatedControlClientID = EditingFormControl.GetInputClientID(txtErrorMessage.NestedControl.Controls);
    }