2 Replies Latest reply on Oct 23, 2007 4:23 PM by asookazian

    <a4j:form> vs. <h:form> and getter calls

    asookazian

      The following code segment in my .xhtml page does not reload the .xhtml page when I submit this following form in the rich:modalPanel.

      <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>


      The following <h:form> actually calls the getNoteText() method successfully onload of the .xhtml. The <a4j:form> does not call this method. How can I force the <a4j:form> to call the getter method??? thx.

      <!-- submitting below form instead of a4j:form causes this entire Facelet to re-render, and thus lose info... -->
       <h: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"/>
       <h:commandButton value="submit" action="#{noteAction.submit}" onclick="showNoteGraphic();Richfaces.hideModalPanel('mp')"/>
       </h:form>
      


        • 1. Re: <a4j:form> vs. <h:form> and getter calls
          asookazian

          also, I am using a modalPanel for each cell in a dataTable. The Seam app keeps track of the row# and col# and I have a 2D array that stores instances of the Note entity bean in that particular "slot" based on row and col passed to SFSB.

          When a user enters a note, a graphic displays in that cell. If they click that graphic the modalPanel should display with the note for that particular cell/entity in the 2D array.

          So this is why I need the getter method for getNoteText to work... Any ideas would be much appreciated. thx.

          • 2. Re: <a4j:form> vs. <h:form> and getter calls
            asookazian

            I hardcoded the following value in the SFSB:

            private String noteText = "this is hard coded";


            and noticed that this is the value that is showing in the <h:inputText> below. So that means the getter is not called when the modaPanel opens, but the instance variable value is used instead apparently. So how do you make it call the getter method?

            <h: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"/>
             <h:commandButton value="submit" action="#{noteAction.submit}" onclick="showNoteGraphic();Richfaces.hideModalPanel('mp')"/>
             </h:form>