[GeoNetwork-devel] Scroll in metadata editor after a POST

Hi

When adding for example a keyword or other fields in the metadata editor is done a POST and used this code to move the page to the new field position after the page load:

function scrollIt()
{
window.scroll(0,<xsl:value-of select=“/root/gui/position”/>);
document.mainForm.position.value = -1; // reset
}
timeId = setTimeout(‘scrollIt()’,1000);

I tried this to simplify it and avoid the timer, but no clear if this can cause any other issue (in my tests seem ok):

function init()
{
window.scroll(0,<xsl:value-of select=“/root/gui/position”/>);
document.mainForm.position.value = -1; // reset
}

(init function in GeoNetwork is call on after the page is loaded)

I guess the code is like actual for some reason, if anyone can provide some feedback would be appreciated.

Thanks and regards,
Jose García


GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on GeoServer and GeoNetwork. Visit http://geocat.net for details.


Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net

Hi Jose,

I suspect it was that the form might not have finished rendering - for example with large metadata documents.

Cheers,
Simon
________________________________________
From: Jose Garcia [jose.garcia@anonymised.com]
Sent: Thursday, 18 April 2013 12:58 AM
To: Devel geonetwork-devel@lists.sourceforge.net
Subject: [GeoNetwork-devel] Scroll in metadata editor after a POST

Hi

When adding for example a keyword or other fields in the metadata editor is done a POST and used this code to move the page to the new field position after the page load:

function scrollIt()
{
window.scroll(0,<xsl:value-of select="/root/gui/position"/>);
document.mainForm.position.value = -1; // reset
}
timeId = setTimeout('scrollIt()',1000);

I tried this to simplify it and avoid the timer, but no clear if this can cause any other issue (in my tests seem ok):

function init()
{
window.scroll(0,<xsl:value-of select="/root/gui/position"/>);
document.mainForm.position.value = -1; // reset
}

(init function in GeoNetwork is call on after the page is loaded)

I guess the code is like actual for some reason, if anyone can provide some feedback would be appreciated.

Thanks and regards,
Jose García

--
GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on GeoServer and GeoNetwork. Visit http://geocat.net/&gt; for details.
_________________________
Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net/&gt;