Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9236

Dynamic creation of json model

$
0
0

Hi Friends,

is it possible to create a model dynamically like below?


Here the ConfigLine.ENTITY_NAME is  'MATERIAL' and the Model should be "JMODMATERIAL" later.

 

var jModName = "JMOD" + ConfigLine.ENTITY_NAME; 

 

var jModName = new sap.ui.model.json.JSONModel();

 

oModel.read(entity, null, null, false,

       function(RESP, oResponse) {

      jModName.setData(RESP);

  }, null);

 

And later:

 

var jModName = "JMOD" + ConfigLine.ENTITY_NAME;

var tabData =jModName.getData();

 

But it does not work.

Any help would be appreciated.

Rg. Joerg


Viewing all articles
Browse latest Browse all 9236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>