How to get the count property from the oData response

Hi,
I have a fullscreen view in my Fiori app where we call a oData service through table.bindItems() inside the controller.
The binding of items works fine but we have a situation when we need to display the total number of items (for e.g. 515) on the UI. We do not get this information from the VDM, so we plan to use the length property of the getList() method to determine the total number of items. But because of growing feature of the table it only reads 100 items at a time and the length property returns only 100. I have attached the listener attachRequestCompleted() for the model so that once the bindItems() request is complete i can get the length property. But my problem is that i want the total count.
I saw in the debug that when this table.bindItems() gets called it makes a oData service call and in the response i can see that there is a count property available which has the total number of items (515 for my e.g.) but how do i read this count property from the response inside my controller (probably inside my attachRequestCompleted)?? I would really appreciate any help in this regard. Thanks.
Kind Regards,
Ashish
Tags edited by: Michael Appleby

HI Chandra,
Thanks for your suggestions.
But i think in my case we do not want to get the complete list. We still want to get only 100 items initially and then if the user would scroll down he/she would see more items. But we already need to know the total number of items for the purpose of showing a message to the user. For e.g. Total issues (515),  but the table would initially show only 100 and then another 100 after scroll. So setting the size litmit to max would not help.
And to be able to use the $count you mentioned, we have to still make another oData service call which we do not want.
But as i mentioned there is already a property named "__count" in the response of the bindItems() method call and i see that it has correct count but not sure how to retrieve it inside the controller. Thanks.
Regards,
Ashish

