Announcement

Collapse
No announcement yet.

Combobox preload windows

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Combobox preload windows

    Hello,

    I have created a custom screen, that contain a combobox and several edit boxes and 2 buttons.

    In the combobox, I have 2 options: DEV and PROD. By default, DEV is selected and all other edit boxes and buttons should be disabled.

    I would like that, On Preload screen to check the default value of the combobox and disable everything else.

    Here is what I have so far, but it doesn't work as expected.

    strComboText = SessionVar.Expand("%var_type%");

    if (strComboText == "DEV") then

    DlgEditField.SetProperties(CTRL_EDIT_02, {Enabled=false});
    DlgButton.SetProperties(CTRL_BUTTON_02, {Enabled=false});
    DlgEditField.SetProperties(CTRL_EDIT_03, {Enabled=false});
    DlgButton.SetProperties(CTRL_BUTTON_03, {Enabled=false});
    DlgEditField.SetProperties(CTRL_EDIT_04, {Enabled=false});
    DlgEditField.SetProperties(CTRL_EDIT_05, {Enabled=false});
    DlgEditField.SetProperties(CTRL_EDIT_06, {Enabled=false});
    DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_ 08, {Visible=false});
    DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_ 09, {Visible=false});

    elseif (strComboText == "PROD") then

    DlgEditField.SetProperties(CTRL_EDIT_02, {Enabled=true});
    DlgButton.SetProperties(CTRL_BUTTON_02, {Enabled=true});
    DlgEditField.SetProperties(CTRL_EDIT_03, {Enabled=true});
    DlgButton.SetProperties(CTRL_BUTTON_03, {Enabled=true});
    DlgEditField.SetProperties(CTRL_EDIT_04, {Enabled=true});
    DlgEditField.SetProperties(CTRL_EDIT_05, {Enabled=true});
    DlgEditField.SetProperties(CTRL_EDIT_06, {Enabled=true});
    DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_ 08, {Visible=true});
    DlgStaticText.SetProperties(CTRL_STATICTEXT_LABEL_ 09, {Visible=true});
    end

    Please help!
    Thanks,
    Cosmin

  • #2
    I just tested this concept, and it works for me. Attach the project file, so we can see what is wrong.

    Of course the "elseif" part will never be executed, if "DEV" is the default setting of the control.

    Ulrich

    Comment


    • #3
      Well, since you confirmed that this was working for you, I started another check, and figured out that I forgot to set the double percentage signs when setting the %var_type% in the combobox, so it works now.



      Thanks,
      Cosmin

      Comment

      Working...
      X