popup problems with p:calendar in p:tabslider

UI Components for JSF
Post Reply
timm25
Posts: 35
Joined: 20 Nov 2009, 14:25

28 May 2010, 14:39

Hi,

i have a a tabslider with two tabs. Each tab has a form. In each form I include a p:calendar component. Strange thing is that in the first tab all works fine, but in the second tab not. The popup of the calendar is not working here.

I tried it with inline mode: it worked. So the problem is the popup.

Any idea why the popup is not working?

Cheers

Timm

JSF Mojarra 1.2, PrimeFaces 1.0.2, Jboss 4.2.3, Facelets

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

30 May 2010, 14:38

Hi,

I think popup loses it's position when tab is moved, I've checked with firebug and dom element that belongs to the calendar is positioned at a hidden place inside a tab.

Please create an issue for this so we can have a look in detail, for now as you've tried workaround would be to use it in inline mode.

timm25
Posts: 35
Joined: 20 Nov 2009, 14:25

31 May 2010, 09:05


mikloman
Posts: 27
Joined: 18 Nov 2009, 00:23

31 May 2010, 20:10

The same is for the tabview-module. If the calendar isn't on the first panel, the position will be lost. I think the problem is, that the "new YAHOO.widget.Overlay"- function is called, when the jsf-components are rendered. But at this time, the script which creates this tabviews isnt called. So the position, which is read from the DOM in this function, isn't the correct one. It take this one, where all 3 tabs are each under and not in tabview.
Would it be possible to call this function when the whole page is loaded??

Greats
Mikloman

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

01 Jun 2010, 01:45

I'm not sure, I think every calendar has it's calendar overlay popup initialized properly, we can check out with firebug if dom element is created properly (it was the case with tabslider), problem is with location, I think I can be able to mix with repositioning the popup with the icon before showing. Hopefully that will fix it.

mikloman
Posts: 27
Joined: 18 Nov 2009, 00:23

02 Jun 2010, 15:45

I think I will have a easy solution where overall should works. There is one config-parameter in the Overlay, which will realign the overlay for a defined trigger.

From YUI 2: Api

The 4th entry is an optional array of event names, or Custom Event objects, which should trigger re-alignment of the Overlay with the currently configured context element. For example:

[contextId, overlayCorner, contextCorner, ["beforeShow", "windowResize"]]

Will re-align the Overlay to the context element just before it's shown, and whenever the window is resized.


In Primefaces-Context means that:

In CalendarRenderer.java

Code: Select all

  if(isPopup) {
        popupVar = calendarVar + "_popup";
        writer.write(popupVar + " = new YAHOO.widget.Overlay('" + clientId + "_popupContainer');\n");
        writer.write(popupVar + ".cfg.setProperty('visible', 'false');\n");
        writer.write(popupVar + ".cfg.setProperty('context', ['" + clientId + "_popupButton','tl','bl',['beforeShow', 'windowResize']]);\n");
        writer.write(popupVar + ".render();\n");
		}
So the popup is redrawed befor the popup is shown. That will works for me perfectly.

Greats
Mikloman

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

04 Jun 2010, 10:39

Great Mikloman, yes I've used that api in a project so was planning to give it a try to fix this problem again, good to hear it works.

Thanks for the great feedback, we'll fix this very soon.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests