Clear form values in dialog

UI Components for JSF
Post Reply
fiktion
Posts: 100
Joined: 25 Aug 2010, 17:47

16 Nov 2010, 20:31

I have a form within a dialog. No matter what I type into the InputFields the values are always cached if I submit the form or not. I have researched and found a few solutions online but they don't seem to be working within a dialog. Has anyone been successful doing this and could explain to me the best approach to clearing out a form within a dialog?

callahan
Posts: 768
Joined: 27 May 2010, 22:52

17 Nov 2010, 01:41

One approach would be to use a method such as theBean.handleOpenDialogClicked to clear/initialize the dialogs data:

Code: Select all

<p:commandButton value="Open Dialog" action="#{theBean.handleOpenDialogClicked}"
  update="theDialogContent" oncomplete="theDialogVar.show()"/>

<p:dialog id="theDialog" widgetVar="theDialogVar">
  <p:outputPanel id="theDialogContent">
    ...
  </p:outputPanel>
</p:dialog>

jlferreira
Posts: 43
Joined: 16 Nov 2010, 17:52

03 Dec 2010, 18:09

How could I do that in an example like this?
Thanks.
Eclipse Helios.
JSF-2.0 (Mojarra 2.1.0-b11).
GlassFish 3.1.
PrimeFaces 2.2.1
EclipseLink 2.1.x - EclipseLink 2.1.x.
PostgreSQL 9.0

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 19 guests