6 Replies Latest reply on Jun 17, 2009 5:56 AM by magiccreative

    Richfaces javascript api - why is it not documented?

    magiccreative

      Hi,

      I tried to search if someone has answered that but found nothing.

      Quite often I need to manipulate richfaces components from javascript. For example change tab panel on the client side, to save network use.

      Why such functions like RichFaces.switchTab(...) are not documented and I have to go in code and look for the functionality I need?

        • 1. Re: Richfaces javascript api - why is it not documented?
          ilya_shaikovsky

          And unfortunatelly I could tell even more - it's not safe to use the JS methods which you discovered by looking in Js files and not documented in dev guide. Them could be changed. We should revise it for sure. And major 4.0 version seems a good time for that :)

          • 2. Re: Richfaces javascript api - why is it not documented?
            ilya_shaikovsky

            Thanks for ping us with that question. It's big f-2-f meeting of RF team going right now in Brno (announced at in.relation.to) and we just added this point to planning of 4.0. :)

            Watch the wiki pages which related to RF 4.0 work and add your comments on the features you need.

            • 3. Re: Richfaces javascript api - why is it not documented?
              magiccreative

              Thanks for the timely answer. Of course that is not exactly what I would have enjoyed hearing ;).

              I will try to post the question in another way. There is wonderful documentation for all the components. Nowadays I can say that, because I remember some 2 years ago when documentation was rudimentary.

              But wouldn't it be nice to have in documentation, next to the described components, their functions, styles... a list of "safe" javascript functions supporting the components main functionality?

              For example the tab panel component has important functionality like change tabs, disable tabs and so on. Of course I could achieve that with the properties and functions of the backing beans(seam components for ex.). But sometimes this is overkill. I would rather prefer to call from onclick event a Richfaces.switchTab, Richfaces.disableTab and so on functions. Of course I would do this on client side only for not highly secure data and processes.

              Just remembered another example. In a rich:calendar I needed on click to happen exactly what happens when one clicks on the time in the calendar component - a time selector panel to open. The function was not documented so I hat to look it up and came up with a ondateselect event "Richfaces.getComponent('calendar',this).showTimeEditor();". Is this function not safe as well? And if it is why there is no function which will be there to stay and is documented :).

              Greetings

              • 4. Re: Richfaces javascript api - why is it not documented?
                magiccreative

                It seems you posted while I was writing. I will be keeping an eye on the wiki, thanks.

                • 5. Re: Richfaces javascript api - why is it not documented?
                  ilya_shaikovsky

                  All the methods which stated in documentation are safe to be used. And the API which not present there aren't. Yes you're right for calendar.. We had some gaps in documentation and some API really designed to be used by application developer (like showTimeEditor) but not mentioned in documentation. But it's just single ones which was just lost and not get in docs. But in general - if the method not mentioned in docs - it's not planned to be used externally and could be changed. Almost all the components which was done before 3.0.2 version has no public API.

                  https://jira.jboss.org/jira/browse/RF-841

                  I know how it's looks but unfortunately it's looks as designed and will be revised and changed only starting from 4.0.

                  • 6. Re: Richfaces javascript api - why is it not documented?
                    magiccreative

                    this document is of great help, thank you very much