Yashar
Yashar

Reputation: 1162

collapse a collapsiblePanel by Javascript

I would like to know how to collapse a collapsiblePanel (richfaces 4) by Javascript ?

I was using SimpleTogglePanel (richfaces 3) with SimpleTogglePanelManager.toggleOnClien to do this. Is there any alternative similar manager for collapsiblePanel in richfaces 4.

Upvotes: 1

Views: 1174

Answers (2)

Andrey
Andrey

Reputation: 6766

Here is a way to collapse the panel:

// For collapsiblePanel 'false' is collapsed item.
RichFaces.$(panelClientId).switchToItem('false');

or with EL:

#{rich:component('panelId')}.switchToItem('false');

Upvotes: 1

Makhiel
Makhiel

Reputation: 3884

There is no central controller anyomore, the panel itself has a switchPanel method (see the docs).

You can either call it by pure JS

RichFaces.$('form:panel').switchPanel();

or using EL

#{rich:component('panel')}.switchPanel();

Upvotes: 2

Related Questions