4 Replies Latest reply on Oct 26, 2007 12:03 AM by mgrouch

    how to handle a form with input in modalPanel?

    Arbi Sookazian Master

      I was posting on richFaces users forum but no luck. How can I implement this use case in JSF/Seam? Does anybody else use a modalPanel with inputText populated on open?

      Is there a Seam example of the following use case?:

      1) multiple column dataTable
      2) user clicks 'no' on a radioButton in a cell
      3) rich:modalPanel pops up with inputText and submit button in an
      a4j:form
      4) inputText is populated with data return by getter method of inputText (if possible???)
      5) setter method is called when user inputs data and submits
      6) XHTML page should not refresh (a4j:form solved this, h:form re-renders XHTML)
      7) For that particular cell in the dataTable, store the inputted data for note in a 2D array of entity beans in the appropriate NoteArray[row][col] location for retrieval later
      8) repeat as many times as required by user...

      The a4j:form is calling the getter method for the inputText when the XHTML is rendered. That getter method is NOT being called when the modalPanel opens. I need to populate the modalPanel when it opens. How can I do this? The functional requirement here is that the user needs to be able to edit a previously entered note in a particular cell in the dataTable.

      Do I need to use another XHTML page to solve this use case? (the popup must be modal, so if I popped up another XHTML/browser, that probably won't work...)

      Any help would be much appreciated, as this use case is becoming too much work for a simple concept/use case... thx.

      <rich:modalPanel id="mp" minHeight="200" minWidth="450"
       height="200" width="500" zindex="2000">
       <f:facet name="header">
       <h:outputText value="#{noteAction.header}" />
       </f:facet>
       <f:facet name="controls">
       <h:graphicImage value="/img/icon_edit.gif" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
       </f:facet>
      
       <a4j:form id="a4jForm">
       <h:inputText id="noteText" value="#{noteAction.noteText}"/>
       <h:inputHidden id="rowIndex" value="noteAction.rowIndex"/>
       <h:inputHidden id="colName" value="noteAction.colName"/>
       <h:inputHidden id="siteId" value="noteAction.siteId"/>
       <h:inputHidden id="employeeNumber" value="noteAction.employeeNumber"/>
       <a4j:commandButton value="submit" action="#{noteAction.submit}" onclick="showNoteGraphic();Richfaces.hideModalPanel('mp')"/>
       </a4j:form>
      
      </rich:modalPanel>