Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
21. Jul 2008, 18:21 CET | Link

Hello !

I would like to know how to collapse a SimpleTogglePanel by Javascript ?

Here is my panel :


<rich:simpleTogglePanel id="panel" label="My Panel" switchType="client">
  Some text
</rich:simpleTogglePanel>

And I want that when I click on a specific button, it hides this panel :


<script type="text/javascript">
  function toggleCommandeEditForm() {
    SimpleTogglePanelManager.toggleOnClient('onclick', $$('[id*="panel"]')[0].id);
  }
</script>
<a:commandButton value="Collapse" onclick="collapsePanel();" action="#{...}"/>

This code is simply toggling my panel, but I want it to collapse everytime y click on my button...

Do someone have any idea ?

2 Replies:
21. Jul 2008, 18:38 CET | Link

Have a look here FishEye perhaps that can help you.

Please post your findings on this :)

- Micke

21. Jul 2008, 18:51 CET | Link

I've found some hack method looking at the sourcecode (here actually). Here is my javascript function :

<script type="text/javascript">
  function collapsePanel() {
    var panel = $$('[id*="panel"]')[0];
      if (SimpleTogglePanelManager.panels.get(panel.id).status == "true") {
        SimpleTogglePanelManager.toggleOnClient('onclick', panel.id);
      }
    }
</script>

But ... well... I found that solution disgusting, so if someone know the exact function to call to simply collapse that panel ...