【问题标题】:IBM Worklight 6.2 - adding text input in WL.SimpleDialogIBM Worklight 6.2 - 在 WL.SimpleDialog 中添加文本输入
【发布时间】:2014-11-13 05:15:28
【问题描述】:

我知道通过添加WL.SimpleDialog.show 我可以显示带有按钮的原生样式对话框/警报框。但是是否可以使用 文本框 以及是和否按钮来显示相同​​的内容。

【问题讨论】:

    标签: ibm-mobilefirst worklight-runtime


    【解决方案1】:

    WL.SimpleDialog 无法实现这一点。但是,如果“文本框”是指其中包含输入字段的对话框,也称为提示,那么您可以在以下问题中按照我的示例进行操作:IBM Worklight 6.1 - How to display a prompt dialog?

    您的案例中的代码可能是这样的:

    navigator.notification.prompt(
            'Replace me',  // message
            onPrompt,                  // callback to invoke
            'myPrompt',            // title
            ['Yes','No'],             // buttonLabels
            'My default text'                 // defaultText
        );
    }
    
    function onPrompt() {
        alert("prompted");
    }
    

    【讨论】:

      猜你喜欢
      • 2014-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多