Spreadsheets does not work in tab view with effects?

UI Components for JSF
Post Reply
User avatar
daniel_r
Posts: 199
Joined: 02 Mar 2009, 16:35

21 Jan 2011, 23:09

I placed a spreadsheet inside a tab view with effects... and it does not work , it looks like it does not fetch the data , all that is displayed is the spreadsheet numbers

for the test i took the code from the showcase, the spread sheet works only if i remove the effects (effect="opacity" effectDuration="normal") from the tab view

I'm using the latest 2.2 snapshot jar from nightly builds

here how it looks like with the effect="opacity" effectDuration="normal"

Image
Primefaces 3.4 , MyFaces 2.0.11
Tomcat 6
Win7 32bit

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

22 Jan 2011, 00:22

Components that do size calculation might now work as expected when inside hidden containers like tabs or dialogs.

Quoting from jquery site;
Why does...

...my slider, Google Map, sIFR etc. not work when placed in a hidden (inactive) tab?

Any component that requires some dimensional computation for its initialization won't work in a hidden tab, because the tab panel itself is hidden via
display: none
so that any elements inside won't report their actual width and height (0 in most browsers).

There's an easy workaround. Use the off-left technique for hiding inactive tab panels. E.g. in your style sheet replace the rule for the class selector ".ui-tabs .ui-tabs-hide" with

.ui-tabs .ui-tabs-hide {
position: absolute;
left: -10000px;
}
resizeMap() will call Google Maps' checkResize() on the particular map.

healeyb
Posts: 365
Joined: 07 Apr 2010, 16:05

12 Apr 2011, 22:04

I've been finding that checkResize() has been re-centreing my map not
where I had intended. This 'save centre - resize - restore centre' seems
to do the trick, and is arguably preferable to the off-left strategy. My
dialog is fired from a commandLink which is in a tabView, so I don't
know if this had anything to do with the unexpected behavior.

It'd be pretty useful to have a p:gmap address= attribute, I'm having to
use the geocoding api via JAX-RS lookups, not pretty.

Code: Select all

<p:dialog onShow="xxmapinit();">

<script ...>
function xxmapinit() {
  var saveCentre = mymap.getMap().getCenter();
  mymap.checkResize();
  mymap.getMap().setCenter(saveCentre);
}
</script>

<p:gmap widgetVar="mymap" ...>
Regards,
Brendan.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 68 guests