4 Replies Latest reply on Jun 29, 2009 3:54 PM by asookazian

    need to customize rich:progressBar to show 100% width of pic

    asookazian

      We have a use case which requires use to use a progressBar-like component. The difference is that we want to show the orange/yellow animated GIF/JPG at 100% the entire time of the request (i.e. no incremental widening of the animated GIF; it's set to full width from the start of the AJAX request).

      I tried setting the minValue and maxValue both to 100 and it doesn't work as expected (nothing is rendered when I click button to start the request).

      Is there an attribute/config for this and if not, is there another RF component that we can use?

      Otherwise, we can get or create an animated GIF and super-impose "Processing..." on top of it until the component's method completes and/or returns a value.

        • 1. Re: need to customize rich:progressBar to show 100% width of
          nbelaevski

          Hi,

          Set value="100" and maxValue="100" by button click.

          • 2. Re: need to customize rich:progressBar to show 100% width of
            asookazian

            In ProgressBarBg class, I see the following method:

            /**
             * <P>
             * Paints fixed progress bar background.
             * </p>
             */
             protected void paint(ResourceContext context, Graphics2D g2d) {
             restoreData(context);
             Color progressbarBackgroundColor = progressbarBasicColor;
             Color progressbarSpiralColor = adjustLightness(progressbarBasicColor, 0.2f);
             Color progressbarShadowStartColor = overwriteAlpha(adjustLightness(progressbarBasicColor, 0.7f), 0.6f);
             Color progressbarShadowEndColor = overwriteAlpha(adjustLightness(progressbarBasicColor, 0.3f), 0.6f);
             g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
             g2d.setColor(progressbarBackgroundColor);
             g2d.fillRect(0, 0, dim.width, dim.height);
             g2d.setColor(progressbarSpiralColor);
             for (int k : new int[] { -24, 0, 24 }) {
             g2d.fillPolygon(new int[] { 0, 24, 24, 0 }, new int[] { 24 + k, k, 12 + k, 36 + k }, 4);
             }
            
             // paint a shadow in the form of semi-transparent gradient
             g2d.setPaint(new GradientPaint(0, 0, progressbarShadowStartColor, 0, 7, progressbarShadowEndColor));
             g2d.fillRect(0, 0, dim.width, 7);
             }


            g2d is a local variable and the method returns void. I don't understand where this method is called/used (possibly from a class which extends this class b/c the method is declared as protected scope).

            so what happens with this g2d object? I figured I may be able to use this code somehow for my purposes...

            • 3. Re: need to customize rich:progressBar to show 100% width of
              nbelaevski

              This method draws progress bar background image.

              • 4. Re: need to customize rich:progressBar to show 100% width of
                asookazian

                 

                "nbelaevski" wrote:
                Hi,

                Set value="100" and maxValue="100" by button click.


                I am currently trying this and will let you know. thx.