General API for Toolbar Button

  • Last update:  2022-02-14
  • visible

    Methodvisible()Set a toolbar button visible
      Parameter

    -

    -

    Return valuevoid
       Example

    Example 1: If the obtained toolbar button object is defined as button , set the button to be visible:

    button.visible();

    Example 2: Set the "Mail" button visible in a general report:

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

    Application

    example

    After the data entry is successful, the "Email" and "Print" buttons will appear on the toolbar:

    Click to download the template: 

    Toolbar buttons are visible.cpt

    1.gif

    MobileNot support mobile terminal

    invisible

    Methodinvisible()Set a button in the toolbar invisible
      Parameter

    -

    -

    Return valuevoid
       Example

    Example 1: If the obtained toolbar button object is defined as button , set the button to be invisible

    button.invisible();

    Example 2: Setting the "Mail" button to be invisible in a general report

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

    Application

    example

    After the data entry is successful, the toolbar hides the "Email" and "Print" buttons:

    Click to download template: 

    Toolbar buttons are invisible.cpt

    2.gif

    MobileNot support mobile terminal

    setVisible

    MethodsetVisible(visibility)Set a toolbar button to be visible/invisible
      Parameter

    visibility: boolean

    Whether visible,boolean

    • true:visible

    • false:invisible

    Return valuevoid
        Example

    Example 1: If the obtained toolbar button object is defined as button , set the button to be invisible

    button.setVisible(false);

    Example 2: Setting the "Mail" button to be invisible in a general report

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

    Application

    example

    After the data entry is successful, the toolbar hides the "Email" and "Print" buttons:

    Click to download the template:

    Toolbar buttons are invisible.cpt

    3.gif

    MobileNot support mobile terminal

    isVisible

    MethodisVisible()Whether a button in the toolbar is visible
      Parameter

    -

    -

     Return value

    boolean

    Whether visible, boolean

    • true:visible

    • false:invisible

        Example

    Example 1: If the obtained toolbar button object is defined as button , return whether the button is visible

    button.isVisible();

    Example 2: In a general report, return the current display status of the "Mail" button

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

    Application

    example

    When the "Mail" button is not visible, a pop-up window reminds that sending mail is currently not supported:

    Click to download the template:

    Whether toolbar button is visible.cpt

    4.png

    MobileNot support mobile terminal

    setEnable

    MethodsetEnable(enabled)Set a toolbar button to be enabled/disabled
      Parameter

    enabled: boolean

    Whether enabled, boolean

    • true:enabled

    • false:disabled

    Return valuevoid
        Example

    Example 1: If the obtained toolbar button object is defined as button , set this button to be disabled

    button.setEnable(false);

    Example 2: Setting the "Mail" button to be disabled in a general report

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

    Application

    example

    After the data entry is successful, the "Mail" and "Print" buttons on the toolbar will be displayed semi-transparently, and they will be disabled if you click:

    Click to download the template:

    Toolbar buttons are disabled.cpt

    6.gif

    MobileNot support mobile terminal

    isEnabled

    MethodisEnabled()Whether a button in the toolbar is enabled
      Parameter

    -

    -

    Return value

    boolean

    whether enabled, boolean

    • true:enabled

    • false:diabled

        Example

    Example 1: If the obtained toolbar button object is defined as button , return whether the button is enabled

    button.isEnabled();

    Example 2: In a general report, return whether the "Mail" button is enabled

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

    Application

    example

    When the "Mail" button is disabled, a pop-up window reminds that sending mail is currently not supported:

    Whether toolbar button is enabled.cpt

    Click to download the template:

    6.png

    Mobile Not support mobile terminal


    Attachment List


    Theme: Secondary Development
    • 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