on ‎2019 Dec 11 7:53 AM
Hi Experts,
How to put validation on combo box and Datepicker written in a java script view?
var myJSON = {
Data: [{
Reason: "Reason1"
}, {
Reason: "Reason2"
}, {
Reason: "Reason 3"
}, {
Reason: "Reason4"
}]
}
if (!this.dialog) {
var dialog = new Dialog({
title: 'Say to reject',
width: "50%",
type: 'Message',
content: [
new Label({
width: '50%',
text: 'Reason of rejectione?',
labelFor: 'rejectDialogTextarea'
}),
new sap.m.ComboBox('combobox', {
width: '50%',
items: {
path: "/Data",
template: oItem
}
}),
new Label({
width: '50%',
text: 'Date of rejection?',
labelFor: 'rejectDialogTextarea'
}),
new sap.m.DatePicker("datePicker", {
width: '50%',
valueFormat: "dd-MM-yyyy",
displayFormat: "MM-dd-yyyy",
value: datepickerdate
})
]
Request clarification before answering.
Hi,
You can add Selection change event for dropdown and change event for date picker.
var myJSON ={Data:[{
Reason:"Reason1"},{
Reason:"Reason2"},{
Reason:"Reason 3"},{
Reason:"Reason4"}]}if(!this.dialog){
var dialog=newDialog({title:'Say to reject',width:"50%",type:'Message',
content:[new Label({width:'50%',text:'Reason of rejectione?',
labelFor:'rejectDialogTextarea'}),
newsap.m.ComboBox('combobox',{width:'50%',
items:{
path:"/Data",
template: oItem
},
selectionChange: function (){
var value = sap.ui.getCore().getControl('numCombo').getKey();
//Here you can put your validation code
}
}),new Label({width:'50%',text:'Date of rejection?',
labelFor:'rejectDialogTextarea'}),newsap.m.DatePicker("datePicker", {width:'50%',
valueFormat:"dd-MM-yyyy",
displayFormat:"MM-dd-yyyy",value: datepickerdate,
change:function(evt){
var date = evt.oSource.mProperties.dateValue;
//Add Validationcode here for date
}
})Regards,
Manjunatha Devadiga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.