Giter Site home page Giter Site logo

messagehub's Introduction

MessageHub

This is a library which simplifies the implementation of SAP Fiori's MessagePopover control.

Note:
Before you start using it, make sure you add a reference to it in the manifest file, under the resources node.

Constructor

  new MessageHub(view);

Implementation

  this.mHub = new MessageHub(this.getView());

Methods

addMessages(settings)

Adds new messages to the hub.

Available Settings

  • title?
    • default: "Message"
  • message?
    • default: ""
  • additionalInfo?: if content isn't null, the message will be clickable, and will navigate to a new screen which will show the additional information.
    • default: ""
  • type?
    • default: "Information" or "" if type by any means is not available in the namespace sap.ui.core.MessageType.

Implementation

  this.mHub.addMessages({
    title: "Error Deleting Files",
    message: "Files could not be deleted.",
    additionalInfo: "The files might be opened by another process.",
    type: "Error"
  });

The following code will output: Image here

A message with an "additionalInfo" property can be clicked, the output will be as follows: Image Here

openPopover(settings)

Open the message popover by the provided control.

Available Settings

  • openBy: The object control which opens the popover.
  • fragmentPath: The absolute fragment namespace.

Implementation

  onOpenMessageHubPress: function (oEvent) {
    this.mHub.openPopover({
      openBy: oEvent.getSource(),
      fragmentPath: "myappp.library.MessageHub.MessageHub"
    });
  }

Note:
myapp: application root;
myapp.library: library folder, just like the controller, view, etc folders;
myapp.library.MessageHub: MessageHub folder;
myapp.library.MessageHub.MessageHub: xml fragment;

messagehub's People

Contributors

luccasjsantos avatar luccasjsantos-lab2dev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.