Message Tray is a simple implementation of the messaging on a web page. Message Tray Widget is based on the prototype javascript library.
- Present a message on the page
- Auto hide when the message is successful
- Requires user attention when there is error message on the page
Add this code to the head section of the page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<style type="text/css" title="currentStyle" media="screen">
@import '<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "theme","app","css.jsp?externalApp=true")%>';
</style>
<script type='text/javascript' src='<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "common",null,"JSlibrary.jsp")%>'>
</script>
<script type='text/javascript' src='<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "widget","messageTray","messageTray.js")%>'>
</script>
The basic syntax to initialize the Dialog widget is
<script type="text/javascript">
//<![CDATA[
var msgBlock = new messageTray('displayMessage');
msgBlock.setStatus('success','success message comes here');
//]]>
</script>
Note: Put the javascript code after the div element in the page so that the element gets registered in the dom.
Include the following code where you want to invoke the Message Tray Widget in page:
<div id='displayMessage'></div>
| Options | Since | Description | Default |
| messageDiv | V1.0 | Target Div element where the message is going to show up | - |
| Function | Parameters | Description |
| setStatus | msgType:set value of message type as 'error','critical','success','waiting'and 'info', message, closeCallBackFuncName,nextCallBackFuncName | - |
| hideMessageTray | - | - |
| hideCriticalMessageTray | - | - |
Dekoh Portal Ver 0.4.2 or later.