rendered Attribute breaks a4j support?
gressho Mar 14, 2008 7:49 AMHello,
I've tried some time to get an <a4j:support> element to work and
found some strange behaviour:
When I use a4j elements in an element with a rendered attribute it won't work
anymore! In the code below, the a4j:support doesn't do anything, even the
<h:commandLink> doesn't do anything!
When I remove the rendered attribute from the surrounding <rich:panel> everything
works well...
I'm not using RichFaces for long, so I might have made some errors and would be
grateful to anybody showing me a way through this.
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="../../layout/template.xhtml">
<ui:define name="body">
<rich:panel id="editPanel" rendered="#{mandatorManagement.userIsAdmin}">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="#{message.headerEditMandator}" rendered="#{mandatorManagement.mandator.id != 0}"/>
<h:outputText value="#{message.headerCreateMandator}" rendered="#{mandatorManagement.mandator.id == 0}"/>
</h:panelGroup>
</f:facet>
<a4j:form ajaxSubmit="true">
<h:panelGrid columns="2">
<h:outputText value="#{message.catalog}"/>
<h:inputText value="#{mandatorManagement.mandator.description}"
required="true"
immediate="false"
size="50"
maxlength="80">
<a4j:support event="onkeyup" ajaxSingle="true" immediate="true" reRender="test"/>
</h:inputText>
<h:outputText value="#{message.catalog}"/>
<h:outputText id="test" value="#{mandatorManagement.mandator.description}"/>
</h:panelGrid>
<h:panelGroup>
<h:commandLink value="#{message.save}"
action="#{mandatorManagement.save}"
style="border:2px; margin-right:10px">
<h:graphicImage value="/icons/16x16/actions/document-save.png"
style="border:0px; vertical-align:bottom; margin-left:10px"/>
</h:commandLink>
<h:commandLink value="#{message.back}"
action="#{mandatorManagement.back}"
immediate="true"
style="border:2px; margin-right:10px">
<h:graphicImage value="/icons/16x16/actions/process-stop.png"
style="border:0px; vertical-align:bottom; margin-left:10px"/>
</h:commandLink>
</h:panelGroup>
<h:messages globalOnly="true"/>
</a4j:form>
</rich:panel>
</ui:define>
</ui:composition>
</div>