Is there a way to set an entire component group to visible? Say for instance:

<componentList>
    <component>
        <name>Parent</name>
        <description>Parent Component</description>
        <canBeEdited>1</canBeEdited>
        <selected>1</selected>
        <show>1</show>
    </component>
    <componentGroup>
        <name>Children</name>
        <description>Children Components</description>
        <canBeEdited>1</canBeEdited>
        <selected>1</selected>
        <show>0</show>
        <componentList>
            <component>
                <name>ChildA</name>
                ...
                <show>0></show>
            </component>
            <component>
                <name>ChildB</name>
                ...
                <show>0></show>
            </component>

How do I set all the children to be visible, say when an installer variable is selected? To really clarify, I set a parameter for installation type (full, typical, or custom). Then, I want to make the component groups, or sub-groups, visible during a "custom" installation. What is the most efficient way to achieve this?

asked 07 Dec '11, 08:53

DevHopeful_2012's gravatar image

DevHopeful_2012
176131521
accept rate: 9%


Usually this is done by setting show or canBeEdited for a <component> or <componentGroup> in <postShowPageActionList>. Setting canBeEdited to 0 causes the group and its children to be shown, but disallows editing them - so the user can see what he/she will install, but is not able to modify it without going back and changing install type to custom.

Example below changes component selection and canBeEdited property for Parent and Children components based on ${installtype} value:

<choiceParameter>
  <name>installtype</name>
  <!-- ... -->
  <postShowPageActionList>
    <if>
      <progressText>Modify component selection</progressText>
      <actionList>
        <componentSelection>
          <deselect>ChildB</deselect>
          <select>Parent,Children,ChildA</select>
        </componentSelection>
      </actionList>
      <conditionRuleList>
        <compareValues logic="equals" value1="${installtype}" value2="full" />
      </conditionRuleList>
      <elseActionList>
        <componentSelection>
          <deselect></deselect>
          <select>Parent,Children,ChildA,ChildB</select>
        </componentSelection>
      </elseActionList>
    </if>
    <if>
      <progressText>Modify editable</progressText>
      <actionList>
        <setInstallerVariable name="project.component(Parent).canBeEdited" value="1" />
        <setInstallerVariable name="project.component(Children).canBeEdited" value="1" />
      </actionList>
      <conditionRuleList>
        <compareValues logic="equals" value1="${installtype}" value2="custom" />
      </conditionRuleList>
      <elseActionList>
        <setInstallerVariable name="project.component(Parent).canBeEdited" value="0" />
        <setInstallerVariable name="project.component(Children).canBeEdited" value="0" />
      </elseActionList>
    </if>
  </postShowPageActionList>
</choiceParameter>

Note that values are not changed for children as setting either <show> or <canBeEdited> to 0 affects all of their children not being shown or editable.

link

answered 07 Dec '11, 09:18

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Excellent example and explanation. I do not know that I always want it to be viewable, but this gives me exactly the information that I need. Just need to verify that it works. Thanks!

(08 Dec '11, 13:22) DevHopeful_2012
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×39
×10
×1

Asked: 07 Dec '11, 08:53

Seen: 2,104 times

Last updated: 08 Dec '11, 13:22