小编Jos*_*dón的帖子

处理$ ionicPopup提示中的多个按钮

文件说:

显示一个简单的提示弹出窗口,其中包含输入,确定按钮和取消按钮.如果用户按下OK,则使用输入的值解析promise;如果用户按下Cancel,则使用undefined解析.

我在做:

$ionicPopup.prompt({ 
  //options 
}).then(function (userinput) {
  //get userinput and send to server
});
Run Code Online (Sandbox Code Playgroud)

我需要添加第三个按钮,但无法获取输入的文本,如何解决按钮的onTap事件上的承诺以获取输入?

  $ionicPopup.prompt({
   title: '¿Are you sure?',
   inputType: 'text',
   buttons: [
   { text: 'Cancel' 
     //close popup and do nothing
   },
   {
    text: 'NO',
    type: 'button-assertive',
    onTap: function(e) {  
      //send to server response NO
    }
   },
   {
    text: 'YES',
    type: 'button-energized',
    onTap: function(e) { 
      //get user input and send to server
    }
   }]
Run Code Online (Sandbox Code Playgroud)

javascript ionic-framework ionic

3
推荐指数
1
解决办法
3162
查看次数

是否可以避免将对象声明为final?

我加入ChangeListenerJTabbedPane在的构造函数JFrame.在stateChanged方法内部,我有一个方法,我在构造函数中收到一个参数,但它需要final.有可能避免这种情况吗?

 public PerfilPaciente(int operation, Patient patient) {
 tabPane.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            switch (tabPane.getSelectedIndex()) {
                case 1:
                    loadDates(patient);   // here is the problem
                    break;
            }
        }
    });
Run Code Online (Sandbox Code Playgroud)

java

2
推荐指数
1
解决办法
99
查看次数

标签 统计

ionic ×1

ionic-framework ×1

java ×1

javascript ×1