2015-12-17 64 views

回答

1

選項1 sap.m.Input:設置每個啓用您的輸入控制的情況下在onAfterRendering

var oInput = sap.m.Input(...); 
oInput.addEventDelegate({ 
    onAfterRendering : function() { 
     this.setEnabled(false); 
    } 
}); 

選項2:使用視圖模型

//in controller: 
var oModel = new sap.ui.model.json.JSONModel({ 
    enabled : false 
}); 
this.getView().setModel(oModel, "view"); 

//... 
var oInput1 = sap.m.Input({ 
    enabled : "{view>/enabled}" 
}); 
var oInput2 = sap.m.Input({ 
    enabled : "{view>/enabled}" 
}); 

//... 
// in the controller changing the model once will affect all the input controls 
this.getView().getModel("view").setProperty("/enabled", true); 
相關問題