selectManyCheckbox. I select one of the checkboxes, and hit a
cancel button within the dialog. The cancel button hide()'s the dialog.
I then click the commandLink again to show() the dialog. The checkbox
previously selected is still selected. Same with the close function. The
thing is that the commandLink has an action routine which resets the
value= property of the selectManyCheckbox (resetTypes is a
Collection<String> - in the action routine I set it to null).
I've tried using an actionListener but same result. When I click the link
to open the dialog I can see the resetDialog2() action method firing
before the selectManyCheckbox getter, so it's almost as if the dialog is
cacheing the content that is displayed.
The commandLink has update= for the dialog component and has
immediate=true. I've found that without immediate=true the
selectManyCheckbox issues a required=true validation error upon first
rendering of the dialog. In other cases where I'm just displaying data
in the dialog then without immediate=true the data is not available.
This is a pretty minor issue really but if anyone can see where I'm going
wrong I'd appreciate knowing about it. [I've also noticed that the action
routine on the commandLink won't fire unless immediate="true" is
specified].
Code: Select all
<h:form prependId="false">
...
<p:column style="text-align: center">
<p:commandLink
action="#{emmView.resetDialog2}"
update="dialog2"
immediate="true"
oncomplete="dlg2.show(); return false;">
<h:graphicImage library="images" name="icons/trash_16x16.gif"
title="#{msgs.deleteHeader}"/>
<f:setPropertyActionListener target="#{emmView.dialogMember}"
value="#{tm}"/>
</p:commandLink>
</p:column>
</p:dataTable>
<ui:include src="dialog.xhtml"/>
</h:form>
Code: Select all
<ui:composition ...>
<p:dialog id=dialog2" header="#{msgs.memberDetailsText}" widgetVar="dlg2" closeOnEscape="true" minWidth="400">
<h:panelGrid columns="2"
rendered=" ... condition ...">
<h:selectManyCheckbox id="type" value="#{emmView.resetTypes}"
layout="lineDirection"
required="true" requiredMessage="#{msgs.registerGenderRequired}">
<f:selectItem .../>
<f:selectItem ..."/>
</h:selectManyCheckbox>
<h:message for="type" styleClass="errors"/>
<br/>
</h:panelGrid>
<p:commandButton value=" #{msgs.okText} "
action="#{emmView.resetMemberState(emmView.dialogMember)}"
update="outputdt"
oncomplete="dlg2.hide(); return false;"/>
<p:commandButton value="#{msgs.cancelButtonLabel}"
update="outputdt"
oncomplete="dlg2.hide(); return false;"/>
</p:dialog>
</ui:composition>
Brendan.
Mojarra 2.0.4
PF RC-2.2
Glassfish 3.0.1