0

我想知道如何默认设置richfaces手风琴折叠

这是我的代码,我只想在加载页面时所有面板折叠

<rich:accordion 
    switchType="ajax" style="width : 680px">
        <c:forEach items="#{marcarConsulta.consultasDisponiveis}"
            var="consultaDisponivel" varStatus="contador">
            <rich:accordionItem value="#{consultaDisponivel}">
                <f:facet name="header">                 
                    <h:panelGrid columns="2" cellpadding="10"
                        columnClasses="titulo_accordion_item">
                        <h:outputText value="#{consultaDisponivel.nomePessoa}" />
                        <h:outputText value="#{consultaDisponivel.nomeFantasia}" />
                    </h:panelGrid>
                </f:facet>
                <h:panelGroup layout="block" styleClass="accordion-date">
                    <h2>Escolha uma data:</h2>
                    <rich:calendar popup="false"
                        value="#{marcarConsulta.dataSelecionada}" mode="ajax"
                        firstWeekDay="0" boundaryDatesMode="scroll"
                        dataModel="#{calendarModel}" datePattern="dd/MM/yyyy">
                        <f:ajax listener="#{marcarConsulta.recuperarHorario}"
                            render="horario#{contador.index}" />
                    </rich:calendar>
                </h:panelGroup>             
            </rich:accordionItem>
        </c:forEach>
</rich:accordion>

提前致谢

4

1 回答 1

0

如果你定义一个css类如下:

<style> .myclass { display:none}  </style>  

然后在手风琴项目上将其添加到 contentClass 属性中,如下所示:

<rich:accordionItem contentClass="myclass" switchType="ajax"  >

那么你应该看到你现在已经折叠了所有面板。单击它们现在将照常展开。

于 2012-11-04T21:01:40.860 回答