rich:modalPanel does not reset its values?!
molif Jul 4, 2008 10:49 AMHello,
I have a rich:modalPanel, upon whose opening, I see the same values as before. I mean, I open it once, then submit a form in it and open it a second time. It keeps the previous values, from the first opening, even though I have an actionListener, which initialises these values to null. In debug mode, I pass through this actionListener, and set the values to null, but still, in the modalPanel, the ancient values are kept.. Can someone help?
<h:panelGrid id="templateControlNavigation" columns="1" style="width:300"> <a4j:commandLink value="Add Control Of Field" actionListener="#{templateManager.resetControlFields}" oncomplete="#{rich:component('controlsPanelAdd')}.show()" immediate="true"/> </h:panelGrid>
public void resetControlFields(){ newControl = null; newParameter = null; }
<rich:modalPanel id="controlsPanelAdd" height="300" width="500" zindex="2000"> <h:form id="addControlsInModalPanel"> <h:panelGrid id="tempFieldControlsAdd" columns="2" columnClasses="wfcol1,wfcol2" cellspacing="5" cellpadding="5"> <h:outputText value="Select a control"/> <h:selectOneMenu id="controlMenuAdd" value="#{newControl}" required="true" immediate="true"> <s:selectItems value="#{templateManager.allControls}" var="control" label="#{control.className}"/> <s:convertEntity /> <a4j:support event="onchange" reRender="paramGridAdd" ajaxSingle="true" /> </h:selectOneMenu> <h:panelGrid id="paramGridAdd" columns="2" columnClasses="wfcol1,wfcol2" cellspacing="5" cellpadding="5"> <h:outputText value="Description : "/> <h:outputText id="descriptionTextAdd" value="#{messages[newControl.description]}"/> <h:outputText value="Parameter"/> <h:inputText id="parameterTextAdd" value="#{newParameter}" /> </h:panelGrid> <h:panelGrid id="modalPanelButtonsAdd" columns="2" columnClasses="wfcol1,wfcol2" cellspacing="3" cellpadding="10"> <a4j:commandButton id="submitPanelAdd" action="#{templateManager.addControlForField}" oncomplete="#{rich:component('controlsPanelAdd')}.hide()" reRender="templateControlMenu" value="#{messages['button.submit']}" styleClass="inputButton"/> <a4j:commandButton id="hidePanelAdd" oncomplete="#{rich:component('controlsPanelAdd')}.hide()" value="#{messages['button.cancel']}" styleClass="inputButton"/> </h:panelGrid> </h:panelGrid> </h:form> </rich:modalPanel>