Applying Web Actions to a Label
A label in a page report that is created using query resources or in a library component can be bound with web actions. This allows you to customize a label to make it respond to interactive events, and execute corresponding actions such as sorting and filtering. For example, you can insert a label in Logi JReport Designer and associate an action with the label's onclick event. Then at runtime when end users run the report and select the label, the defined operation will be executed.
The following table lists the events that can be used to trigger web actions:
Events | Description |
---|---|
Blur | Fires when the object loses the input focus. |
Data Change | Fires when the contents of the object or selection have changed. |
Select | Fires when the user selects the left mouse button on the object. |
onContextMenu | Fires when the user selects the right mouse button on the object, opening the shortcut menu. |
Double_Select | Fires when the user double-clicks the object. |
Focus | Fires when the object receives focus. |
Key Down | Fires when the user presses a key. |
Key Press | Fires when the user presses an alphanumeric key. |
Key Up | Fires when the user releases a key. |
Mouse Down | Fires when the user selects the object with either mouse button. |
Mouse Move | Fires when the user moves the mouse over the object. |
Mouse Out | Fires when the user moves the mouse pointer outside the boundaries of the object. |
Mouse Over | Fires when the user moves the mouse pointer into the object. |
Mouse Up | Fires when the user releases a mouse button while the mouse is over the object. |
Resize | Fires when the size of the object is about to change. |
Scroll | Fires when the user repositions the scroll box in the scrollbar on the object. |
Select | Fires when the current selection changes. |
To bind web actions to a label:
- Right-click the label and select Display Type from the shortcut menu.
- In the Web Behaviors box of the Display Type dialog, choose an event from the Events column, then select in the Actions column and select that appears in the text box.
- In the Web Action List dialog, select the required action and then select OK.
- If the selected web action is Filter, Sort, Parameter, Property, SendMessage or Customized Control, the corresponding web action builder dialog appears. Specify the settings according to your requirements.
- If Customized Control from Lib is selected, the Customized Control Manager dialog is displayed, which shows all the customized control files in the customized control library. Select the one you want and select OK.
- If the selected action needs no parameter, the Web Action List dialog is closed.
- If the selected web action needs parameters, the Parameters dialog appears for you to input the parameter values. For parameters that refer to instance name, you can input the mapping name of the instance, or the display name plus the prefix "&" as the parameter value.
- Select in the Display Type dialog and repeat the above steps to add more web actions. If a web action is not required, select to remove it.
- Adjust the order of the added web actions by selecting or . Then, when an event that has been bound with more than one action happens, the upper action will be triggered first.
- Select OK to apply the settings and close the Display Type dialog.
Then, at runtime, when any of the specified events occurs on the label, the web action defined on the event will be triggered.
Notes:
- Web actions are not supported on web reports and page reports that are created using business views.
- The Property and Send Message web actions are available to library components only.
- You can define your own web actions by adding API functions into both the file API.js located at
<designer_install_root>\lib\html\javascript\dhtml
and the same-name file located at<server_install_root>\public_html\dhtmljsp\js
.
Below is a list of the sections covered in this topic:
Filter
The Filter web action enables you to filter the records in a data component.
To apply the Filter web action:
- In the Web Action List dialog, select *Filter and select OK. The Filter - Web Action Builder dialog appears.
- From the Get Input From drop-down list, specify where to get the input, which may be a form, or other in report.
- From the Apply Action To drop-down list, select a data component in the current report, whose records will be filtered.
- In the Filter On column, specify the field on which to filter the records. The field may be a column in the component, or be specified by the value of a web control.
- Specify the operator and value. The value may be input by yourself, or be the value of a web control.
- If necessary, specify And or Or in the More column so as to add a new filter condition or you can select to add a new filter condition.
To delete a filter condition, select it and select . To adjust the order of the filter conditions, select or .
- Select OK to accept the filter conditions.
At runtime, when the specified event occurs on the label, the selected data component will be filtered based on the predefined conditions.
Sort
The Sort web action enables you to sort the records in a data component.
To apply the Sort web action:
- In the Web Action List dialog, select *Sort and select OK. The Sort - Web Action Builder dialog appears.
- From the Get Input From drop-down list, specify where to get the input, which may be a form, or other in report.
- From the Apply Action To drop-down list, select a data component in the current report, whose records will be sorted.
- In the Sort On column, specify the field on which to sort the records. The field may be a column in the component, or be specified by the value of a web control.
- Specify the sort value. The value may be Ascending or Descending, or be the value of a web control.
- If necessary, select to add a new sort condition.
To delete a sort condition, select it and select . To adjust the order of the sort conditions, select or .
- Select OK to accept the sort conditions.
At runtime, when the specified event occurs on the label, the selected data component will be sorted based on the predefined conditions.
Parameter
The Parameter web action enables you to run a report, especially a report with parameters.
To apply the Parameter web action:
- In the Web Action List dialog, select *Parameter and select OK. The Parameter - Web Action Builder dialog appears.
- Specify the handler which will receive the parameters of the web action. The handler may be the default one in the current server, or in another server specified by Customized Path.
- From the Get Input From drop-down list, specify where to get the input, which may be a form, or other in report.
- Specifies whether to apply the action to run a report or refresh the current report. If you choose to run a report, select the Browse button to specify the report or use a web control to retrieve the report name at runtime, then select the window or frame in which the report will be opened from the Target Frame drop-down list.
- The parameters used by the specified report are automatically listed in the parameters box. Specify the value for each parameter.
- Select OK to accept the parameter values.
At runtime, when the specified event occurs on the label, the selected report will run using the specified parameter values.
Customized Control
With the Customized Control web action, you can customize dialogs to perform web actions such as sorting and filtering in tables in page reports that are creating using query resources. For the usage of this web action, see Using Customized Controls in a Table.
Property
The Property web action enables you to make the properties of an object change at runtime, however, it is available to the following objects in library components only: fields and labels in tables/crosstabs, some chart elements such as legend, chart axis and so on, markers and areas in geographic maps, as well as labels, parameter controls and the Submit buttons of parameter form controls which are not in the library components' configuration panels.
To apply the Property web action:
- In the Web Action List dialog, select *Property and select OK. The Change Property - Web Action Builder dialog appears.
- From the Apply Action To drop-down list, select the object the properties of which you want to change.
- In the Properties column, specify the property you want to change. All the properties of the object you select from the Apply Action To drop-down list are listed here.
- In the Value column, input the value of the property.
- If necessary, select to add a new line to change a property.
To delete a property line, select . To adjust the order of the properties, select or .
- Select OK to accept the property values.
At runtime, when the specified event occurs on the label, the property values will be applied to the selected object.
SendMessage
The Send Message web action enables you to send out a message when a specific event occurs on an object in a library component. The message will apply to any library components that are receiving the message when displayed in the same dashboard. For more information about this web action, refer to Sending Out Messages.