# pragma-messages

Pragma messages is a custom control that listens for a event aggregate and displays a message as passed to it via the event.

## Usage
To enable this you need to add the "pragma-messages" custom control to your application, typically done on the app.html file.

```html 
<pragma-messages></pragma-messages>
```

## Show a message
```js
window.eventEmitter.emit("show-message", {
        buttons: buttonTypes.ok,
        message: "No records available for lookup"
    }
);
```

## Button types
When showing the message you can define what buttons must be available.
The options are:
1. ok
1. ok_cancel
1. accept
1. accept_recject
1. yes_no

default is ok, so if you don't define a buttons property in the message, only ok button will show

## callback
If you want to know what option was seleted you can add a callback property on the message.
This callback should be a function with a boolean parameter indicating what button was pressed.
If the parameter is true, a positive selection was made (ok, accept) else if if is false a negative selection was made.