IBM工作灯6.1 - 如何显示一个提示对话框? [英] IBM Worklight 6.1 - How to display a prompt dialog?

查看:134
本文介绍了IBM工作灯6.1 - 如何显示一个提示对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它能够显示在公共资源的提示框(preVIEW作为公共资源),但它不是在Android Emualtor工作。

It was able to display a prompt box in common resources ("preview as common resources"), but it is not working in the Android Emualtor.

这是什么原因?

推荐答案

你试过<一个href=\"https://cordova.apache.org/docs/en/3.1.0/cordova_notification_notification.md.html#notification.prompt\"相对=nofollow>使用科尔多瓦的navigator.prompt ?

例如,在常见的\\ main.js:

For example, in common\main.js:

function wlCommonInit() {
    navigator.notification.prompt(
        'Please enter your name',  // message
        onPrompt,                  // callback to invoke
        'Registration',            // title
        ['Ok','Exit'],             // buttonLabels
        'Jane Doe'                 // defaultText
    );
}

function onPrompt() {
    alert("prompted");
}

我在iOS的测试,但它会在Android的正常工作。

I tested this in iOS, but it will work in Android as well.

在previewing您的应用程序,使用一些存根或常规JS实现,但对于移动环境,使用科尔多瓦的。

When previewing your application, use some stub or "regular" JS implementation, but for the mobile environments, use Cordova's.

这篇关于IBM工作灯6.1 - 如何显示一个提示对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