Common API for Toolbar Button

  • Last update:April 29, 2025
  • Version

    VersionFunctional Change

    11.0

    Difference from V10.0:

    No changes, and all the following APIs are supported in V10.0.

    iconNote:
    The following API cannot be used in the FVS visualization dashboard.

    visible


    API

    visible()

    To set a toolbar button on the toolbar to be visible.

    Parameter

    -

    -

    Returned Value

    void

    Example

    Example 1: You can set a button to be visible when the obtained toolbar button object is defined as button.

    button.visible();

    Example 2: In a general report, you can set the Email button to be visible.

    _g().getToolbar().getWidgetByName("email").visible();

    Example 3: In a dashboard, you can set the First button to be visible.

    _g().getWidgetByName('report0').getToolbar(0).getWidgetByName("first").visible();

    Application Example

    After successful submission, the Email and Print buttons are displayed on the toolbar.

    For details, you can download the template Visible Toolbar Button.cpt.

    Screen Recording 2025-04-11 at 15.57.01 (1).gif

    Mobile Terminal

    This API is not supported on mobile terminals.

    invisible


    API

    invisible()

    To set a button on the toolbar to be invisible.

    Parameter

    -

    -

    Returned Value

    void

    Example

    Example 1: You can set a button to be invisible when the obtained toolbar button object is defined as button.

    button.invisible();

    Example 2: In a general report, you can set the Email button to be invisible.

    _g().getToolbar().getWidgetByName("email").invisible();

    Example 3: In a dashboard, you can set the First button to be invisible.

    _g().getWidgetByName('report0').getToolbar(0).getWidgetByName("first").invisible();

    Application Example

    After successful submission, the Email and Print buttons are hidden on the toolbar.

    For details, you can download the template Invisible Toolbar Button.cpt.

    Screen Recording 2025-04-11 at 15.57.21 (1).gif

    Mobile Terminal

    This API is not supported on mobile terminals.

    setVisible


    API

    setVisible(visibility)

    To set a button on the toolbar to be visible or invisible.

    Parameter

    visibility: boolean

    Visible or not, which is a boolean value.

    • true: visible

    • false: invisible

    Returned Value

    void

    Example

    Example 1: You can set a button to be invisible when the obtained toolbar button object is defined as button.

    button.setVisible(false);

    Example 2: In a general report, you can set the Email button to be invisible.

    _g().getToolbar().getWidgetByName("email").setVisible(false);

    Example 3: In a dashboard, you can set the First button to be invisible.

    _g().getWidgetByName('report0').getToolbar(0).getWidgetByName("first").setVisible(false);

    Application Example

    After successful submission, the Email and Print buttons are hidden on the toolbar.

    For details, you can download the template Invisible Toolbar Button1.cpt.

    Screen Recording 2025-04-11 at 15.57.39 (1).gif

    Mobile Terminal

    This API is not supported on mobile terminals.

    isVisible


    API

    isVisible()

    To return the visibility status of a specified button on the toolbar.

    Parameter

    -

    -

    Returned Value

    boolean

    Visible or not, which is a boolean value.

    • true: visible

    • false: invisible

    Example

    Example 1: The API can return the visibility status of a specified button when the obtained toolbar button object is defined as button.

    button.isVisible();

    Example 2: In a general report, the API can return the visibility status of the Email button.

    _g().getToolbar().getWidgetByName("email").isVisible();

    Example 3: In a dashboard, the API can return the visibility status of the First button.

    _g().getWidgetByName('report0').getToolbar(0).getWidgetByName("first").isVisible();

    Application Example

    If the Email button is invisible, a pop-up box appears with the prompt "Email sending is currently not supported."

    For details, you can download the template Whether a Toolbar Button is Visible.cpt.

    image.png

    Mobile Terminal

    This API is not supported on mobile terminals.

    setEnable


    API

    setEnable(enabled)

    To set a button on the toolbar to be enabled or disabled.

    Parameter

    enabled: boolean

    Enabled or not, which is a boolean value.

    • true: enabled

    • false: disabled

    Returned Value

    void

    Example

    Example 1: You can set a button to be disabled when the obtained toolbar button object is defined as button.

    button.setEnable(false);

    Example 2: In a general report, you can set the Email button to be disabled.

    _g().getToolbar().getWidgetByName("email").setEnable(false);

    Example 3: In a dashboard, you can set the First button to be disabled.

    _g().getWidgetByName('report0').getToolbar(0).getWidgetByName("first").setEnable(false);

    Application Example

    After submission, the Email and Print buttons on the toolbar become semi-transparent and are disabled.

    For details, you can download the template Disabled Toolbar Button.cpt.

    Screen Recording 2025-04-11 at 15.58.44 (1).gif

    Mobile Terminal

    This API is not supported on mobile terminals.

    isEnabled


    API

    isEnabled()

    To return whether a specified button on the toolbar is enabled.

    Parameter

    -

    -

    Returned Value

    boolean

    Enabled or not, which is a boolean value.

    • true: enabled

    • false: disabled

    Example

    Example 1: The API can return whether a specified button is enabled when the obtained toolbar button object is defined as button.

    button.isEnabled();

    Example 2: In a general report, the API can return whether the Email button is enabled.

    _g().getToolbar().getWidgetByName("email").isEnabled();

    Example 3: In a dashboard, the API can return whether the First button is enabled.

    _g().getWidgetByName('report0').getToolbar(0).getWidgetByName("first").isEnabled();

    Application Example

    If the Email button is disabled, a pop-up box appears with the prompt "The Email button is disabled. Email sending is currently not supported."

    For details, you can download the template Whether a Toolbar Button is Enabled.cpt.

    image.png

    Mobile Terminal

    This API is not supported on mobile terminals.

    Attachment List


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

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy