2 Replies Latest reply on Oct 9, 2009 2:24 PM by Dmitry Sachin

    Seam Remote method returns object instead of primitive

    Dmitry Sachin Newbie

      Hello,


      I am having troubles setting a var in JavaScript with a returned value from a @WebRemote annotated method.


      method:


      private int value = 50;
      
      public int getValue()
          {
              return value;
          }



      java script:



      var X = Seam.Component.getInstance("draw").getValue();
      



      this gets me an Exception in Firefox 3.5:



      uncaught exception: [Exception... "An invalid or illegal string was specified"





      I checked the value with JavaScript "typeof" and its an "object". 
      JavaScript ".valueOf()" returns [object Object].







      but Seam Debug Window says:



      <envelope><header><context><conversationId>37</conversationId></context></header><body><result id="0"><value><number>50</number></value><refs></refs></result></body></envelope>



      so value is actually a number. Any thoughts? Firefox issue?