You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Bernd Bohmann (JIRA)" <de...@myfaces.apache.org> on 2007/01/06 13:45:28 UTC
[jira] Commented: (TOBAGO-229) AJAX-reload of scrollable Sheets
resets scrollbar to top position
[ https://issues.apache.org/jira/browse/TOBAGO-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462707 ]
Bernd Bohmann commented on TOBAGO-229:
--------------------------------------
Since 1.0.9 this is commented out:
See:
http://svn.apache.org/viewvc/myfaces/tobago/tags/tobago-1.0.9/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?view=log
> AJAX-reload of scrollable Sheets resets scrollbar to top position
> -----------------------------------------------------------------
>
> Key: TOBAGO-229
> URL: https://issues.apache.org/jira/browse/TOBAGO-229
> Project: MyFaces Tobago
> Issue Type: Bug
> Reporter: Dennis Hauser
>
> A workaround could be to store the scrollbar position before reloading and to set it to the original after the reload is completed ( see attached code fragment exchange-energy-trade_win.js)
> This does work theoretically, but the marked lines in the second code fragment (tobago-sheet.js) are resetting the sheet completely again.
> -------------
> exchange-energy-trade_win.js
> function eetReloadOverviewWin() {
> // -------- neu von hier--------
> var dataDiv = Tobago.element("marketPage:overviewSheet_data_div");
> var scrollTop = dataDiv.scrollTop;
> var scrollLeft = dataDiv.scrollLeft;
> // -------- bis hier --------
>
> var options = {
> insertion: function(receiver, response) {
> if (response.substring(0, 20) == "<status code=\"304\"/>") {
> // no update needed, do nothing
> receiver.skipUpdate = true;
> } else if (response.substring(0, 11) == "<input id=\"") {
> // update content
> Element.update(receiver, response);
> // -------- neu von hier--------
> var dataDiv2 = Tobago.element("marketPage:overviewSheet_data_div");
> dataDiv2.scrollTop = scrollTop;
> dataDiv2.scrollLeft = scrollLeft;
> // -------- bis hier --------
> } else {
> // unknown response do full page reload
> LOG.debug("initiating full reload");
> var mos = Tobago.element("marketPage:overviewSheet");
> if (mos != null) {
> Tobago.submitAction("marketPage:overviewSheet");
> }
> }
> if (eetOverviewTimeoutWin) {
> clearTimeout(eetOverviewTimeoutWin);
> }
> eetOverviewTimeoutWin = setTimeout(eetReloadOverviewWin, eetGetConfigWin().overviewSheetReloadTimeout);
> },
> createOverlay: false
> };
> Tobago.reloadComponent("marketPage:overviewSheet", "marketPage:overviewSheet", options);
> }
> -------------
> resources/html/standard/standard/script/tobago-sheet.js
> Tobago.Sheet.prototype.setup = function() {
> ...
> // Problematisches Codefragment, dessen Sinn mir sich nicht erschließt,
> // dessen Auskommentierung jedoch das Problem löst. :-)
> // -------- von hier --------
> // ToDo: find a better way to fix this problem
> // IE needs this in case of ajax loading of style classes
> var outerDiv = Tobago.element(this.outerDivId);
> outerDiv.className = outerDiv.className;
> outerDiv.innerHTML = outerDiv.innerHTML;
> // -------- bis hier --------
> ...
> }
> -------------
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira