4 Replies Latest reply on Feb 12, 2007 3:24 PM by tony.herstell1

    doco - 18.2.2. Seam.Component

    tony.herstell1

      18.2.2. Seam.Component
      The Seam.Component Javascript object provides a number of client-side methods for working with your Seam
      components. The two main methods, newInstance() and getInstance() are documented in the following sections
      however their main difference is that newInstance() will always create a new instance of a component
      type, and getInstance() will return a singleton instance.

      Seam.Component.newInstance()

      ...

      var customer = Seam.Component.newInstance("customer");



      I think this has been deprecated?


      Image image = (Image)Component.getInstance("image", true);

        • 1. Re: doco - 18.2.2. Seam.Component
          shane.bryzak

          No? It's javascript, there is no deprecation.

          • 2. Re: doco - 18.2.2. Seam.Component
            tony.herstell1

            Has it been removed then?

            Image image = Seam.Component.newInstance("image");

            Just doesn't compile...

            There is no newInstance in Component.

            • 3. Re: doco - 18.2.2. Seam.Component
              gavin.king

              Doesn't *compile*?? there is no "compile" in js.

              • 4. Re: doco - 18.2.2. Seam.Component
                tony.herstell1

                SLAPs Self... Sorry.

                The section is for Javascript.

                Had I RTFM or even read your responses better I would have seen that!

                I was doing it in code...

                 Image image = (Image)Component.getInstance("image", true);
                 image.setName(fileName);
                 image.setType(contentType);
                 image.setThumbnail(inputFileAsBytes);
                 image.setImage(inputFileAsBytes);
                 image.setVersion(0);
                



                As an aside... I managed to get JBoss to take over 15 minutes to run up yesterday !

                I included a Seam component as a class instance as apposed to injecting it.

                i.e.
                I did this (thinking I will need an image object to put my image into!!)
                Image image = new Image();

                Now I am using:
                Image image = (Image)Component.getInstance("image", true);
                and JBoss runs up in only 1 minute again.


                Interesting feature!