Licensed to the Apache Software Foundation (ASF) under one or more

contributor license agreements. See the NOTICE file distributed with

this work for additional information regarding copyright ownership.

The ASF licenses this file to You under the Apache License, Version 2.0

(the “License”); you may not use this file except in compliance with

the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an “AS IS” BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

layout: docpage title: Template for component details description: This is a template for the details pages for components permalink: /component-sets/jewel/alert

< Jewel Components list

Component set and Name of Component

Reference

Available since version VERSION NUMBER

ClassExtendsImplements

Note: This component is currently only available in JavaScript.

Overview

Overview text here

Example of use

how to use it goes here

Relevant Properties and Methods

Check the Reference of org.apache.royale.SET.NAME{:target=‘_blank’} for a more detailed list of properties and methods.

the contents below are for the Jewel Alert. Update them for this component.

Properties

PROPERTYTypeDescription
titleStringThe title of the Alert.
messageStringThe message to display in the Alert body.
flagsuintThe buttons to display on the Alert as bit-mask values. Possible values are: YES, NO, OK, and CANCEL.

Methods

MethodParametersDescription
showmessage(String), title(String), flags(uint), parent(Object)Shows the Alert non modal anchored to the given parent object, which is usally a root component such as *, as a UIView or body if null.
closebuttonFlag:uint = 0x000004Closes the dialog element.

Relevant Events

The Alert component uses the CloseEvent.CLOSE event when the user removes it from the application. You can attach callback listeners to the CloseEvent.CLOSE as follows:

var alert:Alert = Alert.show("Do you want to save your changes?", "Save Changes", Alert.OK | Alert.NO);
alert.addEventListener(CloseEvent.CLOSE, alertClickHandler);

Then check event.detail to know what button was clicked inside the dialog.

// Event handler callback function for CloseEvent event 
private function alertClickHandler(event:CloseEvent):void {
    if (event.detail == Alert.YES)
        status.text="You answered Yes";
    else
        status.text="You answered No";
}

Relevant Beads

The Alert component uses the following beads:

Bead TypeImplementationDescription
IBeadModel{:target=‘_blank’}org.apache.royale.jewel.beads.models.AlertModel{:target=‘_blank’}The data model for the Alert.
IBeadView{:target=‘_blank’}org.apache.royale.jewel.beads.views.AlertView{:target=‘_blank’}The bead used to create the elements of the Alert.
IBeadController{:target=‘_blank’}org.apache.royale.jewel.beads.controllers.AlertController{:target=‘_blank’}The bead used to handle input events.
IBeadLayout{:target=‘_blank’}org.apache.royale.jewel.beads.layouts.NullLayout{:target=‘_blank’}(*)The bead used to postion the elements of the Alert.

(*) NullLayout is used temporarily.