Successfully!

Error!

Component event manager

  • Last update:  2021-05-21
  • I. Overview

    1. Version


    Designer versionJAR packagePlugin version
    10.02020-09-041.0


    2. Application scenario

    1) Currently, there are four custom events for FR, refer to Events of FineReport:

    • Widget/component event: Means the event added in the widget/component. Widgets include parameter widget, report widget or the widgets in their corresponding condition attributes. For the introduction of widgets, please refer to Widget Types; components include dashboard block, aggregate layout block, etc., please refer to Dashboard parameter pane;

    • Web page event: Means the event added in Template>Web Attributes>Pagination Preview /Data Entry Settings/Data Analysis Settings, please refer to Web Attributes;

    • Button custom event: Means the event added on the button when a custom button is added to the report toolbar, please refer to Custom button;

    • Report submission event: Means the event added in Template> Data Entry Attributes, please refer to Data Entry Attributes

    The other three events in the template have a unified entrance for viewing and management. Widget/component events are scattered in different widgets/components. When there are many widgets/components, it is cumbersome to find and modify existing events.

    2) This function is applied to templates that have many widget/component events, or need to check and modify events uniformly, and provide a convenient event management entry for report developers/maintainers.

    3) Widets and components are collectively referred to as "component(s)" below.


    3. Function scope

    • Supported report types: Normal report, Aggregate report, and Dashboard.

    • Supported report range: Current template.

    • Supported component types: Cell widget, Cell Conditional Formatting-widget, para component and parameter widgt, body component, absolute layout block, tab block, report block, chart block.

    • Supported component range: The above-mentioned components with event settings in the current template.

    • Supported event types: All setting items in the event corresponding mode. Including js/submit/mail etc.

    II. Plugin introduction

    1. Intall the plugin

    Click to download the plugin: 

    fr-plugin-event-manager-1.0.zip

    Designer plugin installation method reference: Plugin Management

    Server installation plugin method reference: Server plugin management


    2. Instructions

    In the designer, under Template>workbook, enter the Component Event Manager, which will list the components with event settings in the current template. After selecting the component in the list, you can manage the events in the manager on the right. The operation of event manager is the same as that of event response.

    1.png

    Note: When the parameter interface is in the editing state, the component event manager will not be displayed under the template menu.

    2.png

    The interface of the manager is different for different report types. The following distinguishes the report types to explain.

    III. Normal/Aggregate report example

    1. Description of manager interface

    3.png

    1) Report widget/parameter widget selector: You can choose to view report widget events or parameter widget events.

    2) sheet selector: You can choose to view the report widget events of a sheet. If there are too many sheets to display, you can click the arrow group on the right4.png to switch the displayed sheets.

    3) List of components with events:

    • Shows the list of components with events in the current sheet, all expanded by default. After clicking on a component, event manager is performed on the right side.

    • If the directory level is selected, the event manager interface will not be displayed on the right, prompting "No event found for this component".

    5.png

    • Click the small triangle6.png next to the list to collapse or expand the list area.

    • If the component name is too long, you can drag the scroll bar below the component list to display, or move the mouse to the component name to display tooltip.

    7.png

    4) Event manager interface: Events can be added, deleted, and modified. Specific operations are described in other related documents.

    5) Event response mode setting: You can edit the event response mode/specific content. The specific operation is introduced in other related documents.

    6) Click the close symbol in the upper right corner of the component event manager to automatically save and close the manager window.


    2. Cell widget

    sheet1, the button widget of cell A1, set the following click JS event:

    8.png

    Open the component event manager, select Cell Widget>sheet1, you can see that A1 appears in the component list, and the icon prompt in front is a cell button widget.

    9.png

    Modify the js content to "test" on the right and close the manager.

    10.png

    Check the events of the A1 button widget again and find that the content has been modified.

    11.png

    Note: When setting the events of the current widget in the right pane, open the event manager and modify the event you are editing just now; after closing the manager, the right pane will not refresh automatically. You need to click elsewhere and go back again to update.

    12.gif


    3. Cell Conditional Formatting-Widget

    sheet1, add a Conditional Formatting to cell A1, and modify the Conditional Formatting name to TestCondWidget. Add Attributes> Widget> Text Field, and set the following JS event:

    13.png

    Open the component event manager, select Cell Widget>sheet1, you can see that A1(TestCondWidget) appears in the component list, the name of the Conditional Formatting is in brackets, and the icon prompt in front is a Text Field.

    14.png


    4. Widgets in the aggregate report block

    The cell widget and cell conditional formatting-widget in the aggregate report block are similar to the above two.

    Here we create a new aggregate report sheet, drag in an aggregate report block, add Conditional Formatting in cell A1, and leave the name of the conditional formatting unchanged. Add Conditional Formatting> Widget> Number, and set the following JS event:

    15.png

    Open the component event manager, select Cell Widget>sheet2, in the block2 directory, you can see that A1(Conditional Formatting1) appears in the component list, the name of the default conditional formatting is in parentheses, and the icon prompt in front is a Number widget.

    16.png


    5. Para component and parameter widget

    Click the parameter interface to edit, drag in the Text widget and a query button.

    Do not set the Text widget. The query button formSubmit0 is added to the send email event after initialization.

    17.png

    Click the para component (parameter interface), add After Initialization>Commit to Database.

    18.png

    Exit the parameter editing interface, open the component event manager, select the parameter widget tab, you can see that the para component that has been set for the event and the query button formSubmit0 appear in the component list, and the name is the component name. The Text widget is not in it because there is no event.

    19.png

    IV. Dashboard example

    1. Description of manager interface 

    20.png

    1) List of components with events:

    • Displays the list of components with events in the current dashboard, which is expanded to the para/body level by default. After clicking on a component, event manager is performed on the right side.

    • If you select a directory level that has no event, the event manager interface will not be displayed on the right, prompting "No event found for this component".

    21.png

    • Click the small triangle22.png next to the list to collapse or expand the list area.

    2) Event manager interface: Events can be added, deleted, and modified. Specific operations are described in other related documents.

    3) Event response mode setting: You can edit the event response mode/specific content. The specific operation is described in other related documents.

    4) Click the close symbol in the upper right corner of the component event manager to automatically save and close the manager window.


    2. Component event example

    In the dashboard, it does not support cell widget, cell conditional formatting-widget, aggregate report block, and does not need to distinguish sheets, so the component event related settings are relatively simple.

    For example, for the comboBox0 drop-down box widget under the parameter pane of the dashboard, set After Initialization event.

    23.png

    Open the component event manager, in the para directory, you can see that comboBox0 appears in the component list, and the icon prompt in front is a drop-down box widget.

    24.png


    Attachment List


    Theme: Dashboard
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback