• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Class (DataResubmissionHandler)
2
3Implements the **DataResubmissionHandler** object for resubmitting or canceling the web form data.
4
5> **NOTE**
6>
7> - The initial APIs of this component are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
8>
9> - The initial APIs of this class are supported since API version 9.
10>
11> - You can preview how this component looks on a real device, but not in DevEco Studio Previewer.
12
13## constructor<sup>9+</sup>
14
15constructor()
16
17Constructs a **DataResubmissionHandler** object.
18
19**System capability**: SystemCapability.Web.Webview.Core
20
21## resend<sup>9+</sup>
22
23resend(): void
24
25Resends the web form data.
26
27**System capability**: SystemCapability.Web.Webview.Core
28
29**Example**
30
31  ```ts
32  // xxx.ets
33  import { webview } from '@kit.ArkWeb';
34
35  @Entry
36  @Component
37  struct WebComponent {
38    controller: webview.WebviewController = new webview.WebviewController();
39
40    build() {
41      Column() {
42        Web({ src: 'www.example.com', controller: this.controller })
43          .onDataResubmitted((event) => {
44            console.log('onDataResubmitted');
45            event.handler.resend();
46          })
47      }
48    }
49  }
50  ```
51
52## cancel<sup>9+</sup>
53
54cancel(): void
55
56Cancels the resending of web form data.
57
58**System capability**: SystemCapability.Web.Webview.Core
59
60**Example**
61
62  ```ts
63  // xxx.ets
64  import { webview } from '@kit.ArkWeb';
65
66  @Entry
67  @Component
68  struct WebComponent {
69    controller: webview.WebviewController = new webview.WebviewController();
70
71    build() {
72      Column() {
73        Web({ src: 'www.example.com', controller: this.controller })
74          .onDataResubmitted((event) => {
75            console.log('onDataResubmitted');
76            event.handler.cancel();
77          })
78      }
79    }
80  }
81  ```
82