hi all,
i have a JSON Model:
[
{
"ARBPL": "42",
"WERKS": "0111",
"KTEXT": "AUFH"
},
{
"ARBPL": "47",
"WERKS": "0111",
"KTEXT": "text",
"SCHICHT": [
{
"BEGZT": "060000"
},
{
"BEGZT": "140000"
},
{
"BEGZT": "220000"
}
]
},
{
"ARBPL": "FZ",
"WERKS": "0111",
"KTEXT": "RIC01Richtpresse1"
},
{
"ARBPL": "FZ",
"WERKS": "0111",
"KTEXT": "text"
},
{
"ARBPL": "PA",
"WERKS": "0111",
"KTEXT": "text"
},
{
"ARBPL": "PO",
"WERKS": "0111",
"KTEXT": "text"
}
]
at first selectbox i have all ARBPL. if the user select one, in the second selectmenu should be the BEGZT of a workplace. (in the json example, there are begzt values only for one ARBPL, but in future there are BEGZT at each workingplace.
so my first select is:
var ItemTemplateArbplSelect = new sap.ui.core.Item({ | |
key : "{getLogonArbplModel>ARBPL}", | |
text : { | |
parts : [ "getLogonArbplModel>ARBPL", "getLogonArbplModel>KTEXT" ], | |
formatter : function(ARBPL, KTEXT) { // all parameters are |
// strings |
if (ARBPL, KTEXT) { | |
return KTEXT + " - " + ARBPL; | |
} else { | |
return "empty value from backend"; | |
} | |
} | |
} |
}); |
var arbplSelect = new sap.m.Select("logon_arbplSelect", { | |||||||||||||||||||||||||
items : { | |||||||||||||||||||||||||
path : "getLogonArbplModel>/", | |||||||||||||||||||||||||
template : ItemTemplateArbplSelect | |||||||||||||||||||||||||
} | |||||||||||||||||||||||||
second template is:
|
so can anybody tell me how it should work in SAPUI5 to dependency databinding?
thanks, Alex