Similar Messages

  • ADF BC - How to get validation picked up from the database.

    Is there a way the ADF BC can be created so it contains the check constraints from the database?
    I assume if it did, it would pre-fill the "validation" branch in the Entity Object Editor.

    Frank,
    Thank you very much for your reply. I've set "valuePassThrough" property of the dropdownlist to true. In the valueChangeListener, my code looks like this.
    public void TD_valueChangeListener(ValueChangeEvent valueChangeEvent) {
    System.out.println("+++++++++");
    System.out.println("TD_valueChangeListener");
    Number n = null;
    BindingContainer bc = this.getBindings();
    if(bc != null){
    System.out.println("bc is not null");
    //get the selected TD
    FacesCtrlListBinding TdIter = (FacesCtrlListBinding)bc.get("LandLegalView1Td");
    if(TdIter != null){ 
    System.out.println("TdIter is not null");
    if(valueChangeEvent.getNewValue() != null)
    try{n = new Number(valueChangeEvent.getNewValue());}
    catch(Exception e){
    e.getMessage();
    System.out.println("selected TD index="+n);
    //Object td = TdIter.getAttributeFromRow(n.intValue(), "Td");
    Object td = TdIter.getAttribute(n.intValue());
    System.out.println("real value of td=" + td);
    }else{
    System.out.println("TD is null");
    }else{
    System.out.println("TdIter is null");
    My question here is: I tried two ways of getting the real value of the new selected value. One is "Object td = TdIter.getAttributeFromRow(n.intValue(), "Td");". The other is "Object td = TdIter.getAttribute(n.intValue());". None of them give me the new selected value but the old value. Did I do anything wrong?
    Regards,
    Annie

  • How to get first 10 records from the database using JSP

    i want ot get first 10 records from the database and then after clicking the next button in the page,it must show the next precceding 10 records from the database.i am getting the first 10 records .but how to post to the same page to get another preceeding 10 record.

    Search the forums - this has been asked a lot. I usually recommend experimenting with tops and order bys until you're satisfied.
    Kind regards,
      Levi

  • How to get ther servlet name from the Httprequest / servletContext

    Hi,
    How can I get the servlet name from the Http Request / Servlet conext?
    Arthik

    I have a requirement to call the business logic either in local server / external server.
    Local / External server
    The original / main request is made to the server from the client and from the server if the main request requires some resource (second request from server side) available in the external server then I need to make a URL connection. If the requested resource is the local resource then I need to by-pass the HTTP call. So I need to verify the server name , port with the originally requested server.Then I need to check if the request servelt is available in local or not.
    Can you please help me.

  • How to get Original Message ID from the MDN of Acknowledgment?

    Hi,
    Here is the usecase...
    Host Trading Partner: ABCHost (Host)
    Trading Partner: XYZPartner
    Transport Protocol: HTTP1.1
    Exchange Protocol: AS2
    Business Protocol: Custom Document over Internet
    There are 1000s of messages sent via B2B to the Trading partner and the Acknowledgement is received. Now that the Trading Partner system receives a lot of messages per day, they are asking us to give them the MDN Ids from the Acknowledgment they sent in order to find the transaction.
    Is there a way to generate a report to do that using the Timestamp, Business Action, Sending/Host Trading Partner, AS2 Identifiers etc.?
    If not thru' the B2B Console, is there a way to write a query to run on the backend to generate the report?
    Thanks
    Bala

    Hi Bala,
    You can see the details of MDN in the B2B repository in the view "b2b_instancemessage" or in the table "tip_businessmessage_rt".
    You can refer InstanceMessageUtil (http://download.oracle.com/docs/cd/B14099_19/integrate.1012/b19324/oracle/tip/adapter/b2b/utility/InstanceMessageUtil.html).
    Rgds,
    Nitesh Jain
    [email protected]

  • How to get login crenditials(Result) from the MBO in a js file

    Hi Experts,
        I got a table from oracle db, and i have deployed it and MBO is generated.
    That table contains the login credentials which i am giving in the login page.
          I have created a login page with user id and password when i am trying to login by using the credentials which i have registered earlier the credentials are being checked in the table and it should return me yes or no if yes i have to move to next screen if no i should display some alert . My problem is that i am not knowing how to get that verified credentials and display them in my code. I am writing this line of code in java script and i am unable to know, how to handle the data after being checked from the MBO .. please help me out of this ..

    Hi Lokesh,
    You can write an object query for checking the credentials details.
    Right click mbo>Attributes>Object query>Add
    Add 2 parameters, give some name like usernameParam and passwordParam
    Map these parameters to respective fields like username and password(from MBO)
    Generate object query
         e.g. select x.username, y.password from ABC where x.username=:usernameParam and      y.password=:passwordParam
    select Return type"as single object""
    (assuming username and password are the parameters defined in the mbo ABC.)
    redeploy mbo
    call this object query to Login button and do all required mappings
    For verification, if details are/not available in backend
    You have to write some piece of code in customBeforeNavigateForward
    e.g.
    hwc.customBeforeNavigateForward = function(screenKey, destScreenKey) {
    if(destScreenKey="Employee" && screenKey=="Start"){
    //Here Employee is the MBO name
    alert("test");
    var message = getCurrentMessageValueCollection();
    alert("test1");
    var itemList = message.getData("Employee");
    alert("test2");
    var items = itemList.getValue();
    var noOfItems = items.length;
    alert("noOfItems="+noOfItems);
    if(noOfItems==0){
    alert("Invalid input");
    return false;
    Rgrds,
    Jitendra

  • How to get file input stream from the client machine by JSF Fileupload API?

    Dear Friends,
    How to get the file input stream from the client machine by JSF HtmlFileupload or fileupload API. At present, if i execute the file upload code in the client machine, it is able to get the local path of the file and looking for the file in server machine. So i am getting FileNotFoundException.
    E.g., If a file is located at client machine at following location means "C:\Test\Test.txt",
    uploadClass.getFileuploadComponent().getFilename().toString() returns "C:\Test\Test.txt". But it is looking for that file in server and throwing FileNotFoundException.
    Please post your replies soon.
    Thanks,
    JP

    Depends on which version of JSF you're using. If JSF 1.2, I wouldn't even bother trying to hack this into JSF itself unless you can use something like Seam 2 or richfaces.
    http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_fileUpload.html
    http://docs.jboss.org/seam/2.2.1.CR3/reference/en-US/html/controls.html#d0e29259 (look for s:fileUpload)
    But if I were you, a simple non-jsf form with a servlet works best for taking file uploads.
    As for JSF 2.0, there are other ways of getting it done.
    http://balusc.blogspot.com/2009/12/uploading-files-with-jsf-20-and-servlet.html

  • How to get Fennec full screen from the android project's source code?

    Hi,
    First and foremost, I'm sure this was not the proper category to post that question but I couldn't really figure out a better one. Hopefully you'll forward it to a better place.
    We would like to take the advantages of Fennec with out HTML5 framework by wrapping it into a somewhat WebView like you can do on Android. The native implementation of the webview on Android turns out to be very disappointing so far whereas Fennec runs seamlessly.
    Could you recommend us any tips to do that properly from the Fennec's Android app project?
    Basically we just want to be able to call sort of a new FennecWebView() class instance in our code (instead of the formerly new WebView() ) that will run full-screen and won't call any further things such as, bookmark manager, setting. We just want to scale this down to the very strict minimum in order to run our Canvas framework in a native app thanks to the Fennec's engine.
    Thank you very much!
    BR,
    Armand

    I've seen some interest in this from others. It was suggested that they build a web app manifest.
    https://developer.mozilla.org/en-US/docs/Apps/Getting_Started
    https://hacks.mozilla.org/2013/01/join-us-for-firefox-os-app-days/

  • How to get your $200 back from the price drop.

    Many of you likely paid with a credit card and many of the credit card companies have a price protection policy. I know american express and some mastercards do. Basically if you buy a product and the price goes down within 60 or 90 days depending on the credit card company, you get back the price difference. I know for mastercard they will refund up to $250. Try that out.

    I just got off the phone with my credit card company (ATT Universal) and they have confirmed that they do indeed honor "retail purchase protection." If you have purchased an item and the merchant drops the price within 60 days, then you can obtain a refund of up to $250.
    To all of us jilted Apple-lovers, I would suggest this course of action to resolve if possible. It's one thing to have a lone customer whining to an assistant manager of an Apple store, it's another thing to have a room full of lawyers for credit card companies in an Apple board room asking Apple how it plans to resolve the large numbers of refunds that the credit card companies were forced to pay out.
    Good luck, all!

  • How to get rid of stuff from the hard drive

    Our family iMac, with a 500GB hard drive, has only 5 GB of space left. Is there a quick, efficient way to get rid of duplicate stuff, large files, unused programs that just take up space?

    take a look @ [WhatSize|http://www.id-design.com/software/whatsize>.
    also, here's some reads to peruse:
    Your Mac needs adequate hard drive space to operate normally. How full can a drive be before it's too full? There is no hard and fast rule that says “X” amount or “%” of free drive space is needed. A low amount of RAM requires more drive space for Virtual Memory’s swap files.
    Problems from insufficient RAM and free hard disk space are discussed in this link
    http://www.thexlab.com/faqs/lackofram.html
    Here’s some general guidelines for minimum hard drive free space:
    1. As a general rule, your available space should be 5GB as an absolute minimum as it generally requires that much free space to perform an Archive and Install of Mac OS X and still preserve some free space for VM swap files.
    2. Some say that your hard drive should have at least 5% of it's capacity available for use. Still others say 10% to 15%. If you routinely process complex graphics and videos, even more space is required.
    Look at these links about freeing up more space.
    Where did my disk space go?
    _*http://www.macfixitforums.com/showflat.php?Cat=&Board=Forum38&Number=770243*_
    Download & use WhatSize described in this link or Disk Inventory X @ _*http://www.derlien.com/*_
    Freeing space on your Mac OS X startup disk
    _*http://www.thexlab.com/faqs/freeingspace.html*_
    Amazing Disappearing Drive Space
    _*http://www.pinkmutant.com/articles/TigerMisc.html*_
    Increase HD Free Space
    _*http://macosx.com/forums/howto-faqs/275191-how-easily-increase-hd-free-space-lap top.html*_
    How to free up my disk space
    http://www.macmaps.com/diskfull.html
    JGG

  • Getting a document file from the transcribed audio file

    I would like to know how to get a "document" file from the transcribed files created by Soundbooth. The files created by SB have 'xml' or 'xmp' extensions and I do not know what to do with these files or how to "read" them.
    I am on a macbook pro MAC OS 10.5.5. I have latest versions of Word, and Final Cut Pro.
    Any help would be appreciated. This is my first foray into the world of Adobe products.
    Thanks,
    Eric

    The Transcript XML files conform to the XML Standards, and are a "marked up" text document containing several pieces of information. You can open the file in TextEdit (on Mac) or Notepad (on Windows) and you should be able to see what sorts of metadata is saved for each word in the transcription. Each transcribed word is stored in a data block, along with its timestamp, the duration of the spoken word, and some other metadata. This information is invaluable when importing the file into other applications or databases.
    Neither Soundbooth nor Premiere Pro support exporting the transcript without the additional metadata or XML tags right now, but since it's a basic text file, it should be a very simple chore for a script to parse that file and write out each transcribed word to a new file.
    Durin

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

  • How can i get the count vaule from GPIB?

    I want to get the count waule from GPIB ,but I find that the vaule I get from GPIB now is the trace vaule ,
    so I ask How can i get it.

    The count of what? What kind of instrument are you using?

  • How to get the current Date from the system?

    How do I acquire the current date from the system? Also, if possible, can I assign the day, month and year separately into three variables and how? It would be thankful if some simple Example could be given. Thanx!

    import java.util.*;
    public class count {
    public count() {
    Calendar now = Calendar.getInstance();
    int month = now.get(Calendar.MONTH);
    int day = now.get(Calendar.DAY_OF_MONTH);
    int dayyear = now.get(Calendar.DAY_OF_YEAR);
    int year = now.get(Calendar.YEAR);
    int a = 365;
    int b = a - dayyear;
    System.out.println("The day is the" + " " + day);
    System.out.println("IT is the" + " " + month + " " + "month of the year");
    System.out.println("The year is" + " " + year);
    System.out.println("This many days till next year" + " " + b);
    public static void main(String[] args) {
    count cou = new count();
    }

  • How to get the query values from the url in a servlet and pass them to jsp

    ok..this is the situation...
    all applications are routed through a login page...
    so if we have a url like www.abc.com/appA/login?param1=A&param2=B , the query string must be passed onto a servlet(which is invoked before the login page is displayed)..the servlet must process the query string and then should pass all those values(as hidden values) to the login jsp..then user enters username and pswd, then there should be another servlet which takes all the hidden values of jsp and also username and pswd, authenticates the user and sends the control back to that particular application along with the hidden values...
    so i need help on how to parse the query string from the original url in the servlet, pass it out to jsp, and then pass it back to the servlet and back to the original application...damnn...any help would be greatly appreciated...thanks

    ok..this is the situation...Sounds like you have a bad design on your hands.
    You're going to send passwords in a GET request as clear text? Nice security there.
    Why not start with basic security and work your way up?
    %

Maybe you are looking for