0

There are two messages given in the div and if we update that div both the messages get updated then how to update that single messages in primefaces below you can find what i've tried so far

 <p:confirmDialog id="deleteDlg" message="Are you sure, you want to delete ?" header="Delete" widgetVar="deleteWidget" closeOnEscape="true" modal="true" draggable="true"> 
<p:commandButton value="Yes" oncomplete="PF('deleteWidget').hide();" id="yes" actionListener="#{searchBean.onDelete}" update=":terminalSearchForm:deleteDlg terminalSearchForm @(.error)">    </p:commandButton>
<p:commandButton value="No" oncomplete="PF('deleteWidget').hide();" update=":terminalSearchForm:deleteDlg"/> 
</p:confirmDialog> 
Yagami Light
  • 1,756
  • 4
  • 19
  • 39

1 Answers1

0

when you want to update something in your page think like you have a tree the deep you want to update the more you want to dig

It's look like this

 <p:someElement id="id1" ....>
  <p:someElement  id="idS1" ....   update=":id1:idS1"   />
  <p:someElement  id="idS2" .... />
 </p:someElement

In my example if i want to update idS1 + idS2 i will say update=":id1" and of corse it will update id1 informations

You can read this post Understanding PrimeFaces process/update and JSF f:ajax execute/render attributes am sure it will help

About your example

 <p:confirmDialog id="deleteDlg" message="Are you sure, you want to delete ?" header="Delete" widgetVar="deleteWidget" closeOnEscape="true" modal="true" draggable="true"> 
  <p:commandButton id="btn1" value="Yes" oncomplete="PF('deleteWidget').hide();" id="yes" actionListener="#{searchBean.onDelete}" update=":terminalSearchForm:deleteDlg terminalSearchForm @(.error)">    </p:commandButton>
  <p:commandButton id="btn2" value="No" oncomplete="PF('deleteWidget').hide();" update=":terminalSearchForm:deleteDlg:btn2"/> 
 </p:confirmDialog>

Feel free to ask for more informations

Community
  • 1
  • 1
Yagami Light
  • 1,756
  • 4
  • 19
  • 39