Implements the DataResubmissionHandler object for resubmitting or canceling the web form data.
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.
The initial APIs of this class are supported since API version 9.
The sample effect is subject to the actual device.
constructor()
Constructs a DataResubmissionHandler object.
System capability: SystemCapability.Web.Webview.Core
resend(): void
Resends the web form data.
System capability: SystemCapability.Web.Webview.Core
Example
// xxx.ets
import { webview } from '@kit.ArkWeb';
@Entry
@Component
struct WebComponent {
controller: webview.WebviewController = new webview.WebviewController();
build() {
Column() {
Web({ src: 'www.example.com', controller: this.controller })
.onDataResubmitted((event) => {
console.info('onDataResubmitted');
event.handler.resend();
})
}
}
} cancel(): void
Cancels the resending of web form data.
System capability: SystemCapability.Web.Webview.Core
Example
// xxx.ets
import { webview } from '@kit.ArkWeb';
@Entry
@Component
struct WebComponent {
controller: webview.WebviewController = new webview.WebviewController();
build() {
Column() {
Web({ src: 'www.example.com', controller: this.controller })
.onDataResubmitted((event) => {
console.info('onDataResubmitted');
event.handler.cancel();
})
}
}
}