ModalPanel Hiding Itself
leesy Sep 26, 2008 9:41 AMHi,
I'm trying to get use modalpanel for the first time but I seem to be having some trouble. I've got a button that I click to pop up the panel. Trouble is that is dissapears after a few seconds - without any input from me.
Here's my code - can anyone see anything wrong:
addcustomer.xhtml:
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib" xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<rich:modalPanel id="addCustomerPanel">
<f:facet name="header">
<h:outputText value="Add New Customer" />  
<a4j:commandLink value="Close" onclick="Richfaces.hideModalPanel('addCustomerPanel');" />
</f:facet>
<f:facet name="controls">
<h:graphicImage value="/images/icons/xtiny/close.png" styleClass="linkImage"/>
</f:facet>
<h:form>
<fieldset>
<ul>
<li>
<label for="customerName" />
<h:inputText id="customerName" value="#{customerHome.instance.externalId}" />
</li>
<li>
<label for="customerDisplayName" />
<h:inputText id="customerDisplayName" value="#[customerHome.instance.displayName}" />
</li>
<li>
<label for="customerAccountManager" />
<h:selectOneListbox id="customerAccountManager" value="#{customerHome.instance.accountManager}">
<s:selectItems var="item" value="#{accountManagersList}">
<f:selectItem itemLabel="#{item.displayName}" itemValue="#{item.id}"/>
</s:selectItems>
</h:selectOneListbox>
</li>
<li>
<label for="customerDemo" />
<h:selectBooleanCheckbox id="customerDemo" value="#{customerHome.instance.demo}" />
</li>
<li>
<h:commandButton value="Add New Customer" />
</li>
</ul>
</fieldset>
</h:form>
</rich:modalPanel>
</ui:composition>Code I'm using to show panel:
<h:commandLink class="action-add" value="Add Customer" onclick="Richfaces.showModalPanel('addCustomerPanel');">Code to include the XHTML the panel is in:
<ui:include src="addcustomer.xhtml" />