dojo.html.getAbsolutePosition() not sufficient for determining layout coordinate in style - 0.4.3 tapestry script under firefox
Folks,
I rendered a gallery widget on a T-4.1.6 page, and ontop of each image I just create a text node as a child and write some transparent text. So it is rendering.... image with dom text noce positioned ontop (as a child)
In IE the child node places fine and I do not have to muck with position except for the X position (still do nto know why though).
In firefox it's worse, both X,Y position are not being applied to the styel and messed up. So I have to set manually. 5,5 is desired coordinate relative to the image (top left message text).
I cannot set the position at all though. The coordinates coming back are 202 for Y but when all is said and done, the text position for Y gets placed at 0.
Am I confused about dojo.html.getAbsolutePosition(...) ? It returns what seems to be valid values but I am ubale to get the text node to position at all. It is like the rendering phase it taking over and clobbering anything I try to set.
Is it the rendering phase thats messing me up?
Here is a snippet. I am operating this out of a *.script file in T-4.1.6
Thanks for your help.
TransparentTextImage.script
function decorateTransparentText_${index}() {
debugger;
// now attach transparent text to image
var imageDom = document.getElementById("Image_" + ${index});
// place transparent text in a div element
var divBlock = document.createElement("div");
divBlock.style.background = 'transparent';
divBlock.style.color = 'yellow';
divBlock.style.fontFamily = 'Arial';
divBlock.style.fontSize = '12pt';
divBlock.style.fontWeight = 'bolder';
divBlock.style.position = 'absolute';
if ( dojo.render.html.ie ) {
//divBlock.style.top = findPos(imageDom).y;
divBlock.style.left = findPos(imageDom).x - imageDom.offsetWidth;
} else if ( dojo.render.html.mozilla ) {
divBlock.style.top = findPos(imageDom).y - imageDom.clientHeight;
divBlock.style.top = 0;
divBlock.style.top = imageDom.parentNode.offsetHeight;
divBlock.style.top = imageDom.offsetHeight;
divBlock.style.top = dojo.html.getAbsolutePosition(imageDom, true, dojo.html.boxSizing.BORDER_BOX).y;
divBlock.style.top = dojo.style.getAbsolutePosition(imageDom, false).y;
divBlock.style.top = dojo.html.getAbsoluteY(imageDom, false);
//divBlock.style.left = findPos(imageDom).x - imageDom.clientWidth;
}
divBlock.style.zIndex = 10;
var textNode = document.createTextNode("${transparentText}");
divBlock.appendChild(textNode);
}

Layout widget does not work in firefox either
Layout widget does not work in firefox either.
Can anyone commment on these geometry position mgt variables
and how they are suppose to be operated in firefix?
divBlock.setAttribute("dojoType", "ContentPane");
divBlock.setAttribute("layoutAlign", "top");
divBlock.style.zIndex = 10;
var textNode = document.createTextNode("${transparentText}");
divBlock.appendChild(textNode);
// now attach transparent text to image
var imageDom = document.getElementById("Image_" + ${index});
imageDom.appendChild(divBlock);
imageDom.setAttribute("dojoType", "LayoutContainer");
Best regards
Ken in nashua
Just tryiing to set the position of the text node... HOW TO?
Can someone explain the best practice on how to set the position of a text node ontop of an image in tapestry script using dojo?
It cannot be this difficult. I have lost weeks on this.
Best regards
Ken in nashua