Skip to Content
0
Former Member
Aug 06, 2014 at 10:00 AM

Access value of my oData model

1878 Views

Hi there,

I've created a form which fields are bound to a oData model.

That works fine.

But now I've the following problem:

I have a value RequestTypeID in my model which should not be displayed on the view, but which should be used to determine how data should be displayed on the view.

How can I access that value?

I've tried the following:

var oTextRequestTypeID = new sap.ui.commons.TextField(
     "textRequestTypeID",
     {
          value : "{HandleRequestType/Request/RequestTypeID}"
     });

var requestTypeID = "";
requestTypeID = oTextRequestTypeID.getValue();

Nevertheless my variable requestTypeID still keeps the value "".

But if I display the TextField oTextRequestTypeID on the screen, it displays the correct value.

My question:

What is the best practice to access such values which should not be displayed on the view?

Is it possible to bind it directly to a variable?

Thanks in advance.

Best regards,

Thorsten.