4 Replies Latest reply on May 6, 2008 5:00 PM by Sergey Smirnov

    Degradable AJAX

    Stephan B Newbie

      Hi richfaces users,

      I'm considering RichFaces for enhancing my web site. But I still want users without/with disabled javascript to be able to use it.

      How good is RichFaces when it comes to being degradable?

      Another thing that recently came to my mind was do do a "check" if javascript is enabled or not (this could happen through a sort of "ping" when loading the site). If no ping is received, disabled Javascript is assumed, saved into a session bean and each jsf tag could react with the "rendered" attribute accordingly.

      Does that make sense?


        • 1. Re: Degradable AJAX

          Since richfaces it made for rich ajax applications it seems off to try to make it work without JS.

          What benefit could you possibly get without JS?

          • 2. Re: Degradable AJAX
            Stephan B Newbie

            Well the main reason is simply to keep the site functioning when the user does not have Javascript.

            a) When I got an AJAX form, I still want it to submit without JS
            b) When I have an AJAX dialog it might "turn into" a popup for non-JS
            c) When I got a drag-and-drop selection it should degrade to checkbuttons

            To my understanding all "big" sites keep the site 100% usable without JS enabled.

            You see?

            So I am wondering how I could manage that with RichFaces, hence, my possible approach...

            The DOJO toolkit apparently has that functionality, I just don't like to integrate it into JSF when there is already a AJAX library specially for it. But the degrading functionality is very important to me...

            • 3. Re: Degradable AJAX
              Stephan B Newbie

              I'll add a quick & simple example to my idea:

              Image a web site has a few inputs and each input has question mark-image next to it. Now what could happen with JS that by clicking the icon a cool AJAX dialog/window with further information appears.

              When JS is disabled, that wouldn't work.

              So I thought about adding 2 JSF tags.
              1.) The icon with the RichFaces support
              2.) The icon with the link to the popup

              When the user enters the site, an AJAX call could notify the server, that the user has JS enabled. The 1) tag could have something like rendered="#{Env.JsEnabled == true}" and the 2) tag accordingly rendered="#{Env.JsEnabled == false}".

              I'm just not sure if that makes sense at all :-)

              • 4. Re: Degradable AJAX
                Sergey Smirnov Master

                RichFaces has a wish list. Add your wish and wait while it takes a reasonable number of votes to speak about it seriously