Can I choose to display radiobuttons, for example, in specific component group?

One more question: Can I define visibility of components depending on selected installation language?

asked 20 Mar '12, 11:22

Vertius's gravatar image

Vertius
6224
accept rate: 0%


It is not possible to automatically deselect the other child components when the user clicks but you could use the <componentSelectionValidationActionList> to make sure the user do not select multiple childs and even disable all but one:

 <componentGroup>
    <name>parent</name>
    <description>Parent Component</description>
    <componentList>
       <component>
          <name>childA</name>
           <description>Child A</description>
       </component>
       <component>
          <name>childB</name>
           <description>Child B</description>
       </component>
           <component>
          <name>childC</name>
           <description>Child C</description>
       </component>
    </componentList>
    ...
    <componentSelectionValidationActionList>
       <setInstallerVariable name="selected" value=""/>
       <setInstallerVariable name="multiple_selection" value="0"/>
       <foreach>
          <variables>child</variables>
          <values>childA childB childC</values>
          <actionList>
              <actionGroup>
                  <actionList>
                     <actionGroup>
                         <actionList>
                            <setInstallerVariable name="multiple_selection" value="1"/>
                            <setInstallerVariable name="project.component(parent).component(${child}).selected" value="0"/>
                            <continue/>
                         </actionList>
                          <ruleList>
                              <compareText text="${selected}" logic="does_not_equal" value=""/>
                           </ruleList>
                       </actionGroup>
                    <setInstallerVariable name="selected" value="${child}"/>
                 </actionList>
                 <ruleList>
                       <isTrue value="${project.component(parent).component(${child}).selected}"/>
                  </ruleList>
              </actionGroup>
       </actionList>
    </foreach>
      <throwError>
        <text>You cannot select multiple child components. Just ${selected} will be selected</text>
        <ruleList>
             <isTrue value="${multiple_selection}"/>
        </ruleList>
      </throwError>
       <throwError>
        <text>You must select at least one child</text>
        <ruleList>
             <compareText text="${selected}" logic="equals" value=""/>
        </ruleList>
      </throwError>
    </componentSelectionValidationActionList>
    ...
  </componentGroup>

About selecting and deselecting, you could use the below code:

<actionGroup>
     <actionList>
            <setInstallerVariable>
                <name>component(componentA).show</name>
                <value>0</value>
            </setInstallerVariable>
                <setInstallerVariable>
                <name>component(componentA).selected</name>
                <value>0</value>
            </setInstallerVariable>
     </actionList>
      <ruleList>
            <compareText>
                <logic>does_not_equal</logic>
                <text>${installation_language_code}</text>
                <value>en</value>
            </compareText>
        </ruleList>
 </actionGroup>
link

answered 21 Mar '12, 16:49

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Error - Unknown component.

(25 Mar '12, 15:38) Vertius

In which part do you get that error? Could you verify you changed the component names that are hardcoded in the text?

(26 Mar '12, 10:59) juanjo ♦♦

Yes I changed values(to "jimbo, adiya, overcross and vanilla") and parent name(to "scopes"). But I get this error, when I select anything from this Component Group and click "Next" button.

(26 Mar '12, 13:27) Vertius

could you paste here the exact same code you are using?

(26 Mar '12, 15:41) juanjo ♦♦

I re-checked it and, now, it works on condition that Component Group(parent) isn't into another Component Group.

(26 Mar '12, 17:12) Vertius
1

if the component group is inside another one, you have to specify it in:

project.component(otherParent).component(parent).component(${child}).selected

(26 Mar '12, 17:16) juanjo ♦♦
showing 5 of 6 show all

Regarding the first question, do you mean to present the child components as radiobuttons so just one can be selected? If so, it is not possible but you could hide the childs and us a <choiceParameter> in a regular page as explained in the second example of this section.

About the visibility, you could use the below code:

<preInstallationActionList>
    <setInstallerVariable>
        <name>component(nonEnglish).show</name>
        <value>0</value>
        <ruleList>
            <compareText>
                <logic>equals</logic>
                <text>${installation_language_code}</text>
                <value>en</value>
            </compareText>
        </ruleList>
    </setInstallerVariable>
    <actionGroup>
        <actionList>
            <setInstallerVariable>
                <name>component(componentA).show</name>
                <value>0</value>
            </setInstallerVariable>
            <setInstallerVariable>
                <name>component(componentB).show</name>
                <value>0</value>
            </setInstallerVariable>
            <setInstallerVariable>
                <name>component(componentC).show</name>
                <value>0</value>
            </setInstallerVariable>
        </actionList>
        <ruleList>
            <compareText>
                <logic>does_not_equal</logic>
                <text>${installation_language_code}</text>
                <value>en</value>
            </compareText>
        </ruleList>
    </actionGroup>
</preInstallationActionList>

It will hide the components componentA, componentB and componentC if the selected language is not English.

link

answered 20 Mar '12, 11:40

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Can I hide and deselect components at the same time?

(21 Mar '12, 14:53) Vertius

First question - Yes, I want to display child components as radiobuttons. I'm really surprise that you can't define component group display type/style. Can I do this using rules (If component A is selected, then deselect components B i C etc.)?

Second question - Thanks :) Can I hide and deselect them at the same time?

link

answered 20 Mar '12, 11:57

Vertius's gravatar image

Vertius
6224
accept rate: 0%

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:

×49
×25
×13
×5

Asked: 20 Mar '12, 11:22

Seen: 1,883 times

Last updated: 26 Mar '12, 17:16