Expand my Community achievements bar.

SOLVED

How to hide panels dynamically in the dialog.

Avatar

Community Advisor

Hi Team,

We've a requirement where we need to hide panels dynamically and show in some other time.  For example, we have three panels in the dialog. 

 

Dialog

    tab1 (panel)

        fields

    tab2 (panel)

        fields

    tab3 (panel)

        fields

 Now, I need to hide tab1 & tab2 when the page is equals (/content/xyz) and enable tab3. and remaining cases, show tab1 & tab2 and hide tab3.

Here is the sample dialog:

<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    jcr:primaryType="cq:Dialog"
    title="dialog"
    xtype="dialog">
    <items
        jcr:primaryType="cq:Widget"
        xtype="tabpanel">
        <items jcr:primaryType="cq:WidgetCollection">
            <tab1
                jcr:primaryType="cq:Panel"
                title="Tab1">
                <items jcr:primaryType="cq:WidgetCollection">
                    <title
                        jcr:primaryType="cq:Widget"
                        fieldLabel="Title"
                        name="./value"
                        xtype="textfield"/>                    
                </items>               
            </tab1>
            <tab2
                jcr:primaryType="cq:Panel"
                title="Tab2">
                <items jcr:primaryType="cq:WidgetCollection">
                    <title
                        jcr:primaryType="cq:Widget"
                        fieldLabel="Title"
                        name="./value"
                        xtype="textfield"/>                    
                </items>               
            </tab2>
            <tab3
                jcr:primaryType="cq:Panel"
                title="Tab3">
                <items jcr:primaryType="cq:WidgetCollection">
                    <title
                        jcr:primaryType="cq:Widget"
                        fieldLabel="Title"
                        name="./value"
                        xtype="textfield"/>                    
                </items>               
            </tab3>
        </items>
    </items>
</jcr:root>

 

 

Quick response would be appreciated..

 

Thanks In advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10
1 Reply

Avatar

Correct answer by
Level 10