[ http://issues.apache.org/jira/browse/COCOON-1711?page=all ]
Werner Masik updated COCOON-1711: --------------------------------- Attachment: before.html after.html forms-advanced-field-styling.xsl.diff Well here are the before/after htmls. The only thing that is interesting is the div for the help popup: <div style="visibility:hidden; position:absolute;" id="email:help" class="forms-help"> <span style="float:right"><a onClick="document.getElementById('email:help').style.visibility = 'hidden';return false;" href="#"><img width="6" height="6" src="resources/forms/img/close.gif" alt="close" align="top"></a></span> This help window should pop up near the question mark. </div> The new XSL places the div just below the body tag to avoid the layout problems. It makes the call to forms_moveInBody obsolete. > [PATCH] correct position of help popup for tab styling > ------------------------------------------------------ > > Key: COCOON-1711 > URL: http://issues.apache.org/jira/browse/COCOON-1711 > Project: Cocoon > Type: Bug > Components: Blocks: Forms > Versions: 2.1.9-dev (current SVN) > Reporter: Werner Masik > Priority: Minor > Attachments: after.html, before.html, forms-advanced-field-styling.xsl.diff, > forms-advanced-field-styling.xsl.diff, screenshot.png, testcase.tgz, > testcase.zip > > Help popups appear in the wrong position when the tab styling is used. > Usually it pops up below the div that contains the tabbed form, which means > that the popup is often outside of the visible viewing area. > Looks like the bug exists since the stylesheets of 2.1.7 and dev branch were > merged. > The problem is that the function forms_createPopupWindow does not get called > when > the page is loaded into the browser. In current 2.1.X branch the function > gets called > directly from the <a href=" ... > <a > onclick="forms_createPopupWindow('email:help').showPopup('email:help:a');return > false;" href="#" name="email:help:a" id="email:help:a"><img alt="helppopup" > src="resources/forms/img/help.gif"></a> > So the function is executed when then link to the popup is clicked. > In 2.1.7 it was called like this: > <script type="text/javascript"> > var helpWinN1003B = forms_createPopupWindow('helpN1003B'); > </script> > <a onclick="helpWinN1003B.showPopup('N1003B');return false;" href="#" > name="N1003B" id="N1003B"><img alt="helppopup" src="/images/help.gif"></a> > Here the popup window was created at the first display of the browser page. > Actually when in tab-styling the whole popup-tree was just copied right below > the body-tag because of the positioning issues. This was done > with the forms_moveInBody function which was called in the onload handler of > the forms. > Therefore 2 possible solutions exist: > - revert the code to the old version, to register the handler before the > onload is executed > - alter forms-advanced-field-styling.xsl so the divs for the popups are all > created as a child of the body tag > The patch I'm submitting takes the second aproach. All it does is create the > divs where they should be > from the beginning (below body). This is done by introducing a mode called > 'forms-help', to make the fi:help > tags get processed twice. In the first run the divs are created and in the > second run links for the popups > are created just behind the field (as usual). Moving the divs with > javascript therefore becomes obsolete. I think > that registering the onloadHanlder to call forms_moveInBody can be removed. > But I was not sure if > it is needed for something else, so I kept it. > I'm not a XSLT expert. There might be a better way to process the help > popups. Feel free > to make corrections. I also have no experience with ajax. I tested it with > ajax activated > and it worked. But I'm not sure if my test was using ajax the right way. -- 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