Skip to Content
0

How to determine type entity type of an Odata binding

Oct 11, 2017 at 10:19 PM

33

avatar image
Former Member

I'm trying to create a baseclass method that can be called by different view that my be looking at different entities in the model. I would like to get the name of the entity of this.getModel().getObject(this.getView().getBindingContext().sPath)

Is there some way to determine the entity type of the returned object?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jamie Cawley
Oct 12, 2017 at 12:01 PM
0

You can get the type by using

this.getModel().getObject("/#EntitySetName/Property/@type");

Regards,

Jamie

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 12, 2017 at 01:32 PM
0

Thanks for your reply but it is the EntitySetName that I am trying to get. My model has two entity sets, PRHeaders and PRItems. Within the common routine I am writing I execute "this.getModel().getObject(this.getView().getBindingContext().sPath)" which may return a PRHeader or a PRItem depending on the view that is calling the routine. I need to be able to determine the Entity Set Name of the returned object.

Mike

Share
10 |10000 characters needed characters left characters exceeded