users@woodstock.java.net

layoutPanel/groupPanel visible property

From: Gea Pastetti <alucard___at_hotmail.it>
Date: Wed, 30 Jan 2008 13:19:27 +0100

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]
_________________________________________________________________
Scarica GRATIS le tue emoticon preferite!
http://intrattenimento.it.msn.com/emoticon/