Skip to Content
author's profile photo Former Member
Former Member

Table data in a text field

Hey friends,

I have implemented a Table getting JSON data, and i have also set that data to

oModel.setData(data);// fill the received data into the JSONModel

sap.ui.getCore().setModel(oModel);

i have made the global declaration of data , Which i am getting from the Backend....

But wen i use to get the data in the textField its not comming ,

My textfield Code here ,

var oTxt = new sap.ui.commons.TextField("txtField", {

// bind text property of textfield to firstName property in the model

value: "{NscItem}"

});

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

sap.ui.getCore().setModel(oModel);

oTxt.bindValue("/");

//oTextView.placeAt("target11");

oTxt.placeAt("target11");

Only [object, object] is comming several times in the textField .

What is the solution for this Where i am going wrong ? 😔

I reffered from this page for basics, but i am using Json data from Localhost

https://help.sap.com/saphelp_nw74/helpdata/en/91/f0f3cd6f4d1014b6dd926db0e91070/content.htm

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2013 at 02:53 PM

    Hi Vishnu,

    You could either use

    oTxt.bindValue("/0/NscItem");

    or

    var oTxt = new sap.ui.commons.TextField("txtField", {

    // bind text property of textfield to firstName property in the model

    value: "{/0/NscItem}"

    }).placeAt("target11");

    Find below example with changes

    JS Bin - Collaborative JavaScript Debugging

    below message might help

    http://scn.sap.com/thread/3475667

    Thanks and Regards, Venkatesh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.