SAPUI5 oData Read function

Hi,
I'm currently creating an application which binds odata from a thirds party source to a local application.
Using my odata model, I;m trying to bind the receive data to a form control. I tried using odata model read function, like below:
this.odataModel = new sap.ui.model.odata.ODataModel("XXXXXX/SAMPLEFLIGHT/");
             var form2 = sap.ui.getCore().byId("Form2");
             // insert url parameters
             this.odataModel.read("/FlightCollection(carrid='"+param1"',connid='"+param2+"',fldate=datetime'2013-05-01T00%3A00%3A00')",
              null,
              null,
              false,
              function(oData, oResponse){
              // create JSON model
              var oODataJSONModel =  new sap.ui.model.json.JSONModel();
              // set the odata JSON as data of JSON model
              oODataJSONModel.setData(oData);
              // store the model
              form2.setModel(oODataJSONModel, "localModel");
              console.log(form2.getModel("localModel")); //successful output
I was able to retrieve the odata, but when I try to display it on my form, the output is blank, below is my view file:
var oForm1 = new sap.ui.layout.form.Form("Form2",{
       title: new sap.ui.core.Title({text: "Flight Details", tooltip: "Flight Details"}),
       layout: oLayout1,
       formContainers: [
            new sap.ui.layout.form.FormContainer("F2C1",{
                 title: "Flight Details",
                 formElements: [
                      new sap.ui.layout.form.FormElement({
                           label: new sap.ui.commons.Label({text:"Carrier ID"}),
                           fields: [
                                     new sap.ui.commons.TextField({
                                             placeholder: "Please input carrier ID",
                                               value: "{carrid}"
                 ], // end of form elements
I'm sure about the path, since there are no errors generated, and the path is a direct child from the root entry. My question is, what am I missing on odata read function, and how do I properly bind the retrieved data to the form control?
Thanks in advance!
Gin

Hi All,
Already solved the issue, by investigating the odata property of my model.
It seems that when JSONModel on odata read function, the root needs an additional "/" for the binding path.
For example, my recent path:
value: "{carrid}"
will now be accessed via
value: "{/carrid}"
I hope this will help you regarding same issue.
Thanks,
Gin

Similar Messages

  • Howto map to an odata model function import returning an entity, not an entity set?

    Hi,
    how do I map to an odate model function import returning an entity (not an entity set) in a XML view? I tried property mapping {/method/property}, which does not make a network request and sets the value to null and I tried aggregation mapping {/method}, which makes a network request with $skip=0&$top=100&$inlinecount=allpages which is of course rejected by the odata source.
    Thanks,
    Wolfgang

    Hello Dr. Wolfgang,
    you can use
      var oParams = {};
      oParams.Field1 = 'ABC';
      oParams.Field2= 'XYZ';
      oParams.Field3= '123';
      oModel.callFunction('MyFuncImport', 'GET', oParams, null, function(oResponse){
            alert("Call to Func Imp successful");
        },function(){
            alert("Call to Func Imp failed");});
    also refer SAPUI5 SDK - Demo Kit
    Regards,
    Chandra

  • Can I put a READ function in a TRUE/FALSE case structure?

    Hi,
    I have a vi that operates as controller for a mechanical system of motors.  There are several sensors of various types, that provide input to the vi, including encoders, whose period is being measured.  The attached vi is the encoder period measuring part. It measures 15 periods and tells me the average of the 15 with each loop iteration.
    In my application, the encoder period measurement is not needed unless the vi knows that ALL THE OTHER sensors in the hardware configuration are measuring values within the desired range.  For example, Sensors A, B and C should all measure between 5-10.  If they are all showing values between 5-10, then, we want the encoder value to read and display.  If only one of the sensors, say A, is measuring 12, then, we don't want the period value to READ or be subsequently processed.  So, it is easy to set up the sensors A, B, C, to give a TRUE or FALSE based on whether they are within range or not, and if all 3 are TRUE, then, that value can easily be passed to the case structure that holds my READ function for the period.  Is this a good way to do this?  The goal is to eliminate unnecessary execution time that the period READ function would consume, as well as all subsequent calculations that are performed on the period value collected.  The period data is of no use if any one of the other sensors is not in the correct range.
    If any one of the other sensors is out of range, we want to skip the encoder READ step altogether.  So, it is easy to structure a BOOLEAN in my vi as shown in the attachment.  If I do it this way, will it throw an error, or just skip the READ until the BOOLEAN is true again?  Is there a better way to prevent the READ from happening if one of my other sensor values is not within the correct range?
    Thanks,
    Dave
    Solved!
    Go to Solution.
    Attachments:
    forum JUly 18.vi ‏26 KB

    Sure, you can put a Read inside a case structure. For your application, just check that your sensors are all within range (Comparisons palette), then AND the T/F's and use the result of that for your case structure. (If you are already doing the in-range check, I can't see it here because you have 5 subVIs that I cannot open here.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • At what time you have looked at a message according to the "read" function.

    I was wondering, if you look at a message that was sent to you through iMessage again and you have the "read" function enabled, will the time that you viewed the message change. The reason to why I am wondering this is because I received a message at a certain time, while the "read" function said that the message was viewed way later, after I had received my response.
    Thank you in advance!

    It should be the same. Did you look at the message in the app the first time, or through the notification? I have the read function on, and it will not show "read" until I actually go into the app.

  • Adobe Acrobat X: Attachments and Extended Reader Functions...

    All,
    after adding attachments (e.g. PDF documents) to a PDF document and saving the document with "Extended Reader Functions" an error is shown in the Java debugger window:
    SyntaxError: missing ) after argument list
    10:Document-Level:ADBE::FileAttachmentsCompatibility
    Adobe creates a document-level javascript function called "FileAttachmentsCompatibility" within ADBE.
    Looking into the source code, the error can be easily seen
    app.alert("Dieses Dokument hat Dateianlagen. zum Anzeigen der Anlagen klicken Sie auf "Speichern", um eine Kopie des...
    (a part of the German version is shown)
    As one can see, the highlighting "Speichern" (saving) is inside of double quotation marks.
    This can only be solved by - again - saving the newly created document as a copy. Opening this document, one can edit the faulty script
    Find below the corrected version:
    var v = app.viewerVersion;
    if (v < 7)
    var n = 0;
    if (this.dataObjects != null)
      n = this.dataObjects.length;
    if (v >= 5 && v < 6 && n > 0 && (app.viewerVariation == "Full" || app.viewerVariation == "Fill-In"))
      if (this.external)
       app.alert("Dieses Dokument hat Dateianlagen. Zum Anzeigen der Anlagen klicken Sie auf "Speichern", um eine Kopie des Dokuments zu speichern. Öffnen Sie die Kopie in Adobe Acrobat, und wählen Sie "Datei" > "Dokumenteigenschaften" > "Eingebettete Datenobjekte".", 3, 0);
      else
       app.alert("Dieses Dokument hat Dateianlagen. Zum Anzeigen der Anlagen wählen Sie "Datei" > "Dokumenteigenschaften" > "Eingebettete Datenobjekte".", 3, 0);
    else if (v >= 6 && v < 7)
      if (n == 0)
       var np = this.numPages;
       syncAnnotScan();
       for (var p = 0; p < np && n == 0; ++p)
        var annots = this.getAnnots(p);
        if (annots != null)
         for (var i = 0; i < annots.length; ++i)
          if (annots[i].type == "FileAttachment")
           n = 1;
           break;
      if (n > 0)
       if (this.external)
        app.alert("Dieses Dokument hat  Dateianlagen. Zum Anzeigen der Anlagen klicken Sie oben in der vertikalen Bildlaufleiste des Dokumentfensters auf das schwarze Dreieck und wählen "Dateianlagen".", 3, 0);
       else
        app.alert("Dieses Dokument hat Dateianlagen. Zum Anzeigen der Anlagen wählen Sie "Dokument" > "Dateianlagen".", 3, 0);

    The script was automatically created by the Adobe Acrobat software...
    I know the issue, but is there any bug-fix available? I don't want to correct it for every document!
    Correction: Above you find the automatically created document.
    A corrected possibility is shown below:
    var v = app.viewerVersion;
    if (v < 7)
    var n = 0;
    if (this.dataObjects != null)
      n = this.dataObjects.length;
    if (v >= 5 && v < 6 && n > 0 && (app.viewerVariation == "Full" || app.viewerVariation == "Fill-In"))
      if (this.external)
       app.alert("Dieses Dokument hat Dateianlagen. Zum Anzeigen der Anlagen klicken Sie auf 'Speichern', um eine Kopie des Dokuments zu speichern. Öffnen Sie die Kopie in Adobe Acrobat, und wählen Sie 'Datei' > 'Dokumenteigenschaften' > 'Eingebettete Datenobjekte'.", 3, 0);
      else
       app.alert("Dieses Dokument hat Dateianlagen. Zum Anzeigen der Anlagen wählen Sie 'Datei' > 'Dokumenteigenschaften' > 'Eingebettete Datenobjekte'.", 3, 0);
    else if (v >= 6 && v < 7)
      if (n == 0)
       var np = this.numPages;
       syncAnnotScan();
       for (var p = 0; p < np && n == 0; ++p)
        var annots = this.getAnnots(p);
        if (annots != null)
         for (var i = 0; i < annots.length; ++i)
          if (annots[i].type == "FileAttachment")
           n = 1;
           break;
      if (n > 0)
       if (this.external)
        app.alert("Dieses Dokument hat  Dateianlagen. Zum Anzeigen der Anlagen klicken Sie oben in der vertikalen Bildlaufleiste des Dokumentfensters auf das schwarze Dreieck und wählen 'Dateianlagen'.", 3, 0);
       else
        app.alert("Dieses Dokument hat Dateianlagen. Zum Anzeigen der Anlagen wählen Sie 'Dokument' > 'Dateianlagen'.", 3, 0);

  • VISA Read function Read buffer problem in serial communication

    Hi,  I use VISA write and read function in serial communication app, the device continuously sends 0x00 if it is not receive a request from Labview program running on PC.
    And the request sent by labview is programmable. I met a weird problem, each time the request changes, the VISA read buffer output port still shows the last request firstly, from second time, shows the right request.
    It works like: Req code: ... 50, 51,51,51,50....;  VISA Read buffer: ...50, 50, 51, 51, 51, 51, 50....
    Please refer to the program.
    Attachments:
    readOne_test.vi ‏21 KB

    How are you running this?  You don't have a while loop around it.  Is it part of a larger VI?  Please don't tell me you are using the run continuously button.
    You don't have any wait statement between you VISA Write and your bytes at port.  So it is very likely the receive buffer is still empty since you didn't give your VI time to wait for the device to turn around and give a reply.  If you read 0 bytes, your VISA read string will be empty.  How does your decoder subVI (which you didn't include) handle an empty string?

  • I was using system.in.read function...

    i was using system.in.read function to read input.when i used the his function
    again for the second time it read the same input which was read first
    which is pretty obvious that the initial contents of the input buffer still
    contains the previos contents which is not being overwritten by the new input
    contents.can someone please tell me how to read the contents using the
    same function.i know there are a lot of other ways to accepting inputs
    but i wanted to clear this doubt of system.in.read before moving on to
    ip/op chapter of java..........

    if your reading textual data use a buffered reader.
    BufferedReader br = new BufferedReader(
                            new InputStreamReader(System.in));It will make your life easier.
    The System.in doesnt appear to support a flush method by itself. Also it typically reads in byte data, so you would have to build your strings to manipulate them.
    Unless of course, this is what you want.

  • MIDI Read function in LabVIEW 8.2

    Is there a MIDI read function in LabVIEW 8.2?

    http://forums.ni.com/ni/board/message?board.id=170&message.id=280480#M280480
    You could have aksed it in your previous post since it concerns the same functions.
    André
    Message Edited by andre.buurman@carya on 10-26-2007 09:12 AM
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • In the new iOS-7 Safari, has the "reader" function been changed to eliminate the option to modify font size (and hence to modify the number of words per line), or is it just that I can't find how to do that?

    In the new iOS-7 Safari, has the "reader" function been changed to eliminate the option to modify font size (and hence to modify the number of words per line), or is it just that I can't find how to do that?

    iOS 7
    Seperate text size modification is no longer available in Safari Reafer.
    Use Settings.
    Settings >General > Text Size

  • Read in Binary form in VISA read function

    Dear All,
    I have connected my Device to the serial Port. and data read from the buffer is stored in text format. I want to view the data in binary format .
    Actually, i have performed the same function in Visual Basic. there also if i view the data in text format, it shows some junk values. but if i view the data in binary, it shows the actual data coming from the instrument .
    I dont know how to modify the VISA read function. can any one pls tell me how can i read the data in binary format?
    Thanks
    Ritesh

    Oops!  No it didn't.
    Lab VIEW 2012 (if that makes a dif)
    I'm using the VISA Read function to take ADC readings in from a microcontroller.  The VISA Read function outputs the data as a string.  Easy to convert the string to U8, either with the conversion function or type cast function, and works great except for a tiny corner case when the ADC reading is zero.  The VISA Read function treats the 8-bit zero reading as a null character and strips it out.
    Apparently, since this is done by the VISA Read function as it's building the string, type casting and or converting the output string from the VISA Read function doesn't "bring the zeros back".
    I've tried setting the VISA property "Discard NUL Characters" to false, and that didn't seem to help.
    My current work around is just to never have the micro send a zero ADC reading. 
    Anyway, I'm a Lab VIEW noob, so while this isn't essential to my project, I remain curious about how to send Lab VIEW serial data that isn't automatically considered characters, thrown into a string with all the zeros stripped out.
    Regards,
    Who

  • "Reader" function in Safari

    I lost the Reader function width the recent upgrade. Can @i get it back?

    Welcome to the Support Communities. When viewing your post, at right you'll see a More Like This section — you'll probably find the answer to your question there. Also, this tutorial may help in future:
    ASC — Search the community

  • Send data from GPIB Read Function to XY Graph

    hello
    I'm really new to LabVIEW so this is probably an easy one, but I'm having a serious issue trying to figure this one out. how do I send data from GPIB Read Function to a graph, let's say XY Graph. my data consists of a string of numbers, separated by commas, alternating between X and Y values. for instance:
    0, 0, 0.1, 0.2, 0.2, 0.4, 0.3, 0.9, 0.4, 1.6, 0.5, 2.5, 0.6, 3.6, 0.7, 4.9
    which would graph a parabola. I tried to connect the output (data) of BPIB Read Function to XY Graph, but I get an error. do I have to do something else before I send that data to the XY Graph? thanks for any suggestions.
    r. 
    Solved!
    Go to Solution.

    first of all, thanks a bunch for replying
    I added "spreadsheet string to array function" and it looked OK (I didn't connect anything to 'array type' because I couldn't figure out what those blocks were - I'm really new to LabVIEW"
    I couldn't find "decimate array" so I added "decimate 1D array," which is what my labVIEW listed (I have 8.6). I fed that directly into "express XY Graph," which lets me feed separate X and Y values (or so I assume). but, even though the input to "decimate 1D array" and output of "spreadsheet string to array function" say 'array' - the program is not happy. when I move my mouse over the 'x', the following is the message that I get:
    "you have connected two arrays of different dimensions.
    The dimension of  is 2. 
    The dimension of  is 1." 
    I'm not quite sure what that means. any suggestions what I can do with it?
    Attachments:
    Picture 1.png ‏11 KB

  • Did we lose reader function with iOS 7 upgrade ?

    What happened to " reader" function using Safari ?
    The function to the right of URL said reader, when clicked opened a clean window with no ads our distracting text or graphics, just the article making it easy to read.
    I don't see it on my iohone5, iMac or iPad.

    It only works with some web pages, not all.

  • How to change the language of the reading function in Pages 5.0 (to French in my case) ?

    I'm French and in the new Pages 5.0 there is a reading function (mac reads my document) but the issue is this function uses an English conception of the word and spelling, it changes my text and makes it uncomprehensible.
    Can someone help me ?

    If you are talking about text to speech, I think you have to go to system preferences/speech and make sure the system voice is set to a French one.

  • HT5275 Why did this update eliminate Safari's RSS reader function? Grrrrr.

    So, I have a number of RSS sources in a folder titled "News" in my bookmarks bar. I select it and am able to either go to individual RSS source or "View All RSS Sources" (which I use all the time) or open all in tabs (this one's not a good idea!). After updating, the "View All RSS Sources" is gone as Safari no longer has an RSS reader function. Too bad (and I really mean that!) and seemingly unaccounted for if I call APple for assistance... just "No Safari RSS reader in the update. Oh, and there's no way to go back!"
    I use  "View All RSS Sources" twice daily (at least) because it is adjustable... my list is sorted by Unread, and it highlights those. Very convenient! An excellent function... no in the dumpster! Grrrrrrrr!
    Anyway, now I cannot do this function on my MBP w/Mtn Lion (update to Safari included in the update to Lion) or on my Mac Pro w/Lion (I updated Safari automatically, then found the "improvement"). So now my mini is not going to be updated until I am able to find an outside app that'll give me this function back. And no more buying upgraded minis, either. Grrrr.
    Anyway, anybody know why the function was removed in the update?
    ADDED POST POSTING: it appears I've lost spellcheck while using an outdated version of Safari  

    Hi,
    Another thing you can try is this:
    - Quit Safari
    - Open up a Terminal window (via Applications -> Utilities -> Terminal.app)
    - Type <pre>dscacheutil -flushcache</pre> and then press the Return key
    - Restart Safari
    What that does is flush the local DNS cache on your machine. DNS is how computers convert human-readable names (i.e. www.apple.com) into IP addresses (17.112.152.32) that computer networks use to resolve machine locations.
    No guarantees this will work, but it's worth a shot.

Maybe you are looking for

  • Insert video question

    Hi. I have inserted video no problem, and am now trying to get the first frame to show an image I made (the current first frame is black on pageload, which looks bad). Can anyone tell me how I might do this? Thanks! -Derek CEO, Shimano Fishing

  • V$undostat and maxqueryid

    Hi, Using Oracle 11.1.0.7 one of our customers had space problems with UNDO tablespace. We tried to get an overview of whats going on using v$undostat. One of the columns is MAXQUERYID and join to v$sqlarea we tried to pinpoint longrunning sql. But e

  • Adobe XI - Redation Tool

    Is there an option in the Adobe XI to use the Redaction Tool?

  • Is it possible to query a collection and get the last logged on user?

    Hi Is it possible in SCCM to query a collection to get the computer names and the last logon user for each computer? I cant seem to find how to do this? Thank you

  • Ipod Nano 3rd gen. won't allow videos to be synced

    My itunes account allows me to download and play TV shows on my computer, but when I try to sync them to my ipod, they won't. My ipod also won't allow me to reset it to factory settings, even when in disk mode. Any ideas?