Page History
Include Page _What is an alert _What is an alert
为显示告警,您需要注入
Javadoc | ||
---|---|---|
|
UiContext
由AppContext
、SubAppContext
和Shell
来实现,所以如果您手边正好有其中的一个或多个,可以直接重用。使用样例:
Code Block | ||
---|---|---|
| ||
@Inject public MyCustomClass(UiContext uiContext) { this.uiContext = uiContext; } // Show an ERROR alert. private openErrorAlert(String message) { uiContext.openAlert(MessageStyleTypeEnum.ERROR, "Error", "File upload failed.", "OK", null); } // Confirm deletion with a WARNING alert. private openConfirmationWarning(String message) { uiContext.openConfirmation(MessageStyleTypeEnum.WARNING, "Delete node?", "This action cannot be undone.", "Yes, Delete", "No", true, null); |
Overview
Content Tools