I think it may be a little more than that.  The problem is that the button
that the calendar div will be positioned to is normal positioning.  Thus,
you can apply the positioning rule there and get the correct x,y offset from
the page.

With those values, however, you have to translate that into the coordinate
space of the relative div which the absolute positioned div is a part of.
So, you would need to then walk the parents of the absolute positioned div
until you find a relative positioned div.  Then, you would get its x,y
position relative to the page and subtract those from the x,y position of
the corresponding button you are aligning to.  That should then put you into
the proper coordinate space.

Of course, I have not tried this (as I took the easy route and just removed
the relative position) and I am sure there are other permutations not
considered (such as relative position within relative position).

Nick

-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Werner Punz
Sent: Monday, March 19, 2007 10:56 AM
To: [email protected]
Subject: Re: [Solved] inputCalendar position when using renderAsPopup=true

Thanks a lot for the info, this is indeed not really a bug,
or it is, depending on the view.

My guess is that the positioning code should go up the tree
and check whether an element has positioning absolute and stop its
treewalking there, taking the x and y coordinates as last values.



Your explanation makes sense, thanks a lot.


Werner



Hagen, Nicholas schrieb:
> I recently ran into this same issue but after further investigation I
> learned it was not so much an issue with the calendar as with the CSS
> layout.  Not sure if this is similar behavior as others are seeing, but I
> will share nonetheless.
> 
> Apparently if you have a relative position element and then have a child
> somewhere further down the tree that is absolutely positioned (ie: the
> calendar popup), then the position is correctly calculated for the
> image/button/etc that is associated to that popup in reference to the
page.
> However, setting those values on the style of the absolute position
calendar
> popup align the coordinates to the coordinates of the relative position
> element rather than the page.  Thus, if your relative position element's
top
> left corner sits at x=50,y=70 and your image/button/etc sits at x=90,y=120
> in reference to the page, then the position the browser aligns the popup
to
> is: x=50+90,y=70+120 rather than x=90,y=120.
> 
> My fix was just remove the relative position from the CSS for that element
> as doing so caused no difference in the visual appearance of my page.
> 
> For more information on why absolute position has this effect, see:
> 
> http://www.w3.org/TR/REC-CSS2/visuren.html#q29
> 
> Thanks,
> Nick
> 
> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Werner Punz
> Sent: Tuesday, March 13, 2007 6:02 AM
> To: [email protected]
> Subject: Re: [Solved] inputCalendar position when using renderAsPopup=true
> 
> cervatz schrieb:
>> Hi! The answer is 'no', I do not use facelets. What do you suggest?
>> Thank you very much. Enrico
> I recently ran into a positioning bug with the input date and
> pure css layouts, something in the positioning code still is buggy.
> 
> if you need a fast solution, you could theoretically use facelets
> in conjunction with the dojo utils to get a nice input date control.
> 
> I posted the code for the control recently.
> (I can repost it)
> 
> Unfortunatly if no one else wants to look into this I wont be able to
> look into this issue before next week.
> All I can do for now is to file a jira issue.
> 
> 

Reply via email to