custom list view

I want to show the element as above.

What I did...

taken from an xml file and add the element as



    
    
    
        
    
         

    
         


but the divider after each item.

I guess as you wish something in the xml file.

and showing lsitview as below

 ListView {
            dataModel: XmlDataModel {
                source: "xml/Preferences.xml"
            }

        listItemComponents: [

            ListItemComponent {
                type: "listItem"
                StandardListItem {
                    title: ListItemData.title
                    description: ListItemData.subtitle

                }
            }
        ]
    }}

Please tell me what I'm missing

your xml structure creates new elements for each title AND subtitle.
subtitle should be added as an attribute to listitem with a title attribute (a xml element with two attributes, not two with one)

Tags: BlackBerry Developers

Similar Questions

  • view the json data in the custom list field

    Hi, I did analysis json and I created the custom list field. Now, I want to display only the data analyzed in my custom list field. I'll post my analyzed data from json and here is the code for my custom list field
    data analyzed.
    I have THREE channels of json and I want to show content tittle and date in the list filed. I'll post the screenshot of my list.

    JSONArray jsnarry = new JSONArray(responce);
                System.out.println("\n--length----- "+jsnarry.length());
                //System.out.println("....................................................=");
                for (int i = 0; i < jsnarry.length(); i++){
    
                    JSONArray inerarray = jsnarry.getJSONArray(i);
                        //System.out.println("\n-inerarray-values----- "+inerarray.getString(i1));
                        String TITTLE = inerarray.getString(1);
                        String CONTENT = inerarray.getString(2);
                        String DATE = inerarray.getString(3);
                                                           System.out.println("TITTLE= "+TITTLE);
                        System.out.println("CONTENT= "+CONTENT);
                        System.out.println("DATE= "+DATE);
    
    }
    

    output

    [0.0] --length----- 2
    [0.0]
    [0.0] -innerarray-length----- 6
    
    [0.0] TITTLE= BJP State President Sanjay Tandon's visit to Amita Shukla's Home
    [0.0] CONTENT=  BJP President Chandigarh Sanjay Tandon at Amita Shukla's Home
    [0.0] DATE= 2013-01-04
    [0.0] ................................................
    [0.0] TITTLE= Sanjay Tandon at mahasamadhi of Satya Shri Sai baba.
    [0.0] CONTENT= BJP Chandigarh President, Sanjay Tandon mahasmadhi of Sri Satya Sai Baba.(Andhra Pradesh)
    [0.0] DATE= 2013-01-13
    

    and my custom list field

           super(NO_VERTICAL_SCROLL);
    
             String TITTLE="TITTLE";
             String CONTENT = "CONTENT";
             String DATE = "DATE";
    
             v.addElement(new ListRander(listThumb, TITTLE, CONTENT,DATE, navBar));
    
             myListView = new CustomListField(v){
    
                 protected boolean navigationClick(int status, int time) {
                     //Dialog.alert(" time in milisec :" + time);
                     return true;
                 }
             };
    

    CustomListField.java

    public class CustomListField extends ListField implements ListFieldCallback {
    
        private Vector _listData;
        private int _MAX_ROW_HEIGHT = 100;
    
        public CustomListField (Vector data) {
    
            _listData = data;
            setSize(_listData.size());
            setSearchable(true);
            setCallback(this);
            setRowHeight(_MAX_ROW_HEIGHT);
    
        }
    
        public int moveFocus (int amount, int status, int time) {
    
            this.invalidate(this.getSelectedIndex());
            return super.moveFocus(amount, status, time);
    
        }
    
        public void onFocus (int direction) {
    
            super.onFocus(direction);
    
        }
    
        protected void onUnFocus () {
    
            this.invalidate(this.getSelectedIndex());
    
        }
    
        public void refresh () {
    
            this.getManager().invalidate();
    
        }
    
        public void drawListRow (ListField listField, Graphics graphics, int index, int y, int w) {
    
            ListRander listRander = (ListRander)_listData.elementAt(index);
            graphics.setGlobalAlpha(255);
            graphics.setFont(Font.getDefault().getFontFamily().getFont(Font.PLAIN, 24));
            final int margin =5;
    
            final Bitmap thumb= listRander.getListThumb();
            final String listHeading = listRander.getListTitle();
            final String listDesc= listRander.getListDesc();
            final String listDesc2= listRander.getListDesc2();
            final Bitmap nevBar = listRander.getNavBar();
    
            //list border
            graphics.setColor(Color.BLACK);
            graphics.drawRect(0, y, w, _MAX_ROW_HEIGHT);
    
            graphics.drawBitmap(margin, y+margin+10, thumb.getWidth(), thumb.getHeight(), thumb, 0, 0);
    
            graphics.drawText(listHeading, 3*margin+thumb.getWidth(), y+margin);
            graphics.setColor(Color.BLACK);
    
            graphics.drawText(listDesc, 3*margin+thumb.getWidth(), y+ margin+30);
            graphics.drawText(listDesc2, 3*margin+thumb.getWidth(), y+ margin+60);
    
        }
    
        public Object get(ListField listField, int index) {
    
            String rowString = (String) _listData.elementAt(index);
            return rowString;
    
        }
    
        public int indexOfList (ListField listField, String prefix, int start) {
    
            for (Enumeration e = _listData.elements(); e.hasMoreElements(); ) {
    
                String rowString = (String) e.nextElement();
                if (rowString.startsWith(prefix)) {
    
                    return _listData.indexOf(rowString);
    
                }
    
            }
    
            return 0;
    
        }
    
        public int getPreferredWidth(ListField listField) {
    
            return 3 * listField.getRowHeight();
    
        }
    
    }
    

    Listrander.Java

    public class ListRander {}

    private bitmap listThumb = null;
    incognito bar Bitmap = null;
    private String listTitle = null;
    private String listDesc = null;
    private String listDesc2 = null;

    public ListRander (Bitmap listThumb, String listTitle, String listDesc, String listDesc2, Bitmap navBar) {}
    this.listDesc = listDesc;
    this.listDesc2 = listDesc2;
    this.listThumb = listThumb;
    this.listTitle = listTitle;
    this.navBar = bar navigation;
    }
    public getListThumb() {Bitmap image
    Return listThumb;
    }
    {} public void setListThumb (listThumb Bitmap)
    this.listThumb = listThumb;
    }
    public getNavBar() {Bitmap image
    return the navigation bar;
    }
    {} public void setNavBar (navigation bar of the Bitmap)
    this.navBar = bar navigation;
    }
    public String getListTitle() {}
    Return listTitle;
    }
    {} public void setListTitle (String listTitle)
    this.listTitle = listTitle;
    }
    public String getListDesc() {}
    Return listDesc;
    }
    {} public void setListDesc (String listDesc)
    this.listDesc = listDesc;
    }
    public String getListDesc2() {}
    Return listDesc2;
    }
    public void setListDesc2 (String listDesc2) {}
    this.listDesc2 = listDesc2;
    }
    }

    You seem to have two problems here and are confusing them.  You must break the problem into two parts

    (1) extract the data from the entry and create the objects you want to display

    2) display in a list, a set of objects.

    Let's get the sorted first premiera.

    I will suggest what to do here, but in practice, you might actually think about this yourself as part of the design phase of your application.  You should do this, not me, because then you will have all the information available.  At the present time, I have just what you said, which is not much.  So maybe what I'm telling you is not correct for your application.  Only you can decide that.  And be blunt here, you should have decided this before you start coding.  Do you want you could lead down the wrong path.  You must think of your application as a home - as the architect must design all the rooms, and how they will be built, before you start building the House.  You do not, then we are building the rooms on the fly.  Who knows if they will be fit at home?

    In this case, I think you need to create an object that represents each of the elements in the internal array of new data.  call this object

    NewsItem

    This object will have attributes, such as its title, content, date, the linked image and so on, each of whom have will get and set methods.  While you treat each inner element fetch you the associated entry and update the object.

    When you have finished the inner loop of processing, you now have a complete

    NewsItem

    Object, so you will add it to a collection, an array of NewsItem objects, call this _newsItems.  You will create it at the beginning - you know how many entries it takes because it is the number of entries in your outdoor table.

    So before you start to deal with JSON, create your table and the 'index' value of 0.

    Once you have created your Newsitem, add this in the table to the position 'index' and increment "index".

    And once you have analyzed all the JSON, you will have a complete picture.  This is part 1 finished!

    And note in your drawListRow, you are given a clue - that is the index in your tables in _newsItems.  So you can easily find which entry to view and display it correctly.  But it is part 2 and is a separate issue.

  • Accessing the context property of main.qml to a custom list in a file item separate qml

    Hi all

    Sorry if this is already covered somewhere.

    I currently have an application with a list view in my main.qml.  I put a context property for my class app c ++ to be "app" in my main.qml.  My list uses a custom list item that is defined in a file separate qml.  The custom list item has a popup menu.  In this context menu, I want to call Q_INVOKABLE functions that are part of my class from the main application in C++.  What is the best way to be able to do?  Should I just set the context property on my file qml of list item custom like I do with my main.qml or is there a better way?

    Thank you

    I think that this has been repeated several times, but as it is not really intuitive:
    a listitemcomponent lies in a different context, it cannot access the context property of the qml file.
    You can use the reference to the listview to reach outside, see https://developer.blackberry.com/cascades/reference/bb__cascades__listview.html ListItem.view

  • Custom list item changes when you click

    I'm having a strange problem.

    When my list of messages is filled first, she checks a property in the json data to see if the message is 'read' or 'unread '. If it is "no read", it will be a different color than those who are already "read" to indicate to the user.

    It works very well, however I added an action context to the list, and when this action is triggered, I'm changing the message "unread". If the color of the list item to change. This works.

    However, after I changed the color of a single item in the listwhen I do scroll down and down, many elements change color. I think it has to do with the rendering of the list of recycling.

    This behavior does not occur after that list first initializes. Regardless of the colors have been queued to initialize their place. Only after that I have an amendment to one of the elements in the list, things go crazy when I scroll. I hope I'm being clear.

    How can I stop this from happening?  This is the code that changes the color of the label in my custom list item.

     listItemComponents: [
                                ListItemComponent {
                                    MessageListItem {
                                        id: messagesListItem
                                        contextActions: ActionSet {
                                            ActionItem {
                                                title: "Mark Unread"
                                                onTriggered: {
                                                    if (messagesListItem.isNew == false) {
                                                        var selectedItem = ListItemData;
                                                        messagesListItem.isNew = true; //property of list item is changed to unread
                                                    }
                                                }
                                            }
                                        }
    

    And inside the MessageListItem.qml

    property bool isNew: ListItemData.data.new
    
       onIsNewChanged: {
            if (isNew == true) {
                subjectLabel.textStyle.color = Color.create("#FF4500");
            } else {
                subjectLabel.textStyle.color = Color.create("#000000");
            }
        }
    

    Please let me know if you have any questions, any help or suggestion is appreciated. Thank you!

    Hello!

    I think that it doesn't because you are not changing 'new' dataModel element variable. In addition, assigning directly control isNew breaks property DataModel is bound to it.

    It should work if you change the dataModel instead.

    An important point to note, however, that it is not possible to change the individual variables of dataModel point. You need to replace the entire item. The code example for GroupDataModel: (not tested, so may require tweaks, tell me please if you need help in getting this work):

    onTriggered: {
      var selectedItem = ListItemData  // get a copy of dataModel's item
      selectedItem.new = !selectedItem.new  // modify it's property
      messagesListItem.ListItem.view.dataModel.updateItem(indexPath, selectedItem) // update the model
    }
    

    For ArrayDataModel, the function is named differently.

    In addition, this line seems suspicious:

    property bool isNew: ListItemData.data.new
    

    Probably, it should be replaced by this one:

    property bool isNew: ListItemData.new
    
  • Hi, I'm developing a simple mobile app in DW CC 2015 using JQuery Mobile. LIKE I need the list view with description of the product, functionality and image, I would like to connect with database instead of "writing" all the tables in the bearings inside

    Hi, I'm developing a simple mobile app in DW CC 2015 using JQuery Mobile. LIKE I need the list view with description of the product, functionality and image, I would like to connect with database instead of "writing" all the tables in the bearings inside the Jquery page. In the future I would also be able to add, to remove the DB records. Any help, tutorial... Thanks TG

    I would like to connect with the database instead of "writing" all the tables in the bearings inside the Jquery page

    This is usually done with a CMS (content management system). There are commercial products CMS like WordPress, Joomla and perch. You create one or several layouts and then create pages of these page layouts using the CMS. In this way, it is possible to have hundreds of pages, each with unique content, but a page layout that can be managed in a place of sharing.

    CMSs on shelf don't require programming skills. Otherwise, some of us write our own CMS with custom functions, but this requires back-end, as with PHP programming.

  • The list view that stretches with the property of being Non-vmware

    Hello

    I added a custom column on the home page and for this column, I have to pass the value of the property of a custom object (not vmware, Object)

    Is this possible?

    PropertyProviderAdapter and DataProviderAdapter are independent of any UI code.  What are adapters side Java responds to requests for data from the client.

    In your case you don't need any interface class mediator user, just a PropertyProviderAdapter that meets the demand for data sent by the list view.  The query is generated by the platform, do not do anything :-)

  • PLSQL call for list view

    Hello

    Apex 4.2 - Mobile application

    I want to call a procedure in a list view lspq.

    This is a list of objects and then for the user final should be able to mark an item as a favorite.

    I thought about the following approach:

    the target of the link allows you to call a piece of javascript:

    the target of the link: javascript:AddFavo();

    "' link resulting: <a href="javascript:AddFavo();" Class= "interface user-link-inherit' > '.

    at the page level:

    JavaScript-> function and global variables declaration

    function AddFavo() {}

    Alert ("add to Favorites");

    $.event.trigger ("AddFavoEvent");

    }

    Dynamic action

    Event: Custom

    Custom event: AddFavoEvent

    Selection type: DOM object

    DOM object: document

    Condition:-no Condition

    Action: run the plsql code

    Unfortunately, this does not work.

    Javascript does not occur and therefore the dynamic action is not

    Does anyone have an idea how to solve this problem?

    Thanks in advance

    Sincere friendships Erik

    Hi Erik,

    The alert will? It all looks correct, it should be.

    Check your console if there are errors. If a JavaScript elsewhere on the page gives an error none of the javascript code will not work.

    If this is not the case, make an example on apex.oracle.com and I'll take a look.

    Kind regards

    Joni

  • Align the text in list view

    Hi, how can I align text in list view? I tried with:-fx-text-align: center; in css
    and setTextAlignment (TextAlignment.CENTER); in the code, but without success.
    Can anyone help?

    In an external style sheet, follow these

    .list-cell {
         -fx-alignment: center ;
    }
    

    In Java, you can call

    setAlignment(Pos.CENTER);
    

    on the ListCell (not the ListView). you usually won't have access to the ListCell if you already provide a custom cell.

  • Web App search results to display the TASK parallel library instead of the list view

    Is it possible to get the search results Web App to view a presentation BPD instead of the standard list view?

    If it is possible the call would go on the form or on the page of results? (currently, use the same results page for several web applications.

    Thank you!

    Not quite sure what your after.

    You can send the results of research to a custom page, I think you did that? This page can have its own model.

    The module itself for the search results:

    {module_webappsresults, bkp, resultsPerPage, hideEmptyMessage, rowLength, sort}

    They are key elements where bkp being true means that search results will use the backup of the web application on the main list.

    If you apply the rule of custom template by adding a space and a model = "PATHTOFILE", you can specify the search results to use a custom template.

    http://helpx.Adobe.com/business-catalyst/partner/using-custom-templates-modules.html

    None of this is what your after?

  • How to get the list view in iTunes 12.4.3 for Windows

    Guys, I'm LOSING MY MIND. I had to re - download iTunes (which I refused to update in eternity because I know of updated versions are generally never good), and this new Interface is making me remove my hair and cry. Not only is it completely intuitive, but it makes it incredibly difficult to navigate.

    I'm seeing all my music in classic list view, which I know he can do. When I first loaded it upward, she appeared in list view, but the time that I started clicking around, it became this heavy nightmare of the image. Every article I've read has a UI that I don't HAVE, where there is a drop-down list of some sort. Does anyone know how? I have attached a screenshot. BTW, that blue icon that you THINK would be seen list said just what is the next song. Complete waste of space. Jesus, just put it in a status bar, or scroll across the top.

    FYI: the only changes that I made in the preferences has been disable anything itunes store or apple related radio because literally ALL itunes became ads.

    How can I view my mode music list in iTunes 12.4?

    In the drop-down list, select music. Once in the music, in the sidebar, select the songs and you should be intraditional list view.

  • Why isn't list view &gt; arrange by &gt; date modified, accurate?

    am new on el capitan and I noticed that the list view > arrange by > update is not correct.

    I modified just a folder on my hard drive by adding new things, but it's showing a date of last modified August 6, No 11.

    what constitutes 'Edit' a folder? I'm doing something wrong?

    Thank you for advice or suggestions.

    Abstractman23 wrote:

    I just modified a folder on my hard drive with new things...

    What does it mean exactly 'stuff' above means?

    This means that you have added new files directly under the folder (and not a subfolder level)?  That would be a change.

  • Cannot modify 'Recently added' to the title of the library to the list view.

    I am now using iTunes v12.4.0.119

    I chose the "recently added" to the title of the library and it seems stuck on the display of the album, I can't switch to the display of the list no matter what I do. I appreciate looking at album art, but I just can't stand the inefficiency of having all that unused space. I largely prefer a list view. I can not change anything on this playlist, less first how it is displayed.

    If I can't get it to display the list, I'll have to remove it. It is so shocking when all other points of view are set to list view and big boom-* dead space and visual clutter to album art page.

    Don't let me use a feature of good full advantage? No problem, I don't use it at all.

    Good day Starry001

    I hope this helps. Select 'Recently added' playlist on your sidebar, now in the menu bar go to "Display" and click on "View As"-> "Songs." Your playlist should now be displayed as a list of items. You can always switch between different views for each of your playlists.

  • Last updated, 8 Firefox on Win7, opens Gmail to the list view, but cannot open the editor to read or write e-mail.

    From today, after the most recent update, Firefox 8 on Windows 7, when I opened GMail, I can see the list view, but when I try to open an e-mail to read or answer, I get an error saying GMail failed to load the rich text editor, and I can only see the snippet, without the content of the email.

    It seems to be caused by Adblock Plus 1.3.10. Disable temporarily it allows me to read and compose email normally.

  • BlackBerry Q10 how do I change BBM Contacts list view to "list"?

    My friend used BB Q10, she can't find any option to change BBM Contacts list view to 'list '. Can anyone help? Thank you.

    When you are in the list of BBM contacts, further down from the top, you can see "Settings" in the upper right. Touch it and then scroll down to "Contact Layout".

    Here you can choose between 'Grid' or 'list '. Choose 'list '.

    If please post if it works for you or not. Thank you.

  • With the help of QProperty for a label inside the list view

    Hello

    I wanted to assign the value of a label in the list view to a string QPROPERTY. I did it using Qt.myname = _app. QPropertyName. And Qt.myname attributed to label.

    It updates correctly during installation. But if I change the value, it is not updated within the display list, but working in another label that is outside the view of the list.

    It works for me

            ListView {
                property string myCppProperty: app.cppProperty
                listItemComponents: [
                    ListItemComponent {
                        Container {
                            id: listItemContainer
                            Label {
                                text: listItemContainer.ListItem.view.myCppProperty
                            }
                        }
                    }
                ]
            }
    

Maybe you are looking for

  • Why that I lose my apps tab and tab groups each time firefox is updating to a new version?

    It seems that every time I get a new version of firefox my apps tab and groups disappear. Why this happens and what I can do about it?

  • Satellite P100-434 - how does the safety lock?

    Satellite P100-434. There's a safety lock on the back of the laptop, how does it work? Thank you for the answers.

  • Annoying popup

    I want to stop a MSN Pop-up window from appearing everytime I turn on the computer. .. Unable to install C:\PROGRAM~1\MYWEBS~1\bar\2.bin\M3PLUGIN. DLL No file of this type is in the result of research on my hard drive. How to remove this redundant wa

  • DVD writer is recognized but cannot burn files

    I am working on a friends computer and had to do a restore point to fix another problem.  After the restore point, everything works except the DVD/CD burner.  I can install a blank DVD or CD and Windows recognizes it and says I need to format it.  I

  • What is the Dell Vostro 2520 headphone jack size

    I purchase new dell vostro 2520 (i5/500 / 4 GB/Win 8) I listen to the songs often with headphones. But my headset does not work with this model. I mean that it is not suitable for this model. My helmet is a normal 3.5 mm plug. I need to know if the D