• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ajax to Make panel Visible or Hidden

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to call a java script and make a panel grid visible or hidden with out refreshing the page?

I tried using this way it reflects the entire page

<a4j:region>
<t:commandLink onclick="showpanel()">
<h:outputText styleClass="out" value="Sign In"/>
<a4j:support event="onclick" immediate="yes" ajaxSingle="true"> </a4j:support>
</t:commandLink>

<h:panelGrid id ="signInGrid" styleClass="signin" columns="4">
<h:outputText value="Username"/>
<h:inputText id="un" size="10" required="true"></h:inputText>
<h:outputText value = "Password" />
<h:inputSecret id="pwd" size="10" required="true"/>
<h:message for="un"></h:message>
<h:message for="pwd"></h:message>
<h:outputText value=""></h:outputText>
<h:commandButton value="Login"></h:commandButton>
</h:panelGrid>
</a4j:region>

where showpanel() containts document.getElementById("form:signInGrid").style.display='';

Please advice thanks in advance.

The core idea of the functionality is to show the username and passowr fields on click of sign in.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're already using a4j, check out the RichFaces Toggle Panel. It provides that kind of functionality without requiring any user-defined JavaScript code at all.

Some something like this, they also provide a ModalDialog tag that might be useful.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic