-
1. Re: rich:modalPanel position somewhere in view?
ravinandan Jun 1, 2011 6:27 AM (in response to robertgary1)I'm facing the same issue.
my page is fairly long and whenever user opens modal panel from bottom section of the screen the modal panel seems to go slightly towards upper section and this causes to lose the visibility of the bottom section(and has to scroll down after closing the panel window).
From attributes section I can see left, top and zindex might help me in positioning the panel window.
But is there any alternative solution for this?
Thanks,
Ravi
-
2. Re: rich:modalPanel position somewhere in view?
robertgary1 Jun 1, 2011 11:27 AM (in response to ravinandan)Here is the solution I found...
function popupRichModal(element, modalWindow)
{
var pos = findPos(element);
Richfaces.showModalPanel(modalWindow, {top:pos[1],left:pos[0]});
}
"element" is the item to tag the modal window to (i.e. the button that launched it). "modalWIndow" is the id of your rich:modalPanel. "findPos" comes from a list of cool utilities from http://blog.stannard.net.au/2010/05/22/find-the-position-of-an-element-with-javascript/ (I'm not sure if I can legally copy/paste the findPos method here, but you can get it from the link).
-Robert
-
3. Re: rich:modalPanel position somewhere in view?
ilya_shaikovsky Jun 1, 2011 7:03 PM (in response to robertgary1)besides passing directly to JS you could define top and left using attributes.