Adding effect to rich:accordion in RF4

03 Nov 2013 » {[{categoryPostCurrent}]}

the widgets of richfaces 4 can't manage effects contrary to RF 3.X.

the following code snippet is an example that show you how to add a "slide" effect to the <rich:accordion> widget:

    <rich:jQuery selector=".rf-ac .rf-ac-itm" event="click" query="
    var elAccordion = $(this).parent('.rf-ac').first();
    
    if (elAccordion.find('.lastAccordionItem').length == 0) {
    elAccordion.find('div.rf-ac-itm-cnt').first().addClass('lastAccordionItem');
    }
    
    elAccordion.find('.lastAccordionItem').css('display','block');
    elAccordion.find('.lastAccordionItem').slideUp();
    elAccordion.find('.lastAccordionItem').removeClass('lastAccordionItem');
    
    $(this).find('div.rf-ac-itm-cnt').css('display','none');
    $(this).find('div.rf-ac-itm-cnt').slideDown();
    $(this).find('div.rf-ac-itm-cnt').addClass('lastAccordionItem');
    
    "/>

Typically, this code can be placed in a JSF2/facelet template.

Enjoy.

Voir aussi...

comments powered by Disqus