Announcement

Collapse
No announcement yet.

SetCategoryProperties is ignoring the "Enabled" property setting

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

  • SetCategoryProperties is ignoring the "Enabled" property setting

    I am trying to set the properties of a category on the package selection screen with the following code:

    Code:
    if (serverAppsEnabled == true) then
      DlgSelectPackages.SetCategoryProperties(CTRL_SELECT_PACKAGE_TREE, CTRL_CATEGORY_002, {Enabled=true, State=CB_CHECKED, Expanded=true});
    else
      DlgSelectPackages.SetCategoryProperties(CTRL_SELECT_PACKAGE_TREE, CTRL_CATEGORY_002, {Enabled=false, State=CB_UNCHECKED, Expanded=false});
    end
    DlgSelectPackages.UpdateDisplay(CTRL_SELECT_PACKAGE_TREE);
    After this code runs, the "State" and "Expanded" properties of the category are set properly, but it seems to be ignoring the "Enabled" property. The category's enabled property always remains set to whatever state you assign to it at design time.

    Am I missing something or is this a bug in the SetCategoryProperties function?

  • #2
    Please attach the project file, so we can check the full code. There could indeed be something wrong - or there might be a problem in your code.

    Ulrich

    Comment


    • #3
      I'll start with the simple test project I made. It doesn't set the category products through script code. I just set the properties manually, but the enabled property isn't behaving properly on Category02.
      Attached Files

      Comment


      • #4
        P.S.: I just noticed it behaves correctly when I click the "Preview" button, but not when I run the compiled setup.

        Comment


        • #5
          Originally posted by fesspoint View Post
          I just set the properties manually, but the enabled property isn't behaving properly on Category02.
          Using your sample project, the code is working properly for me. The initial state of Category02 is disabled, as shown in your project settings:
          Click image for larger version

Name:	SNAP-2014-01-08-02.png
Views:	1
Size:	21.5 KB
ID:	284133

          The relevant code in your project is this:
          Code:
          DlgSelectPackages.SetCategoryProperties(CTRL_SELECT_PACKAGE_TREE, CTRL_CATEGORY_002, {Enabled=true, State=CB_CHECKED, Expanded=true});
          DlgSelectPackages.UpdateDisplay(CTRL_SELECT_PACKAGE_TREE);
          You enable, check and expand the category. And it is happening as expected:
          Click image for larger version

Name:	SNAP-2014-01-08-01.png
Views:	1
Size:	56.0 KB
ID:	284134

          Category01 is still disabled (shown in gray), while Category02 is enabled (shown in black). As only one child item is selected, the selection of the category is shown as a rectangle, not a check mark. I don't see an error here, do you?

          Ulrich

          Comment

          Working...
          X