diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPrompt24.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPrompt24.ets index ef5a2ec40dd5850bafc134bfbb14b947bfc50b7a..79deb67d97e5109a379f56c5ce8465bf50c8acc2 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPrompt24.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPrompt24.ets @@ -40,6 +40,7 @@ struct promptExample { ], success: function(data) { console.log('dialog success callback,click button : ' + data.tapIndex); + Utils.emitEvent(this.text,404) }, fail: function(data) { console.log('dialog fail callback' + data.errMsg); @@ -63,6 +64,7 @@ struct promptExample { ], success: function(data) { console.log('dialog success callback,click button : ' + data.index); + Utils.emitEvent(this.text,404) }, cancel: function() { console.log('dialog cancel callback'); @@ -97,7 +99,6 @@ struct promptExample { console.info('showDialog error: ' + err); }) }) - Button('showActionMenu2') .key('button6') .backgroundColor('#ffe20b48') @@ -118,6 +119,7 @@ struct promptExample { ] }) .then(data => { + Utils.emitEvent(this.text,404) console.info('showActionMenu success, click button: ' + data.index); }) .catch(err => { @@ -185,7 +187,6 @@ struct promptExample { .fontSize(20) .margin({top: 20}) .onClick(()=> { - try { promptAction.showActionMenu({ title: 'showActionMenu Title Info', @@ -211,6 +212,7 @@ struct promptExample { }; }) + Button('showDialog2') .key('button5') .backgroundColor('#ffe20b56') @@ -241,10 +243,6 @@ struct promptExample { console.error(`showActionMenu args error code is ${error.code}, message is ${error.message}`); }; }) - - - - } } } \ No newline at end of file diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterA_y.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterA_y.ets index 58a7b8ecd7d2da16af737a90e4d1132a40bca329..39bcc0f214e40db7918319c100f8a0dba5dcb77f 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterA_y.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterA_y.ets @@ -196,12 +196,13 @@ struct OhosRouterA { .fontSize(20) .margin({top: 20}) .onClick(() => { - routery.push({ - uri: 'pages/ohosRouterB', - params: { - data: 'B Page' + try { + router.enableBackPageAlert({ + message: 'Message Info' + }); + } catch(error) { + console.error(`enableBackPageAlert failed, code is ${error.code}, message is ${error.message}`); } - }); }); Button('disableAlertBeforeBackPage') diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets index 1a8aa736e879aa9e792eb299b4c5ce04897613c7..aab8d1aa27f1dcf22b78abe738ee26f73ece7602 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets @@ -23,6 +23,8 @@ let loadedUrl; @Entry @Component struct Index { + controllerhandler :ControllerHandler = new ControllerHandler(); + fullscreenexithandler :FullScreenExitHandler = new FullScreenExitHandler(); ConsoleMessage:ConsoleMessage=new ConsoleMessage(); webconTextmenuparam:webConTextMenuParam = new webConTextMenuParam(); controllerhader: ControllerHandler = new ControllerHandler(); @@ -111,6 +113,9 @@ struct Index { this.handler.constructor(); this.handler.exitFullScreen(); }) + .onFileSelectorShow((event) => { + this.handler = event.handler; + }) .onSslErrorEventReceive((event) => { AlertDialog.show({ title: 'onSslErrorEventReceive', @@ -133,9 +138,9 @@ struct Index { }) return true; }) - .onFullScreenEnter((event) => { - this.handler = event.handler; - }) + .onFullScreenEnter((event) => { + this.handler = event.handler; + }) Row(){ Button("web click").key('webcomponent').onClick(async ()=>{ console.info("key==>"+this.str) @@ -618,6 +623,62 @@ struct Index { break; } + case "emitfullscreenexithandler":{ + setTimeout(()=>{ + fullscreenexithandler.constructor() + Utils.emitEvent('succesful',69) + + },3000) + break; + } + case "emitcontrollerhandler":{ + setTimeout(()=>{ + controllerhandler.constructor() + Utils.emitEvent('succesful',69) + + },3000) + break; + } + case "emitwebconTextmenuparam":{ + setTimeout(()=>{ + webconTextmenuparam.constructor() + Utils.emitEvent('succesful',69) + + },3000) + break; + } + + case "emitportsonMessageEvent":{ + setTimeout(()=>{ + this.ports[0].onMessageEvent((result: string) => { + console.log("received message from html5, on message:" + result); + Utils.emitEvent('succesful',69) + }) + },3000) + break; + } + + case "emitportsonMessageEvent":{ + setTimeout(()=>{ + this.ports[0].onMessageEvent((result: string) => { + console.log("received message from html5, on message:" + result); + Utils.emitEvent('succesful',69) + }) + },3000) + break; + } + case "emitportsonMessageEvent":{ + setTimeout(()=>{ + this.ports[0].onMessageEvent((result: string) => { + console.log("received message from html5, on message:" + result); + Utils.emitEvent('succesful',69) + }) + },3000) + break; + } + + } + default: console.info("can not match case") }