2 Replies Latest reply on Nov 30, 2010 1:51 PM by mechtatel

    Expand SimpleTogglePanel from link

    mechtatel

      Hi,

       

      I'd like to expand a SimpleTogglePanel from a link. Both SimpleTogglePanel and the Link will be inside a a4j:repeat. The SingleTogglePanel has switchMode="ajax" so when the link is clicked has to expand the SimpleTogglePanel and perform the ajax request. How can I accomplish that using the link?

        • 1. Re: Expand SimpleTogglePanel from link
          ilya_shaikovsky

          STP provides opened attribute which accepts EL. it has some problems but as I see there are some workarounds also http://community.jboss.org/message/55899#55899

          • 2. Re: Expand SimpleTogglePanel from link
            mechtatel

            Hi Ilya,

             

            Thank you for the answer. I know about the opened attribute, and I'm using it retriving the value from the entity, but I like also to use a commandLink outside from the toggle panel to expand and collapse it.

             

            I want to have some commandLinks displayed horizontally and one of them will be "see more", so when is clicked on it will expand the simple toggle panel. The simple toggle panel will be without header.

             

            ....................................................

            .                                                  .

            .             description                     .

            .                                                  .

            .                                                  .

            . <see more> <share> <remove>   .

            ....................................................

             

             

             

            ....................................................

            .                                                  .

            .             description                     .

            .                                                  .

            .                detail                          .

            .                                                  .

            . <collapse> <share><remove>    .

            ....................................................

             

             

            I can accomplish this with panel, but I want to use the out of box functionalites of the simpleTogglePanel, but I don't now how to expand and collpse it in proper way from the outside link.

             

            I was testing using javascript calls to "SimpleTogglePanelManager.toggleOnAjax" and "A4J.AJAX.Submit" and works well, except that I'dont know how to control the reRender atribute(maybe ajaxsingle, process) because when I'm using the commandLink are made more queryies to the data base (remember I'm inside in a a4j:repeat), so probably exist a simpler way to accomplish this, without writing manually code on events like "SimpleTogglePanelManager.toggleOnAjax"?