>perdona la mia ignoranza l' on-focus-lost è un'evento di che
>tipo, ossia come implemento il codice per nascondere il pannello
>se è quello che devo fare
l'on-focus-lost (nome corretto onblur) è un evento JS.
Io uso una cosa del genere:
function showLoading()
{
var width = document.body.offsetWidth;
var height = document.body.offsetHeight;
var top = 0;
var left = 0;
var pnlLoading = document.getElementById('ctl00_ctl00_ContentPage_pnlLoading');
pnlLoading.style.width = width + 'px';
pnlLoading.style.height = height + 'px';
pnlLoading.style.top = top + 'px';
pnlLoading.style.left = left + 'px';
pnlLoading.style.visibility = 'visible';
pnlLoading.style.cursor = 'wait';
var imgLoading = document.getElementById('ctl00_ctl00_ContentPage_imgLoading');
imgLoading.style.left = ((width - 130) / 2) + 'px';
imgLoading.style.top = '150px';
imgLoading.style.visibility = 'visible';
var imgChiudi = document.getElementById('ctl00_ctl00_ContentPage_imgChiudi');
imgChiudi.style.visibility = 'visible';
var selects = document.getElementsByTagName('select');
for (i = 0; i < selects.length; i++)
selects[i].style.visibility = 'hidden';
//Serve per ovviare al problema del back e il loading.
//Se il browser è mozilla... Altrimenti...
if (document.addEventListener)
{
//Firefox
document.addEventListener('DOMContentLoaded', hideLoading, false);
document.addEventListener('blur', hideLoading, false);
}
else if (document.attachEvent)
{
//Internet Explorer
var pnlFocus = document.getElementById('ctl00_ctl00_ContentPage_pnlFocus');
pnlFocus.attachEvent('onload', hideLoading);
pnlFocus.attachEvent('onblur', hideLoading);
pnlFocus.style.width = (width - 10) + 'px';
pnlFocus.style.height = (height - 10)+ 'px';
pnlFocus.style.top = (top + 10) + 'px';
pnlFocus.style.left = (left + 10) + 'px';
pnlFocus.style.visibility = 'visible';
pnlFocus.style.cursor = 'wait';
pnlFocus.focus();
}
else
{
document.onload = new Function('hideLoading(e);');
document.onblur = new Function('hideLoading(e);');
}
}
function hideLoading(e)
{
var pnlLoading = document.getElementById('ctl00_ctl00_ContentPage_pnlLoading');
pnlLoading.style.visibility = 'hidden';
pnlLoading.style.cursor = 'default';
var imgLoading = document.getElementById('ctl00_ctl00_ContentPage_imgLoading');
imgLoading.style.visibility = 'hidden';
var imgChiudi = document.getElementById('ctl00_ctl00_ContentPage_imgChiudi');
imgChiudi.style.visibility = 'hidden';
var selects = document.getElementsByTagName('select');
for (i = 0; i < selects.length; i++)
selects[i].style.visibility = 'visible';
}
Quando premi il pulsante di download, come fai adesso, lanci la function JS showLoading().
Ovviamente va sistemata secondo le tue esigenze...
Andrea - http://www.MelisWeb.eu/