TheCoder4eu / BootsFaces-OSP

BootsFaces - Open Source Project
Apache License 2.0
246 stars 102 forks source link

no refresh for b:tab against p:tab with p:gmap #205

Closed Kristover closed 5 years ago

Kristover commented 8 years ago

Hi, i encounter a problem with a distinctive comportment between p:tab and b:tab when it is the second tab (not active one) and where you put a gmap. Let's try the following code : If you click on 2nd p:tab, gmap is displaying. If you click on 2nd b:tab, the gmap is not displaying ?

      <h:form>
         <b:row><b:column offset="2" col-lg="8">
            <b:tabView>
                <b:tab title="Test"></b:tab>
               <b:tab title="Test with b">
               <b:panel style="height: 400px">
                   <p:gmap center="49.005268,2.113863" type="ROADMAP" zoom="14" style="width:300px;height:300px"/>
               </b:panel>
               </b:tab>
            </b:tabView>
        </b:column></b:row>

        <b:row><b:column offset="2" col-lg="8">
           <p:tabView activeIndex="0" style="height:500px; width:100%;">
               <p:tab title="Test" ></p:tab>
               <p:tab title="Test with p" >
                    <p:gmap center="49.005268,2.113863" type="ROADMAP" zoom="14" style="width:300px;height:300px"/>
               </p:tab>
            </p:tabView>
        </b:column></b:row>
  </h:form>

of course need to add following to work...

<script src="http://maps.google.com/maps/api/js?sensor=true" type="text/javascript"></script>

Thanks in advance for any advice. Regards

stephanrauh commented 8 years ago

I managed to reproduce the bug.

stephanrauh commented 8 years ago

Currrently we're busy releasing version 0.8.0, so I didn't find the time to investigate this issue further.

Kristover commented 8 years ago

Hi again, a little poke. Have you anytime to investigate for this bug plz ? because this functionality (near user localization with gmap) is an interresting expected feature.

Thanks in advance.

stephanrauh commented 8 years ago

@Kristover Thanks for the reminder. It's important for us to know which features are really needed and which are just "nice to have". As another guy recently said, it's the squeaky wheel that gets the grease.

As far as I remember, this is a really nasty bug, but I'll have a look at it again. If you don't hear from me within the next couple of weeks, don't hesitate to poke me again :).

geopossachs commented 5 years ago

I have found a same old bug in primeface too https://github.com/Rapster/primefaces/commit/357fdd9393288e88cd640d966debe0bd94f5bf82

But why is this commit where a solution?

I inspect the code and find gmap is a kind of DeferredWidget. In the Background it call _render() for the gmap child if the p:panel is changed

In the definition of PrimeFaces.widget.DeferredWidget i found we need an outer div container with a class ui-hidden-container https://github.com/primefaces/primefaces/blob/a431161884c09155f860dd3c62f1d929982a639d/src/main/resources/META-INF/resources/primefaces/core/core.widget.js - line 243

The definition of the global helper PrimeFaces.invokeDeferredRenders is in https://github.com/primefaces/primefaces/blob/c6a754768d525719d2116beb0ec1484fdb08e875/src/main/resources/META-INF/resources/primefaces/core/core.js - line 552

So i add in my commit to the out div container the primeface class ui-hidden-container and a call by event for PrimeFaces.invokeDeferredRenders(outer-div-container-id)

stephanrauh commented 5 years ago

Solved by #1076. Thank you very much, @geopossachs.

I'll upload BootsFaces 1.4.2-SNAPSHOT in a minute. If you're still listening after such a long time - your PR has been pending for three months - please run a test with BF 1.4.2-SNAPSHOT and confirm the bug has been solved.

Thanks in advance, and greetings to Saxonia! Stephan