Description

  • Description of the textarea widget

Interface version

Version number Writer Date Description
1.0 Qin Zhitian June 29, 2021 initial release

IP address

http://192.168.1.1/wapi

API list

Name Description
set set attributes
get get attributes

1. set

Description of request parameters

Parameter Name Type Description
attr string attribute
attr.type string type: event_click-‘click-event trigger ’;prompt_text-‘set placeholder text’;fill_text-‘set text content ’;encrypt-‘encrypted ’;mode_text-‘mode’;add_text-‘add text ’;event_clear-‘clear text’;
attr.string_value string parameter:prompt_text-‘text’;fill_text-‘text ’;encrypt-‘on-encrypted,off-not encrypted’;mode_text-‘on-one line,off-normal’;add_text-‘text ’;event_clear-‘one-clear one,all-clear all’;

Call example

{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
        "type": "event_click"
    }
}
Note: click the text area to trigger an event callback;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "prompt_text",
            "type": "text"
    }
}
Note: set the placeholder text content in the text area to "text";
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "fill_text",
            "type": "text"
    }
}
Note: set the text content in the text area to "text";
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "encrypt",
            "type": "on"
    }
}
Note: Encryption mode is enabled;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "encrypt",
            "type": "off"
    }
}
Note: Encryption mode is disabled;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "mode_text",
            "type": "on"
    }
}
Note: set the text area to one line mode;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "mode_text",
            "type": "off"
    }
}
Note: set the text area to normal mode;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "add_text",
            "type": "text"
    }
}
Note: insert "text" at the current cursor position;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "event_clear",
            "type": "one"
    }
}
Note: delete a character on the left from the current cursor position;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "event_clear",
            "type": "all"
    }
}
Note: clear all characters from the current cursor position;

Return example

{
    "code": 0
}

Description of return parameters

Parameter Name Type Description
result string result information
result.code int error code

Error Code

Error Code Description

2. get

Description of request parameters

Parameter Name Type Description

Call example

{
    "wid": "s1",
    "cmd" : "get"
}

Return example

{
    "code": 0
}

Description of return parameters

Parameter Name Type Description
result string result information
result.code int error code

Error Code

Error Code Description
文档更新时间: 2021-08-19 17:22   作者:plj