TouchUI组件中的RadioGroup

时间:2015-05-07 10:11:10

标签: cq5 aem

我正在开发触控UI组件。以下是我在某种程度上尝试和工作的内容。下面是dialog.xml

<content
        jcr:primaryType="nt:unstructured"
        sling:resourceType="granite/ui/components/foundation/container">
        <layout
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/foundation/layouts/tabs"
            type="nav"/>
        <items jcr:primaryType="nt:unstructured">
            <herotext
                jcr:primaryType="nt:unstructured"
                jcr:title="Hero Text Properties"
                sling:resourceType="granite/ui/components/foundation/section">
                <layout
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>
                <items jcr:primaryType="nt:unstructured">
                    <column
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/foundation/container">
                        <items jcr:primaryType="nt:unstructured">
                            <myradiogroup
                                jcr:primaryType="nt:unstructured"
                                sling:resourceType="granite/ui/components/foundation/form/radiogroup"
                                fieldLabel="Select Fruit"
                                name="./fruit">
                                <items jcr:primaryType="nt:unstructured">
                                    <option1
                                        jcr:primaryType="nt:unstructured"
                                        sling:resourceType="granite/ui/components/foundation/form/radio"
                                        cq-msm-lockable="fruit"
                                        renderReadOnly="{Boolean}true"
                                        text="Apple"
                                        value="apple"/>
                                    <option2
                                        jcr:primaryType="nt:unstructured"
                                        sling:resourceType="granite/ui/components/foundation/form/radio"
                                        cq-msm-lockable="fruit"
                                        renderReadOnly="{Boolean}true"
                                        text="Pear"
                                        value="pear"/>
                                </items>
                            </myradiogroup>
                        </items>
                    </column>
                </items>
            </herotext>
        </items>
    </content>

在此之后,我能够在页面上呈现无线电选择值。但问题如下。

1) Radio options are coming in vertical direction, but i want them in horizontal.
2) Radio Group Name not display, I want same like as fieldLabel & want to hide hide the border line.
3) When i reopen the dialog, radiobutton is not selected even if the selected value stored in JCR during last submit.

由于

1 个答案:

答案 0 :(得分:0)

要在水平方向上获取单选按钮,请使用以下类作为具有coral-RadioGroup--horizontal值的属性。这是AEM提供的OOTB类,您也可以使用自定义类来控制布局和对齐

用于显示Radio Button Group标签使用text属性。

Radio Button Group properties

打开对话框时,属性填充正常。看看你是否在同一个同名对话框中有任何其他radiobuttongroup。