4 Replies Latest reply on Feb 2, 2009 4:00 PM by supernovasoftware.com

    Richfaces and using applet to upload data form a serial conn

      Has anyone any success with using an applet with Richfaces?

      I need to download measurement data from a warehouse into my system.
      It will be directly connected to a serial port on a laptop running my Seam/Richfaces base inventory system.

      I would rather not use the applet for visual display.

      I only want it to grab the data, send it to the server and rerender part of my page when the results have been received.

      Any suggestions?

        • 1. Re: Richfaces and using applet to upload data form a serial
          nbelaevski

          Hi Jason,

          There are two known JIRA issues about APPLETs:
          https://jira.jboss.org/jira/browse/RF-2335 - coding error that has been already fixed
          https://jira.jboss.org/jira/browse/RF-2374 - still reproducible

          • 2. Re: Richfaces and using applet to upload data form a serial

            Thanks for the links to the JIRA issues. I don't think these will affect me.

            I would greatly appreciate it if anyone could offer some technical advice on how to integrate the applet with RF.

            Here is a first pass at what I want to do.

            1. Display a list of trucks to be loaded using jBPM and Seam.
            2. When a user clicks a button next to the truck to upload measurement data the applet will be triggered to connect to the device and send the data to the server.
            3. Once the data has been accepted the page should rerender and display the measurement data for approval.

            I would rather the applet be totally nonvisual and rely on RF entirely for the display.

            I have no experience at all with applets let alone how they might interact with Richfaces.

            Here are my ideas. Some of these might not even be possible. Please comment on the possible strategies.

            I need to pass a small amount of data along with the measurement data so it can be attached to the correct truck.

            What is the best way to get this data to the applet from a JSF action?
            1. Use JavaScript to call the applet add pass the parameter via JavaScript.
            2. Create an applet for every line in the datatable and render a parameter in the object tag.

            How can I get the applet to call a JSF action or rerender part of the page once the upload is complete?

            • 3. Re: Richfaces and using applet to upload data form a serial
              nbelaevski

               

              "supernovasoftware.com" wrote:
              What is the best way to get this data to the applet from a JSF action?
              1. Use JavaScript to call the applet add pass the parameter via JavaScript.
              2. Create an applet for every line in the datatable and render a parameter in the object tag.

              That's certainly dependent on the way how applet is designed. Personally I do not like the idea of having separate APPLET instance for each table row.

              "supernovasoftware.com" wrote:
              How can I get the applet to call a JSF action or rerender part of the page once the upload is complete?

              Use a4j:jsFunction to build such function and call it from applet.

              • 4. Re: Richfaces and using applet to upload data form a serial

                Thanks for the suggestion.

                From a little research it looks fairly easy to call an applet via JavaScript or to call JavaScript from an applet.

                I agree about having a separate applet instance for each table row being a bad idea.

                I will post some code samples when I get this working.