2 Replies Latest reply on Dec 22, 2009 12:20 AM by Tim Evers

    error with conversation id in xhtml

    willie slepecki Newbie

      my code has an ajax call that needs to hit the current conversation.  my javascript looks like this




      convid = jQuery("input:regex(id, .*convid.*)").val();
      Seam.Remoting.getContext().setConversationId(convid);
                     var menu = Seam.Component.getInstance("menuBackingEJB");
                    menu.process(keyString, returnCall, exceptionHandler);




      then in my xhtml i have this




      <h:inputHidden id="convid" value="#{conversation.id}" />





      everything runs fine except when the ajax return method is fired.  when that happens, i get this in the log




      2009-12-14 14:12:14,710 SEVERE [javax.faces.component] (http-localhost%2F127.0.0.1-8080-6) /mail/scan.xhtml @13,60 value="#{conversation.id}": Property 'id' not writable on type java.lang.String



      any ideas?

        • 1. Re: error with conversation id in xhtml
          willie slepecki Newbie

          does anyone have an idea about this?  i tried to get this to resolve based on evaluating an el expression in with seam remoting but apparently that is still shut off due to security reasons. 

          • 2. Re: error with conversation id in xhtml
            Tim Evers Master

            I haven't spent much time on this so what I'm about to say may not be 100% correct or even solve your problem, but...here goes.


            This is about JSF components and how they work.


            You are using a h:inputHidden the key here is that it is an 'INPUT'.


            What this means is that on a submit it will try to update the server with the value stored in this input on the client side. So, esentially this is what is happening when you do the Ajax call.


            During the update model phase the inputHidden component is going to try call #{conversation.setId('value')} where 'value' equals what the client side value was for the inputHidden component. Hence why you are getting the error.


            Obviously this is not what you want to do, so you need to adjust your design.


            Just don't use a hiddenInput to store your conversationId, just do this:


            Seam.Remoting.getContext().setConversationId(#{conversation.id});
            var menu = Seam.Component.getInstance("menuBackingEJB");
            menu.process(keyString, returnCall, exceptionHandler);