1 Reply Latest reply on Jul 1, 2008 3:27 AM by rituraj_tiwari

    Seam Remoting: Strange behaviour on initial request

    rituraj_tiwari

      Folks,
      My application's home page redirects to a login page. The login page has a two-step process:



      1. User enters their Id and hits enter. Server receives id, does some processing

      2. User is presented a second page where they complete their login. My application is doing open id.



      I am trying to use Seam Remoting for this. My login page has the following form:


      <form action="#">
          <table>
              <tr>
                  <td>
                  <h:inputText id="claimedId"  
                      style="background: white url('../img/openid-logo-small.gif') no-repeat scroll 0pt 50%; padding-left: 18px;"/>
                  </td>
                  <td>
                      <h:commandButton id="openIdLogin" value="Log in" onclick="beginLogin('openid')"/>
                  </td>
                  <td id="progress_indicator"></td>             
              </tr>
          </table> 
      </form>



      The beginLogin() function performs the Seam remoting interaction:



      function beginLogin(loginType)
      {
          // Set the conversatoin id
          Seam.Remoting.getContext().setConversationId(#{conversation.id});
          // start the progress indicator
          jQuery("#progress_indicator").html("<img src='../img/bigrotation.gif'/>");
          
          var sClaimedId = jQuery("#claimedId").attr("value");
          
          Seam.Remoting.setDebug(true);
          // submit the claimed id
          Seam.Component.getInstance("LoginBean").beginLogin(sClaimedId, loginType, beginLoginCallBack);
      }




      When the user enters their id and submits, I see my LoginBean.beginLogin() method on the server being duly invoked. However, my callback is not invoked and there is no remoting response in the debug window. Instead, the browser is redirected to the same page with additional query arguments:


      claimedId=raj.tiwari.myopenid.com&openIdLogin=Log+in#


      When the user re-enters their open id on this page, once again, the login bean is invoked and this time things work.


      Can any remoting experts help me understand why Seam does not like my initial request?


      Thanks.


      -Raj