2 Replies Latest reply on Dec 11, 2007 1:39 PM by asookazian

    Using page parameters instead of Seam remoting

    asookazian

      I'm currently using Seam remoting to pass facelet dataTable variables to a SFSB.

      function setNoteData(rowIndex, colName, siteId, employeeNumber, icomsAccountApproved, securityLevelApproved, adjustmentLimitApproved) {
       Seam.Component.getInstance("noteAction").setNoteData(rowIndex, colName, siteId, employeeNumber, icomsAccountApproved, securityLevelApproved, adjustmentLimitApproved);
       }


      When I placed a debug stop in Eclipse on the first line of the @WebRemote method and ran the test case, I get the following exception after I step over the first line of code:

      Caused by java.lang.IllegalStateException with message: "could not acquire lock on @Synchronized component: noteAction"


      What does this mean exactly and why does it happen? Is it normal to not be able to place debug stops in a @WebRemote method? (sorry in advance if this is a stupid question).

      I'd prefer to use Seam page parameters to transfer these variables to the SFSB. I'm assuming that is the preferred method of data transfer in the PAGE or REQUEST scope when user submits the form. I've read the Seam ref pdf starting on page 78. Are there any good examples on how to implement this (e.g. the Seam distro examples)?

        • 1. Re: Using page parameters instead of Seam remoting
          asookazian

          In the Yuan Seam book, it states on pg. 161 that "You can trigger any back-end bean method at page load time in the pages.xml file. That is called page action."

          Also on page 159 he talks about invoking setter method(s) when the URL is loaded with an appended pid (parameter) value.

          I'm not interested in doing anything at page load time, only when user submits the form to pass params.

          In my case I have one xhtml and submitting to one SFSB. How do I code/configure to achieve passing params successfully from JSF to SFSB? And what is the difference b/n f:param and Seam params?

          • 2. Re: Using page parameters instead of Seam remoting
            asookazian

            Well I just did a simple POC using f:param.

            <h:form>
             <h:commandLink actionListener="#{test.testParams}">
             <h:outputText value="#{test.defaultText}" />
             <f:param name="column" value="name" />
             </h:commandLink>
             </h:form>


            public void testParams() {
             // TODO Auto-generated method stub
             FacesContext facesContext = FacesContext.getCurrentInstance();
             String columnName = (String)facesContext.getExternalContext().getRequestParameterMap().get("column");
             log.info("columnName = " + columnName);
             }


            Now the complication is that the f:param values need to be submitted from a rich:modalPanel component. So I may have to pass the param values from the launch code:

            Richfaces.showModalPanel('mpEmployeeSubmit',{width:450, top:200});