3 Replies Latest reply on May 24, 2006 10:29 AM by gavin.king

    Updating JSF components via Seam remoting...

    bkyrlach

      I have a stateful session bean with a method annotated with @WebRemote that returns a string which is being used to dynamically update a h:selectOneListbox. However, because the options didn't exist when the page was initially rendered (passed through the facelets view resolver), when I attempt to submit the form, the page fails validation.

      Is there a way to update the servers knowledge of the rendered view to contain the newly created options?

        • 1. Re: Updating JSF components via Seam remoting...
          gavin.king

          No, because the component tree is kept in a serialized form in the page.

          • 2. Re: Updating JSF components via Seam remoting...
            bkyrlach

            Well, in that case, would it be possible for me to pass the serialized form to my @WebRemote method, deserialize it, update the object graph, and reserialize it, and update the page with the new version of the serialized form?

            Also, if I changed

            <context-param>
            <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
            <param-value>client</param-value>
            </context-param>

            to save state on the server, would that give me a way to do what I want? It seems as if this should be possible somehow. One of the greatest uses for AJAX is to update form fields with dynamicall retreived information. I really like the way that Seam integrates with AJAX so nicely, it'd be great if I could get this to work.

            Thanks for all your help.

            • 3. Re: Updating JSF components via Seam remoting...
              gavin.king

              I don't think either of these things would work, no.