8 Replies Latest reply on Oct 15, 2007 1:30 AM by jiangliu

    <rich:gmap> reRendering problem

    jiangliu

      Hi all,

      I am facing a problem of <rich:map> now. I have included a <rich:map> component within a <a4j:outputPanel> to dynamically rendering/reRendering the map content(s).

      At the first time i visit the page, all map components are generated correctly. However, when i do something to reRender the outputPanel, the whole page is gone (checked from browser, it contains no HTML source) and the browser is printing: "read www.google.com" at the bottom (i am using Firefox 2).

      So could anyone tell me is that true that <rich:map> component can not be reRendered or this is a RichFaces issue?

      Thanks in advance!

        • 1. Re: <rich:gmap> reRendering problem

          Short answer: rich:gmap cannot be reRendered.

          This component is based on the Google Map API. It uses document.write during the DOM creation. This fact automatically disables the ability to be reRendering.

          This is a known bug, and, probably, Google will fix it in the future. However, the Google Map API has everything that is need to show the dynamic content without full map re-rendering.

          • 2. Re: <rich:gmap> reRendering problem
            jiangliu

            Hi SergeySmirnov,

            Thanks a lot for your reply.

            But, my problem is, my dynamic page requires two factors to be reRendered:

            1), details of a map
            2), the number of map component(s)

            I think to use Google API can probably satisfy my first factor, but how could i reRender the number of Google map component(s) within a same page?

            Thanks a lot!

            • 3. Re: <rich:gmap> reRendering problem

              What does it mean "the number of Google map component(s)"?

              • 4. Re: <rich:gmap> reRendering problem
                jiangliu

                for example, 1st time my page could look like:

                ---------
                map_1(lat, lng,...);
                map_2(lat, lng,...);
                map_3(lat, lng,...);
                ---------

                When i reRender the page, it could be:

                ---------
                map_1(lat, lng,...);
                map_2(lat, lng,...);
                map_3(lat, lng,...);
                map_4(lat, lng,...);
                map_5(lat, lng,...);
                ---------

                Thanks

                • 5. Re: <rich:gmap> reRendering problem

                  Creating iframes on the fly might help

                  • 6. Re: <rich:gmap> reRendering problem
                    jiangliu

                    Thanks for you suggestion :)

                    We actually put <rich:map> at a mapPage.xhtml page and in the a4j:outputPanel, we use <ui:include> to include this map page.

                    the logic is:

                    <a4j:outputpanel>
                    <ui:repeat #{...} ...>
                    <ui:include ...>
                    <f:param ...>
                    </ui:include>
                    </...>
                    </a4j>

                    I guess this does the same thing as iframe, but i still got the "error".

                    • 7. Re: <rich:gmap> reRendering problem

                      iframe is a different page inside the parent page. ui:include is a content within the same page.

                      I recommend you to try using the original Google Map API code instead of rich:gmap. It will give you more flexibility and better understanding how it works inside.

                      • 8. Re: <rich:gmap> reRendering problem
                        jiangliu

                        Thanks a lot Sergey Smirnov, we probably have to look at the Google API code. :)