Message Tray Widget

Message Tray is a simple implementation of the messaging on a web page. Message Tray Widget is based on the prototype javascript library.

Features

  • Present a message on the page
  • Auto hide when the message is successful
  • Requires user attention when there is error message on the page

How to use

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>

JavaScript code

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.

HTML code

Include the following code where you want to invoke the Message Tray Widget in page:

<div id='displayMessage'></div>

Parameters for initializing the widget

Required parameters

OptionsSinceDescriptionDefault
messageDivV1.0Target Div element where the message is going to show up-

Functions

FunctionParametersDescription
setStatusmsgType:set value of message type as 'error','critical','success','waiting'and 'info', message, closeCallBackFuncName,nextCallBackFuncName -
hideMessageTray--
hideCriticalMessageTray--

Availability

Dekoh Portal Ver 0.4.2 or later.

Attachments