Hi Gunter,
it should happen on the onInit method, this is where I suppose you get the data for your model.
If you get it in this way:
var oModel = new sap.ui.model.json.JSONModel(URL);
then you'd better make a ajax call from that.
$.ajax({
url: URL,
type: "GET",
dataType: 'json',
contentType: "application/json",
Accept: "application/json",
async: false,
success: function(data, textStatus, XMLHttpRequest) {
// here you set the data to the model
oModel.setData(data);
},
error: function(data, textStatus, XMLHttpRequest)
{
alert("error");
}
});
//Now if the call was successful, you could get the data from the Model:
//(I am not sure how exactly your data is structured, check in the debugger of your browser,
//or call your REST through a REST Client to find out )
var losKlassen = oModel.oData.LOSKLASSEN_ID;
//now you have the value and you could do whatever you want to do with it.
Regards,
Georgi