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.
| Online: | 21 Members of 4546 |
| Forum: Seam Users |
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 ?
Have a look here FishEye perhaps that can help you.
Please post your findings on this :)
- Micke
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 ...