Search code examples
primefacescomposite

outer p:selectCheckBoxMenu visible from composite p:dialog


I have the following scenario :

  • Page.xhtml (p:selectCheckBoxMenu id=sb1)
    1. From page.xhtml I call genericDialog.xhtml
  • genericDialog.xhtml (Composite implementation with p:dialog,etc...)
    1. From genericDialog.xhtml how can I process and update via p:ajax the sb1 component.

Error : javax.faces.FacesException: Cannot find component with identifier "formPessoa:tipoMercado" referenced from "j_idt440:myForm:confirm"

enter image description here

  • From the left side of image in green color I have my composite p:dialog (genericDialog.xhtml)

  • From the right side of image I have in red the selectCheckBoxMenu id=sb1 which I need to reload after saving new data from dialog.

thanks a lot stack members.


Solution

  • After a lot of time to me.... I figured out the issue:

    <p:commandButton id="confirm" value="#{cc.attrs.labelbotao1}" 
       oncomplete="#{cc.attrs.oncompletebotao1}" update="myForm:divmessage" 
       actionListener="#{cc.attrs.actionbeanbotao1}" **ajax="true"**>
    
       <p:ajax update="#{cc.attrs.ajaxupdate1}" process="#{cc.attrs.ajaxprocess1}" 
       listener="#{cc.attrs.listener1}" />
    </p:commandButton>
    

    Two problems:

    • First I need to reference in the composition genericDialog.xhtml the full path to update the component e.g. myform: sb1
    • Second the AJAX on p: commandButton has to be false. This way it does not cancel the p: AJAX update and process.

    I'd like to hear some other opinions or fixes, etc.