2 Replies Latest reply on Aug 6, 2009 10:03 AM by bogdan.toma

    rich:suggestionbox in modalPanel

      Hi all!

      I have a small problem regarding rich:suggestionbox.
      In the code below i have a link which displays a modalPanel using ajax.
      My problem is that the page containing modalPanel is submitted(refreshed) before displaying the modalPanel.
      If i remove rich:suggestionbox the modalPanel is displayed and the page is not submitted(refreshed).

      Any ideas why ?

      Thank you.

      <a4j:form>
       <a4j:commandLink
       action="#{receptionHomeAction.showAddPatientAppointmentModalPanel()}"
       value=">>" ajaxSingle="true"
       reRender="addPatientAppointmentModalPanel" status="commonstatus"
       style="text-decoration: none;" />
      
       <rich:modalPanel id="addPatientAppointmentModalPanel" width="360"
       height="260"
       showWhenRendered="#{receptionHomeAction.displayAddPatientAppointmentModalPanel}">
      
       <ui:define name="label">Pacient</ui:define>
       <h:inputText id="criteria"
       value="#{receptionHomeAction.selectedPatientName}" />
       <rich:suggestionbox for="criteria"
       suggestionAction="#{receptionHomeAction.filterPatients}"
       var="suggestedPatient" width="350"
       fetchValue="#{receptionHomeAction.editedPatientAppointment.patient.fullName}"
       id="suggestionBox" ajaxSingle="true" status="commonstatus">
       <h:column>
       <h:outputText value="#{suggestedPatient.lastName}" />
       </h:column>
       </rich:suggestionbox>
      
       <center><a4j:commandButton value="Inchide"
       action="#{receptionHomeAction.hidePatientAppointmentModalPanel}"
       reRender="addPatientAppointmentModalPanel" ajaxSingle="true" />
       </center>
       </rich:modalPanel>
      
       </a4j:form>


        • 1. Re: rich:suggestionbox in modalPanel
          ilya_shaikovsky

          modal should have it's own form inside. (and be outside of external one)

          • 2. Re: rich:suggestionbox in modalPanel

            Hi thank you for replying.
            I've changed the code, but i'm having the same result.

             <a4j:form>
             <a4j:commandLink
             action="#{receptionHomeAction.showAddPatientAppointmentModalPanel()}"
             value=">>" ajaxSingle="true"
             reRender="addPatientAppointmentModalPanel" status="commonstatus"
             style="text-decoration: none;" />
             </a4j:form>
             <rich:modalPanel id="addPatientAppointmentModalPanel" width="360"
             height="260"
             showWhenRendered="#{receptionHomeAction.displayAddPatientAppointmentModalPanel}">
             <a4j:form>
             <h:inputText id="criteria"
             value="#{receptionHomeAction.selectedPatientName}" />
             <rich:suggestionbox for="criteria"
             suggestionAction="#{receptionHomeAction.filterPatients}"
             var="suggestedPatient" width="350"
             fetchValue="#{receptionHomeAction.editedPatientAppointment.patient.fullName}"
             id="suggestionBox" ajaxSingle="true" status="commonstatus">
             <h:column>
             <h:outputText value="#{suggestedPatient.lastName}" />
             </h:column>
             </rich:suggestionbox>
            
             <center><a4j:commandButton value="Inchide"
             action="#{receptionHomeAction.hidePatientAppointmentModalPanel}"
             reRender="addPatientAppointmentModalPanel" ajaxSingle="true" />
             </center>
             </a4j:form>
             </rich:modalPanel>