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

Data Binding from GW to UI5

Hello All -

I am facing an issue in binding data fetched from Gateway to an Input element (<select>....</select>). As shown below, in my detail view, I have added an input element called "Company Code". I need this drop down to be populated with the Company Codes fetched from gateway.

Added the able input field using XML view (currenlty 1001 has been hardcoded - needs to be replaced with data fetched from gateway)

In Component.JS, I have written the following code to connect to gateway service:

I do not know how to bind the data fetched from GW to my input element. Appreciate if someone can help me getting this data attached.

Note: In Eclipse, I created a separate Gateway Starter Application Project to check if data is fetched successfully. I was able to get the required data from GW.

Thanks,

Vijay

Detail View.PNG (13.4 kB)
companycode.PNG (5.0 kB)
gw.png (6.9 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2014 at 01:46 PM

    You need to bind to the items in the xml view.

    <Select
    items="{ path: '/ProductCollection' }">
    <core:Item key="{ProductId}" text="{Name}" />
    </Select>
    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi -

      I am finally able to get my data from Gateway and bind it to the dropdown box. I had made a mistake of not setting the text part in <core:Item />. Had only put the Key part. This was the right syntax:

      <core:Item key = "{CompanyCode}" text = "{CompanyCode}"/>

      Thank You Sharique and Jason for guiding me to the solution. Your help is greatly appreciated.

      Thanks,

      Vijay

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2014 at 11:00 AM

    Hi Vijay,

    You have to bind the collection first to the Icon TabBar and then bind the property to the respective fields.

    Regards,

    Sharique

    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.