Version
Report Server Version | Functional Change |
11.0.10 | Optimized Msg.toast parameter format. |
11.0.7 | Added description of FVS template interface. Applicable to users who have installed the FVS Big Screen Edit Mode plugin of version 1.8.0 and later. |
11.0 | / |
FineReport has built-in message boxes (with a unified style) that can replace the alert, confirm, prompt, and toast pop-up boxes in Window.
Msg.alert
Report and Dashboard
Method | FR.Msg.alert(title, message, callback) | Pop up a message box with only the OK button. |
Parameter | title: String message: String callback: function | title: Title of the warning box message: Prompt content displayed in the warning box callback: Function method called when OK is clicked |
Return Value | void | |
Example | Pop up a message box with the title Warning and the content Wrong value.
Pop up a message box with the title Warning and the content Wrong value. When OK is clicked, the value of textEditor0 (a Text Field widget) is cleared.
| |
Application Example | Add an After Exiting Edit event to the Text Field widget. If the entered employee ID does not contain six digits, a prompt pops up: Employee ID should be 6 digits. | |
Mobile Terminal | It is supported on mobile terminals. |
FVS Template
Method | duchamp.Msg.alert( { title:String message:String callback:function } ) | Pop up a message box with only the OK button. |
Parameter | title:String message:String callback:function | Title: Title of the warning box (required) message: Prompt content displayed in the warning box (required) callback: Function method called when OK is clicked (optional) |
Return Value | void | |
Example | Pop up a message box with the title Warning and the content Wrong value!.
Pop up a message box with the title Warning and the content Wrong value. When OK is clicked, the value of the Text Box widget is cleared.
| |
Application Example | Click to download the template: Pop up a confirmation message box.fvs | |
Mobile Terminal | It is not supported on mobile terminals. |
Msg.confirm
Report and Dashboard
Method | FR.Msg.confirm(title, message, callback) | Pop up a message box with OK and Cancel buttons. |
Parameter | title: String message: String callback: function | title: Title of the dialog box message: Prompt content displayed in the dialog box callback: Method called when OK or Cancel is clicked A value parameter can be obtained:
Note: The value parameter can only be obtained in the callback parameter. The result cannot be obtained directly through FR.Msg.confirm(title, message, callback). |
Return Value | void | |
Example | Pop up a message box with the title Warning and the content Sure to delete?. FR.Msg.confirm("Warning","Sure to delete?") Pop up a warning box with the title Warning and the content Sure to delete?. When OK is clicked, it prompts: Delete! When Cancel is clicked, it prompts: Cancel!
| |
Application Example | Add a Click event to a Delete button. When Delete is clicked, confirm if you want to delete. | |
Mobile Terminal | It is supported on mobile terminals. |
FVS Template
Method | duchamp.Msg.confirm( { title:String, message:String, callback:function } ) | Pop up a message box with OK and Cancel buttons. |
Parameter | title:String message:String callback:function | title: Title of the dialog box (required) message: Prompt content displayed in the dialog box (required) callback: Method called when OK or Cancel is clicked A value parameter can be obtained. (optional)
|
Return Value | void | |
Example | Pop up a message box with the title Warning and the content Sure to delete?.
Pop up a warning box with the title Warning and the content Sure to clear?. When OK is clicked, it prompts: Clear! When Cancel is clicked, it prompts: Cancel!
| |
Application Example | Add a Click event to the title. In the pop-up message box, click OK to clear the text box content, and click Cancel to cancel the clearing. Click to download the template: Pop up a message box to confirm canceling.fvs | |
Mobile Terminal | It is not supported on mobile terminals. |
Msg.prompt
Report and Dashboard
Method | FR.Msg.prompt(title, message, value, callback) | Pop up a message box that returns content. |
Parameter | title: String message: String callback: function value: String | title: Title of the dialog box message: Prompt content displayed in the dialog box callback: Method called when OK is clicked value: Default return content |
Return Value | void | |
Example | Pop up a message box with the title Enter and the content Hobby. FR.Msg.prompt("Enter","Hobby"); Pop up a message box with the title Enter and the content Hobby. The default entered hobby is Sports. FR.Msg.prompt("Enter","Hobby","Sports"); Pop up a message box with the title Enter and the content Hobby. The default is empty. After you enter the content, it is passed to textEditor0 (a Text Field widget):
| |
Application Example | Add a State Change event to Radio Button. If Others is selected, a message box pops up. After you enter another hobby, the entered content fills back to the targeted cell. | |
Mobile Terminal | It is supported on mobile terminals. |
FVS Template
Method | duchamp.Msg.prompt( { title:String, message:String, callback:function, value: String } ) | Pop up a message box that returns content. |
Parameter | title:String message:String callback:function value: String | title: Title of the dialog box (required) |
Return Value | void | |
Example | Pop up a message box with the title Enter and the content Hobby. The default is empty. After you enter the content, it is passed to the Text Box widget.
| |
Application Example | Click to enter a name in the pop-up message box, and then click OK to fill it back into the Text Box widget. Click to download template: Pop up a message box that returns content.fvs | |
Mobile Terminal | It is not supported on mobile terminals. |
Msg.toast
Report and Dashboard
Method | FR.Msg.toast(message) | Pop up a message box from the preview page. |
Parameter | message: String Note: In FineReport 11.0.10 and later versions, the parameters support JSON format and a new parameter type has been added as follows.{ message:String, type:"success" | "info" | "warn" | "error" } | message: Content in the message box type: Icon style on the left side of the message box (optional) The default is info. Note: For ordinary reports (only when Engine-X is enabled), if you modify the type parameter value, the icon style changes.
|
Return Value | void | |
Example | Pop up a long rectangular message with the content Export succeeded.
Pop up a message with a success icon and the content Export succeeded.
| |
Application Example | 1. Example of a report Add an After Exporting Excel event to the page. After the Excel file is exported, a message Export succeeded pops up in the upper right corner of the page.
2. Example of a new adaptive dashboard After exporting the Excel file, a message Export succeeded pops up in the upper right corner of the page.
3. Example of an old adaptive dashboard After exporting the Excel file, a message Export succeeded pops up in the upper right corner of the page. | |
Mobile Terminal | It is supported on mobile terminals. |
FVS Template
Method | duchamp.Msg.toast( { message:String, type:"success" | "info" | "warn" | "error" } ) | Pop up a long rectangular message box in the upper right corner. |
Parameter | message:String type:"success" | "info" | "warn" | "error" | message: Content in the message box (required) type: Icon style on the left side of the message box (optional) The default is info. success: info: warn: error: |
Return Value | void | |
Example | Pop up a rectangular message box with the content It is correct.
| |
Application Example | Click The sun rises in the east., a prompt pops up: It is correct. Click The sun rises in the west., a prompt pops up: It is wrong. You can manually close the prompt box, or wait a few seconds for it to close automatically. Click to download the template: Pop up a long rectangular prompt box in the upper right corner.fvs | |
Mobile Terminal | It is not supported on mobile terminals. |