In JSF page I 开发者_运维技巧would like to display a message for a few seconds and then proceed with next action. e.g. If a record gets deleted, I would like to display "Item Deleted" for 10 seconds and then message disappears and user proceed with next action.
How can I do this?
My JSF version is 1.1
Thanks
You can use javascript timer like this:
buttonToNextAction - could either be a button or a link depends on your needs.
function showMessage(){
document.getElementById('msg_id').style.display = "inline";
setTimeout ( "misAndClick()", 10000);
}
function misAndClick(){
document.getElementById('msg_id').style.display = "hidden";
document.getElementById('buttonToNextAction').click();
}
I think JavaScript method is the only elegant method..
精彩评论