ModalPanel showWhenRendered Form problem
renegritsch Nov 15, 2010 7:56 AMI have an ajaxRendered=true outputPanel around a modalPanel which shows up when rendered.
This works fine, but if a have a form inside with an inputfield (ajax support) for example, the form get´s
submitted but the values are not set to my model. I tried everything from links,buttons etc. they have the same behaviour.
When i use a normal modalPanel everything works fine. I´ve also tried to us a form only around the inputfield but this
makes no difference too.
@ i found out that it has something todo with the facesmessages, because if i open the modalpanel manually without showWhenRendered the
msg variable in the datatable resolves to null after i ajax submit the inputfield. When does the jsf fw reset the facesmessages ?!
{code:xml}
<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:a4j ="http://richfaces.org/a4j"
xmlns:f ="http://java.sun.com/jsf/core"
xmlns:s ="http://jboss.com/products/seam/taglib"
xmlns:t ="http://myfaces.apache.org/tomahawk"
xmlns:rich ="http://richfaces.org/rich"
>
<a4j:outputPanel ajaxRendered="true" id="messagesView"><rich:modalPanel id="messagesPanel" autosized="true" minWidth="300" width="500" minHeight="300" moveable="false" resizeable="false" rendered="#{facesMessages.currentMessages.size() gt 0}" showWhenRendered="true">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Test"></h:outputText>
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="#{resources.image('message.close')}" height="16" width="16" styleClass="hidelink" id="hidelink" style="padding:1px"/>
<rich:componentControl for="messagesPanel" attachTo="hidelink" operation="hide" event="onclick"/>
</h:panelGroup>
</f:facet>
<rich:dataTable onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
cellpadding="0"
cellspacing="0"
var="msg"
value="#{facesMessages.currentMessages}"
style="width:100%">
<f:facet name="header">
<rich:columnGroup>
<rich:column>
<h:outputText value="Test" />
</rich:column>
<rich:column>
<h:outputText value="Message" />
</rich:column>
</rich:columnGroup>
</f:facet>
<rich:column>
<a4j:form id="formMessageDialogSingleField">
<h:inputText
value="#{msg.test}"
style="width:100%;">
<a4j:support ajaxSingle="true" event="onchange"/>
</h:inputText>
</a4j:form>
</rich:column>
<rich:column>
<h:outputText value="#{msg.detail}" style="color: red; font-weight:bold" />
</rich:column>
</rich:dataTable> </rich:modalPanel>
</a4j:outputPanel>
</ui:composition></rich:column>
{code}