Dear All,
We have an XForm + JSF combination where the is a JSF Tree2 of the left
of the page & the XForm on the right.
Tree2 has it's own scrolling function built in in Javascript to set the
position of the tree back to the point where you clicked on a TreeNode
after a refresh.
e.g.:
<input name="autoScroll" type="hidden">
<script type="text/javascript"><!--
function getScrolling() {
var x = 0; var y = 0;
if (self.pageXOffset) {
x = self.pageXOffset;
y = self.pageYOffset;
} else if (document.documentElement &&
document.documentElement.scrollLeft) {
x = document.documentElement.scrollLeft;
y = document.documentElement.scrollTop;
} else if (document.body) {
x = document.body.scrollLeft;
y = document.body.scrollTop;
}
return x + "," + y;
}
window.scrollTo(0,1899);
//--></script>
This is great.....however obviously the XForm then is "trapped" at the
top of the page & you then have to scroll back up to it. So we wrote a
scrolling function for the XForm however.....if does not detect that the
above piece of code has executed & thus stays at the top till you make
any kind of movement of the scroller bar with your mouse & then it coems
down the page to you.
This is fine & much better than scrolling however even nicer would be
for the form & the tree to be in sync.
So my questions are:
(A) Does the above kick off any kind of event which I can listen out for?
I have already added a window scroll listener e.g.:
xAddEventListener(window, 'scroll', winOnScroll, false);
which is how it detects that a (mouse driven) scrolling event has
occurred but the myfaces tree2 code does not appear to kick one of these
off.
(B) Is there any way to get the vertical position out such that the
position of the chosen node in the tree & the form can be aligned?
TIA
Adam