7 Replies Latest reply on Aug 5, 2008 6:02 AM by alexanderbelov

    How to use JavaScript API?

      I try to call javascript api functions (from documentation) for rich:calendar.
      $('id').component.enable() doesn't work. And other functions too.
      How should I enable\disable calendar?

        • 1. Re: How to use JavaScript API?
          ilya_shaikovsky

          Sorry.. This feature still wasn't included.. Our doc team fault.. It's planned to add in future.

          currently you should use calendar disabled attribute and change it via ajax request.

          • 2. Re: How to use JavaScript API?

            Hmm... I think it is not very good idea to change component state via ajax. Too many requests make application too slow.
            Thank you for your answer. I'll write my own javascript functions to work with calendar.

            • 3. Re: How to use JavaScript API?
              davidabrooks

              Hello, some time has gone by and I was wondering if there was a way now to enable the calendar via javascript?

              Also, would you please post the link to the wiki for voting on future features?

              thanks

              • 4. Re: How to use JavaScript API?
                ilya_shaikovsky

                AlexanderBelov, you could optimize ajax request to make it really fast..

                DavidABrooks, http://wiki.jboss.org/wiki/RichFacesFuture

                • 5. Re: How to use JavaScript API?

                  Do you want to say that you demo application works fast? Or it is not optimized? I think that Javascript API works faster then request to server.

                  • 6. Re: How to use JavaScript API?
                    ilya_shaikovsky

                    Somewhere the ajax action components not optionally configured in richfaces-demo in order not to make the code too complex and just show the basic attributes and usage ways. Optimization attributes described in our guide and Ajax Attributes demo section.

                    • 7. Re: How to use JavaScript API?

                      I know them. I work with Richfaces more then a year. But request to server will never work so fast as client Javascript code. That's why it is very important to make client API for Richfaces component.
                      It is really simple to make Ajax calls with your library. What's why I like it and use in my applications. But often I have to make Ajax calls for very simple things. For example, I have a table and toolbar with buttons "Add", "Edit", "Delete". Accessibility of this buttons depends on user rights, data in current row and so on. I have to update full toolbar on every change of current row.
                      So, I have to do too many Ajax calls. And if there are many active users of application then it is very hard to server.
                      So it would be usefull to have simple Javascript API to work with components and improve performance.