Two Laptop Bag*
The moose likes JSF and the fly likes Ajax to Make panel Visible or Hidden Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Ajax to Make panel Visible or Hidden" Watch "Ajax to Make panel Visible or Hidden" New topic
Author

Ajax to Make panel Visible or Hidden

chandra chatterjee
Greenhorn

Joined: May 13, 2009
Posts: 18
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()">
<hutputText 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">
<hutputText value="Username"/>
<h:inputText id="un" size="10" required="true"></h:inputText>
<hutputText value = "Password" />
<h:inputSecret id="pwd" size="10" required="true"/>
<h:message for="un"></h:message>
<h:message for="pwd"></h:message>
<hutputText value=""></hutputText>
<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.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ajax to Make panel Visible or Hidden