Clear form in p:dialog on close after failed action/method call

Try this:

  1. Put your dialog inside a form (dialogInputForm)

  2. Add the attribute update=":dialogInputForm"

  3. Nest the resetInput tag within the button that opens the dialog and specify the target as the just created form

The commandButton:

<p:commandButton process="@this" actionListener="#{bean.prepare}" update=":dialogInputForm" oncomplete="thirdPartyDialog.show()" value="Open Input Dialog" >
     <p:resetInput target=":dialogInputForm" />
</p:commandButton>

And the form which contais the dialog

<h:form id="dialogInputForm" >
 ... your dialog ...
</h:form>