开发者

Display message for few moments before next action

开发者 https://www.devze.com 2023-03-26 20:02 出处:网络
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

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..

0

精彩评论

暂无评论...
验证码 换一张
取 消