Successfully!

Error!

You are viewing 10.0 help doc. More details are displayed in the latest help doc

Obtain Widget

Note: The following is the document reference for version 10.0

this

I. Description

In the widget event, the current widget object can be directly obtained through this

Widget refers to the widget in the cell, the widget in the parameter pane, and the widget in the body of the dashboard.

After obtaining the widget, you can call the operation method of the widget, etc.

II. Example

Get the value of the widget in the After Editing event of the Text Field widget on parameter pane.

1. Add After Editing event

1.png

The JavaScript code is as follows:

var a = this.getValue(); FR.Msg.alert("Tip",a);


2. Preview effect

Enter the value of the Text Field widget into 'hello', and when you click other places , the message "hello" will be prompted.

2.png

Note: The following is the document reference for version 11.0

I. this

Method

this

It is used in the event of the widget to get the current widget object, after which the methods and attributes of the widget can be used.

  Parameter-

-

 Return valueobjectcurrent widget object
    Example

Example 1: Obtain the actual value of the current widget

this.getValue();

Example 2: Set the current widget to be invisible

this.setVisible(false);

Example 3: Clear the value of the current widget

this.reset();

Application

example

After the widget is edited, it is set to be unavailable, and the implementation can only be filled once:

For the detailed implementation method, please refer to: JS implements the data entry widget can only fill in once

3.gif

MobileSupport mobile terminal

II. this.options.form

Method

this.options.form

Used in the event of the widget, you can call the parameter pane interface getWidgetByName(name) interface

  Parameter-

-

 Return value-
    Example

Example 1: Obtain the actual value of the drop-down box widget comboBox0

this.options.form.getWidgetByName("comboBox0").getValue();

Example 2: Obtain the drop-down box widget comboBox0 and set it to be invisible

this.options.form.getWidgetByName("comboBox0").setVisible(false);

Application

example

After obtaining the widget, assign a value to it to realize the linkage of the widget value:

For detailed implementation methods, please refer to: JS implements parameter widget assignment

4.gif

MobileSupport mobile terminal


Attachment List


Theme: Secondary Development
Already the First
Already the Last
  • Helpful
  • Not helpful
  • Only read

Doc Feedback