[CLOSED] Formpanel dynamically change 'AllowBlank' and ValidityChange

  1. #1

    [CLOSED] Formpanel dynamically change 'AllowBlank' and ValidityChange

    Good Moring

    I need to add and remove the AllowBlank attribute on Textfields on a Formpanel.
    I do it like that

          If Convert.ToString(cboDBSchema.Value) = "1" Then
            TextFieldSchemaName.Hide()
            TextFieldSchemaName.AllowBlank = True
            TextFieldSchemaName.IndicatorText = String.Empty
          Else
            TextFieldSchemaName.Show()
            TextFieldSchemaName.AllowBlank = False
            TextFieldSchemaName.IndicatorText = "*"
          End If
    That works so far, but the ValidityChange Handler doesn't detect this changes ? In my example, the save button disable state on the form is triggered by this handler and the button stays disabled in case of the first condition (Value =="1").

    What can I do to change that behave ?

    Thanks
    Peter
    Last edited by Daniil; Feb 03, 2016 at 6:58 AM. Reason: [CLOSED]
  2. #2
    Hello Peter!

    Have you tried calling also the TextField's TextFieldSchemaName.ValidateBlank and maybe after the changes, calling TextFieldSchemaName.Validate()? The last would reevaluate the field for validity status.

    Hope that helps! If not, please provide a full test case so we can also know the situations where the changes happen and provide you more accurate feedback.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] GridPanel, through the "ValidityChange" FormPanel
    By opendat2000 in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 07, 2015, 8:33 PM
  2. FormPanel ValidityChange Listener is not calling
    By shaileshsakaria in forum 2.x Help
    Replies: 0
    Last Post: Feb 06, 2013, 6:47 AM
  3. Change Allowblank property dynamically
    By prerakbhandari in forum 1.x Help
    Replies: 0
    Last Post: Jan 21, 2013, 7:54 AM
  4. Set AllowBlank Property True Dynamically in codebehind
    By prerakbhandari in forum 2.x Help
    Replies: 0
    Last Post: Jan 21, 2013, 7:39 AM
  5. [CLOSED] Change allowblank dynamically
    By bakardi in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 22, 2010, 8:27 PM

Posting Permissions