You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Geoffrey Longo (JIRA)" <de...@myfaces.apache.org> on 2006/03/20 17:02:58 UTC

[jira] Created: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

inputCalendar Popup positioned incorrectly in scrollable div
------------------------------------------------------------

         Key: TOMAHAWK-205
         URL: http://issues.apache.org/jira/browse/TOMAHAWK-205
     Project: MyFaces Tomahawk
        Type: Bug
  Components: Calendar  
    Versions: 1.1.2-SNAPSHOT    
    Reporter: Geoffrey Longo


The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Dominique Jean-Prost (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485436 ] 

Dominique Jean-Prost commented on TOMAHAWK-205:
-----------------------------------------------

As Martin mentioned, maybe we should have a look at issue #726, shouldn't we ?

> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Werner Punz resolved TOMAHAWK-205.
----------------------------------

    Resolution: Fixed

Fixed in 1.1.7 snapshot trunk:
http://svn.apache.org/viewvc?view=rev&revision=619397


> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>            Assignee: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483268 ] 

Werner Punz commented on TOMAHAWK-205:
--------------------------------------

Just a shot note, are you sure this patch covers all cases
what happens:

without the patch: the offsets are calculated until a position absolute is reached and then stop.

With this patch, the first component just is skipped
(which under some circumstances it can be the scrolling div)

but in following case

<div style="overflow;auto">
<b>
   <span secondContainer>
              date control in here
   </span>
<b>
</div>


what happens here is that the b is skipped and some positional ofsetting might 
go into the wrong direction,

I think the code is not entirely correct, further comments on this?





> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12566542#action_12566542 ] 

Werner Punz commented on TOMAHAWK-205:
--------------------------------------

Ok I am working on it again, I finally seem to have fixed this.
Once I am fully sure I will do the commit in the trunk!


The issue was a bigger one.
First of all the componet at the current Tomahawk 1.1.7 codebase
simply correctly was doing some offset calculation
and then stopped at the first position absolute or relative.

It then tried two different calculation methods to determine how to show the  popup which is in a relative position to the control.

This is not the correct way to do it, you run into boxing issues in no time like that.

The best bet for floating div positioning always is, to use a floating div as child to the body and then do a full calculation of the offsets against all parents and then move the div to exactly that position, also you have to calculate all scroller positions and then subtract it from the offsets to get the actual position.

The positioning then can be done relatively save because we are relativ to the body not to any other element and no boxing bugs can change our calculated position!


> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>            Assignee: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12482858 ] 

Werner Punz commented on TOMAHAWK-205:
--------------------------------------

ok this looks good to me, 
I was discussing a solution along those lines recently but havent had time
to push it in.
the problem is, it is somewhat too late to get it in into 1.1.5...
(The branch is done while we speak here)
as soon as it is done, I will merge it in.

Thanks a lot.

I will asign this patch to me and merge it in as soon as the branching is done.


> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483274 ] 

Werner Punz commented on TOMAHAWK-205:
--------------------------------------

Ok... I just walked over the code, while the current code handles some cases
I think really is better to port the dojo code into this component.
The dojo code handles bounding border sizes scrollers
etc... I think it makes sense to drop the code entirely
and replace it.

Problem is, I cannot introduce dojo into this component
the dependency would be to big (this would be a one liner).
I have to crossport the code into it.

I will leave this up for discussion, the fix as posted, definitely does not do it
it introduces another bug.

Anyway if we are going for the dojo solution I will target
this problem this weekend. 
It is too late to push it into 1.1.5, the code
is too critical to be introduced so late in the cycle.
But it needs to be fixed.


> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Dominique Jean-Prost (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485434 ] 

Dominique Jean-Prost commented on TOMAHAWK-205:
-----------------------------------------------

Hello,

I tested your patch too. I extracted tomahawk snapshot jar from your war and used it in my test app. I also notice that the calendar opens with the offset.

> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Dominique Jean-Prost (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491945 ] 

Dominique Jean-Prost commented on TOMAHAWK-205:
-----------------------------------------------

Well, I gave a chance to bug#726 patch, and I have to say it works !
Just to be precise : it works well on firefox and IE7. It works almost on IE6, that is the calendar is not perfectly positionned, but it's next to the textfield, which, even is not perfect, is far better than without the patch.

To Werner : I think you should have a look to the fix. It's true though that it doesn't use dojo as you plan to use, which is to my mind a solution for the future.

I also tried Matt Raible fix (the one with the css style). It didn't work at all for me on ie6. Didn't try the one with change in javascript.

I hope this will help everybody.

> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485011 ] 

Werner Punz commented on TOMAHAWK-205:
--------------------------------------

ok I did a preliminary fix, but before committing I need testers:

http://wuerg.kicks-ass.net:8080/webdav/

contains a war file with the latest jars of tomahawk and myfaces, please guys give the new positioning code a testrun.

What I did was basically to crossport the dojo position calculation into this component, now it should hopefully work, first tests indicated excellent results
even the scroller calculation worked perfectly.



> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483595 ] 

Werner Punz commented on TOMAHAWK-205:
--------------------------------------

Actually it is not my code, this is open source a lot of people had their hands on it.
(I am touching the code for the first or second time)

I am not sure if position relative does not open anoter can of worms...
especially if it is embedded into a form which then also has positioning css.

The positioning calculation really is a somewhat problematic issue, and rather complicated.

I will investigate further into this at the weekend, maybe I will change it for position relative
or I will add the dojo positional code, which in my experience works really well.
Expect a fix around monday.


> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Martin Grotzke (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485104 ] 

Martin Grotzke commented on TOMAHAWK-205:
-----------------------------------------

Hi Werner,

this solution does not work for us, the calendar opens with an offset. We are using the patch from
issue TOMAHAWK-726, this one solves our positioning problem.

Cheers,
Martin

> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Dominique Jean-Prost (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dominique Jean-Prost updated TOMAHAWK-205:
------------------------------------------

    Status: Patch Available  (was: Open)

> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Martin Grotzke (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483057 ] 

Martin Grotzke commented on TOMAHAWK-205:
-----------------------------------------

yes, +1 for inclusion of the patch in 1.1.5 if it's somehow possible...


> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Dominique Jean-Prost (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483052 ] 

Dominique Jean-Prost commented on TOMAHAWK-205:
-----------------------------------------------

A special thank yo Fabien Grandgérard who provided me the fix.

Anyway, I'm not sure I really understand what you mean regarding the 1.1.5 branch. Do you mean the fix won't be included in 1.1.5 version of tomahawk ? I'd really like to, because I'm currently working with 1.1.5-SNAPSHOT, and I would like to have my patch included. Is this what you meant ? If not, in which version would it be included ?

> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Dominique Jean-Prost (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12482783 ] 

Dominique Jean-Prost commented on TOMAHAWK-205:
-----------------------------------------------

Hello,

I give you the correction, even though it's not in a patch format (I don't know how to produce it).
Thanks to Fabien Grandgérard.



In the file org\apache\myfaces\custom\calendar\resource\popcalendar.js :

Add the following line : aTag = aTag.parentNode; line#1330 :
Fixed script function :

org_apache_myfaces_PopupCalendar.prototype._popUpCalendar_Show = function(ctl)
{
    this.saveSelectedDate.date = this.selectedDate.date;
    this.saveSelectedDate.month = this.selectedDate.month;
    this.saveSelectedDate.year = this.selectedDate.year;

    var leftpos = 0;
    var toppos = 0;

    var aTag = ctl;
    var aTagPositioningisAbsolute = false;
    // Added try-catch to the next loop (MYFACES-870)
    try
    {
        do {
            aTag = aTag.offsetParent;
            leftpos += aTag.offsetLeft;
            toppos += aTag.offsetTop;
            aTagPositioningisAbsolute = (aTag.style.position == "absolute")
            aTag = aTag.parentNode;//  <---- *****************************************************************************LINE TO ADD HERE*********************************************
        }
        while ((aTag.tagName != "BODY") && (aTag.tagName != "DIV") && (!aTagPositioningisAbsolute));
    }
    catch (ex)
    {
        // ignore
    }

    var leftScrollOffset = 0;
    var topScrollOffset = 0;

    aTag = ctl;
    // Added try-catch (MYFACES-870)
    try
    {
        do {
            leftScrollOffset += aTag.scrollLeft;
            topScrollOffset += aTag.scrollTop;
            aTag = aTag.parentNode;
        }
        while ((aTag.tagName != "BODY") && (aTag.tagName != "DIV") && (aTag.style.position != "absolute"));
    }
    catch (ex)
    {
        // ignore
    }

    var bodyRect = this._getVisibleBodyRectangle();
    var cal = this.calendarDiv;
    
    var top = 0;
    var left = 0
    if (aTagPositioningisAbsolute) {    
        top = ctl.offsetTop - topScrollOffset + ctl.offsetHeight + 2;
        left = ctl.offsetLeft - leftScrollOffset;
    }
    else {
        top = ctl.offsetTop + toppos - topScrollOffset + ctl.offsetHeight + 2;
        left = ctl.offsetLeft + leftpos - leftScrollOffset;
    }

    if(this.initData.popupLeft)
    {
        left-=cal.offsetWidth;
    }

    if (left + cal.offsetWidth > bodyRect.right)
    {
        left = bodyRect.right - cal.offsetWidth;
    }
    if (top + cal.offsetHeight > bodyRect.bottom)
    {
        top = bodyRect.bottom - cal.offsetHeight;
    }
    if (left < bodyRect.left)
    {
        left = bodyRect.left;
    }
    if (top < bodyRect.top)
    {
        top = bodyRect.top;
    }

    this.calendarDiv.style.left = this.initData.fixedX == -1 ? left + "px": this.initData.fixedX;
    this.calendarDiv.style.top = this.initData.fixedY == -1 ? top + "px": this.initData.fixedY;
    this._constructCalendar(1, this.selectedDate.month, this.selectedDate.year);

    this.calendarDiv.style.visibility = (this.dom || this.ie)? "visible" : "show";
    this.bCalendarHidden = false;

    setTimeout((function()
    {
        this._hideElement(this.calendarDiv);
    }).bind(this), 200);

    this._hideElement(this.calendarDiv);

    this.bClickOnCalendar = true;
}

> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Geoffrey Longo (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12482886 ] 

Geoffrey Longo commented on TOMAHAWK-205:
-----------------------------------------

This patch resolves my issue.  Thanks Dominique.

> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Matt Raible (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490634 ] 

Matt Raible commented on TOMAHAWK-205:
--------------------------------------

Solutions that worked for me (b/c I have a div with overflow: auto):

Changing lines 1346 and 1347 from:

            leftScrollOffset += aTag.scrollLeft;
            topScrollOffset += aTag.scrollTop;

To:

            leftScrollOffset += aTag.scrollLeft + "px";
            topScrollOffset += aTag.scrollTop + "px";

OR adding the following CSS to my page:

    <style type="text/css">
        .jscalendar-DB-div-style {
            position: absolute;
            margin-top: -69px;
            margin-left: -408px;
        }
    </style>

I'm using Tomahawk 1.1.5.

> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-205) inputCalendar Popup positioned incorrectly in scrollable div

Posted by "Fabien Grandfgérard (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483509 ] 

Fabien Grandfgérard commented on TOMAHAWK-205:
----------------------------------------------

Hello Werner,

I'm sorry, because my patch wasn't exact. By chance with the patch that works in my project.

I find your javascript code is very complex. The javascript would be easier if you use position:relative for the calendar div which contain the popup of the calendar, it will very easy to give the good position of the popup in all of cases.

here a example of actual code :

<input id="principal:idCalendar1" name="principal:idCalendar1" alt="dd/MM/yyyy" title="dd/MM/yyyy" class="inputCalendar_styleClass" onfocus="selectText('null', 'principal:idCalendar1')" onclick="selectText('null', 'principal:idCalendar1')" type="text"><span id="principal:idCalendar1Span"><div style="visibility: hidden; left: 20px; top: 200px;" ...

here with a relative position solution

<input id="principal:idCalendar1" name="principal:idCalendar1" alt="dd/MM/yyyy" title="dd/MM/yyyy" class="inputCalendar_styleClass" onfocus="selectText('null', 'principal:idCalendar1')" onclick="selectText('null', 'principal:idCalendar1')" type="text"><div id="principal:idCalendar1Span" style="position:relative;"><div style="visibility: hidden; left: 0px ; top: 0px;" ...

This solution should be more simple.


> inputCalendar Popup positioned incorrectly in scrollable div
> ------------------------------------------------------------
>
>                 Key: TOMAHAWK-205
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-205
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Calendar
>    Affects Versions: 1.1.2-SNAPSHOT
>            Reporter: Geoffrey Longo
>         Assigned To: Werner Punz
>
> The popup for the inputCalendar is positioned relative to the body of the page, not the containing div.  Therefore, a calendar that is inside a scrollable div (overflow: auto) may not be positioned correctly if the containing div's left and top positons are not the same as the body.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.