文件说:
显示一个简单的提示弹出窗口,其中包含输入,确定按钮和取消按钮.如果用户按下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) 我加入ChangeListener到JTabbedPane在的构造函数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)