Displaying MiniMessages

Advance preparation

OpenSocial has a feature that displays messages to users like simple dialog. Use of the minimessage feature must be declared with Required Elements in Gadget XML in order to use this feature.

Displaying MiniMessages with a Close button

The following are display examples of MiniMessages with a button the user can click to close the window.

  • Generate a Message object with new gadgets.MiniMessage().
  • Make the message an argument in createDismissibleMessage() and call it to display the message.
  • If a callback function is specified in the second argument, it will be called when the user clicks the Close button.

Displaying MiniMessages that are erased after a specified period of time

The following are display examples of MiniMessages that are closed after a specified period of time.

  • Generate a Message object with new gadgets.MiniMessage().
  • Specify the number of seconds until the message is closed in createTimerMessage() and call it to display the message.
  • If a callback function is specified for the third argument, it will be called when the message closes.

Displaying static MiniMessages

The following are display examples of MiniMessages that are closed by the program.

  • Generate a Message object with new gadgets.MiniMessage().
  • Specify the message in createStaticMessage() and call it to display the message.
  • When the return value DOM element onclick is used and the message is clicked, the dismissMessage() method is called and the message is erased.

Revision History

  • 12/2010
    • Initial Release.

PREVIOUS

Setting the Display Range

NEXT

Displaying Tabs