×

Discussion Board

Results 1 to 5 of 5

Threaded View

  1. #1
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,357

    XML : Data filtering

    Hi,
    I have an xml like below
    Code:
     <channel>
        <item>
              <type> On </type>
              <title> item1 <</title>
               <imagePath> http://... </imagePath>
         </item>
    <item>
              <type> On </type>
              <title> item2 <</title>
               <imagePath> http://... </imagePath>
         </item>
    <item>
              <type> Off </type>
              <title> item3 <</title>
               <imagePath> http://... </imagePath>
         </item>
    <item>
              <type> Off </type>
              <title> item4 <</title>
               <imagePath> http://... </imagePath>
         </item>
    <item>
              <type> On </type>
              <title> item5 <</title>
               <imagePath> http://... </imagePath>
         </item>
    </channel>
    I am using XmlListModel to parse the XML and display the xml content in a delegate like below
    Code:
    XmlModel {id: feedModel}
        ListView {
            id: list
            width: mainwindow.width ; height: mainwindow.height
            model: feedModel
            delegate: NewsDelegate {}
        }
    With this above code I can perfectly display all the items in the listview. Now what I am trying to do is, I just want to display the items that are having On in there <type> tag.
    I put a check in the delegate file and can display item that are having On in there <type> tag, with the below code
    Code:
                    Image {
                        id: thumb
                       source: if(type == "On"){imagePath}   // display only one  category item
                        x: 1; y: 1; smooth: true
                    }
    But when I do this it displays the 1st, 2nd and the 5th items leaving the 3rd and 4th place blank (empty). I mean in the listview the 3rd and 4th place remains empty, and the 5th item doesn't comes after the 2nd item.


    Any idea why this is happening or how can I resolve this. please suggest me
    Last edited by somnathbanik; 2011-08-02 at 07:39. Reason: added

Similar Threads

  1. FILESELECTIONDIALOG not filtering the data
    By pooja_1650 in forum Symbian
    Replies: 2
    Last Post: 2010-02-12, 09:25
  2. XML data sending problem
    By amit04.kumar in forum Symbian
    Replies: 10
    Last Post: 2009-10-26, 15:36
  3. Filtering data from accelerometer
    By BAM8 in forum Symbian
    Replies: 7
    Last Post: 2009-08-25, 12:22
  4. Problem in loading xml data
    By mehraj123 in forum Symbian
    Replies: 1
    Last Post: 2009-01-24, 12:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×