11 Replies Latest reply on Nov 15, 2005 3:39 PM by roy.russo

    Refreshing/reloading a portlet

    pedrosacosta

      I've 2 portlets, and i want to refresh only one of them for every 30 seconds. I want to refresh only the portlet, not all the page. Is there any method that do that?

      Thanks

        • 1. Re: Refreshing/reloading a portlet

          for now it is not possible, that would need a technology such as ajax that would allow fine grained update of a window.

          • 2. Re: Refreshing/reloading a portlet
            pedrosacosta

            But it's possible to install AJAX in jboss portal?

            If not, is there another way to refresh portlets?

            And, if i try to use jetspeed, it will help me?

            And last, how can i communicate between portlets? Is it possible in jboss portal?

            • 3. Re: Refreshing/reloading a portlet

              yes it is possible that your portlet uses ajax to do that, it is a feature of the portlet not of the portal.

              yes you can communicate between portlets in 2.2.

              • 4. Re: Refreshing/reloading a portlet
                pedrosacosta

                I can't find jboss portal 2.2. to download

                So, i don't understand the phrase "yes you can communicate between portlets in 2.2" .

                • 5. Re: Refreshing/reloading a portlet
                  • 6. Re: Refreshing/reloading a portlet


                    yes it is possible that your portlet uses ajax to do that


                    How do you get a portlet to refresh itself via AJAX if there is no documented or known way in JBoss Portal of making a request to the portal that asks for a single portlet to render itself?

                    (in 2.0.X only please...)

                    Thanks,
                    Brad

                    • 7. Re: Refreshing/reloading a portlet

                      Your portlet would have to be packaged along with a servlet that handles the AJAX requests. Presumably your rendered JSPs would have to have some sort of refresh mechanism that users can click on to trigger an AJAX request.

                      Using the browser's refresh features will not produce the results you seek.

                      • 8. Re: Refreshing/reloading a portlet
                        bdaw

                        You can learn about communicating between portlets features in 2.2 from webinar record:

                        http://www.jboss.com/services/online_education
                        webinar: JBoss Portal - What's new and improved

                        • 9. Re: Refreshing/reloading a portlet

                           

                          Your portlet would have to be packaged along with a servlet that handles the AJAX requests. Presumably your rendered JSPs would have to have some sort of refresh mechanism that users can click on to trigger an AJAX request.


                          Doesn't the portal render out a whole page at a time? How would I construct a servlet to give me just a single portlet's response (including decorators)? I wouldn't want to to strip out the extra content in a servlet because I can do that with javascript just as well, and thus I could theoretically achieve some kind of AJAX-style behavior without writing a servlet.

                          So how would you implement such a servlet?

                          BTW - with regards to the separate inter-portlet-communication thread that is arising here - keep in mind that you aren't necessarily going to end up with JSR168 portlets if you use an API designed specifically to allow you to communicate with portlets in JBoss - what you will end up with is JBoss Portlets that happen to use the JSR168 API's too. If you would like to be able to deploy any portlets you develop to under JSR 168 portal platforms (say Jetspeed 2, BEA Portal, etc...), then using the PortletSession and possibly the PortletContext are your 'portable' solutions to inter-portlet-communication.

                          Regards.



                          • 10. Re: Refreshing/reloading a portlet

                            what you do usually is that you let your portlet generate a div fragment and then it is updated with some javascript in your portlet that takes the content from a servlet using the so called XmlHttpRequeset.

                            • 11. Re: Refreshing/reloading a portlet

                              Yes. Also, for any of you currently looking at AJAX + Portals, this is a short and simple article that will get you started on how it all works together: http://developers.sun.com/prodtech/portalserver/reference/techart/asynch_rendering.html

                              As for IPC, keep in mind most vendors have their own proprietary workaround to the specs lack of addressing the issue. In other words, everyone has their own IPC API. In 2.2, we follow suit.