users@woodstock.java.net

Re: layoutPanel/groupPanel visible property

From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
Date: Wed, 30 Jan 2008 17:56:44 -0500

Please see the TLD docs below. The public JavaScript functions of each
tag are documented here. Unfortunately, these Ajax features are not
supported by the groupPanel tag.

    http://webdev2.sun.com/woodstock-tlddocs

If you want a quick way to hide/show the panel client-side, set the
style tag attribute to "display:none". To show the panel without a page
refresh, just clear the display style property via JavaScript. There is
no need to use Ajax to make the panel visible.

Dan

Gea Pastetti wrote:
> hi all!
> I have written the code below...
> When the button is activated the panel must be displayed without a
> full reload of the page.
> This code works with simple components like staticText,
> textField... but not with layoutPanels or groupPanels with components
> inside (JS makes an error and the page is submitted). Is there an
> error in my code? How can I display panels with components inside?
> Thanks in advance.
>
> Employment.java
> [CODE]
> ...
> private boolean showPanel = false;
>
> public boolean getShowPanel() {
> return showPanel;
> }
>
> public void setShowPanel(boolean showPanel) {
> this.showPanel = showPanel;
> }
> ...
> [/CODE]
>
> Employment.jsp
> [CODE]
> ...
> <webuijsf:head>
> ...
> <webuijsf:script>
> function showPanel() {
> (document.getElementById("form1:hidden")).setProps({value:true});
> var panel = document.getElementById("form1:dataPanel");
> panel.refresh("form1:hidden");
> return false;
> }
> </webuijsf:script>
> </webuijsf:head>
> ...
> <webuijsf:button binding="#{Employment.addBtn}" id="addBtn"
> onClick="return showPanel()" text="#{employment.add}"/>
> ...
> <webuijsf:hiddenField binding="#{Employment.hidden}" id="hidden"
> text="#{Employment.showPanel}"/>
> ...
> <webuijsf:panelGroup binding="#{Employment.dataPanel}" id="dataPanel"
> style="position: absolute; left: 576px; top: 48px"
> visible="#{Employment.showPanel}">
> ...
> </webuijsf:panelGroup>
> ...
> <webuijsf:staticText binding="#{Employment.staticText8}"
> id="staticText8" style="position: absolute; left: 48px; top: 408px"
> text="TEST" visible="#{Employment.showPanel}"/>
> ...
> [/CODE]
>
> ------------------------------------------------------------------------
> Messenger Giochi Prenditi una pausa e sfida i tuoi amici a Ladybird su
> Messenger! <http://messengergiochi.it.msn.com/ladybird.aspx>