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

How to get the ID from the XML tag , Fiori(UI5)?

Hi,

i am developing a Fiori app with an XML View.

In the view I have a <List> and an <ObjectListItem> with ID.

I would like to get the ID from the selected List item, so i can show this element in details in the next view.

The problem is that i don't have a List[] in my JSON Object, so i don't have the aggregaton item="/SalesOrderCollection" like in some tutorial i read.

My JSON lookslike that:

{

"someText" : true,

"someOtherText": {

"Name" : {

"DisplayValue" : "someValue",

"Value: "otherValue"

},

"Account" : {

"DisplayValue": "something"

"Value" : "somethingElse"

}, and so on....

Thanks fin advance!

Regards,

Georgi Nushev

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Feb 22, 2014 at 08:15 PM

    Hi Georgi,

    You need to register list select event first in VIEW first, as follows:

    <List id="listId" select="onSelectEvent" mode="SingleSelectMaster">
        <ObjectListItem
                title="{Value1}">
          </ObjectListItem>
    </List>
    
    

    As you can see in view onSelectEvent() will be fired whenever user selects any list item.Now you need to define onSelectEvent() in your controller as follows:

    onSelectEvent : function(oEvent){
      var listItem = oEvent.getParameter("listItem");
      var getTitle = listItem.getTitle(); //this will give you the Title of the selected list item.
    },
    
    
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 21, 2014 at 01:30 PM

    Hi,

    Refer this blog Simple SAPUI5 Views handling

    In this blog, you will find examples on how to get the ID from xml tags. Also refer Documentation/AdvancedTopics/MVC – SAPUI5 Wiki (TIP CORE User Interface) here it is explained how to refer UI control ID.

    Regards,

    Chandra

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2016 at 03:27 PM

    hi

    I want to bind the title data in a label value is it possible. plz give suggestion.

    Thank u

    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.