Dynamically add custom headers in ListView

I'm working with a ListView which is based on a api, that I have no control.

I dynamically add some custom headers subject see the following as to what I am referring to (A, B)

http://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__listview.html

How can I dynamically add these? For example, I want to add a conflict between the first element of the list and the second

Section A

Header

Item B

Point C

Hi Philippe,.

To do this, you must use a custom list item component.

Heres how I could do that

 


Moreover, in the custom "Header" just create a structure as follows:

IF/ELSE ON A FLAG

if(someflag == "header"){
     //use header style
}else{
   // show normal list style
}

My Code

ListView{
dataModel: ArrayDataModel{
   id: myDataModel
}

listItemComponents: ListItemComponent
{
    Container{
       layout: StackLayout{
          orientation: LayoutOrientation.TopToBottom
       }
       Label{
          text: ListItemData // complete data string
       }
       Label{
          text: ListItemData.split("~")[0]
        }
        Label{
          text: ListItemData.split("~")[1]
        }
       Label{
          text: ListItemData.split("~")[2]
        }
    }//end Container
}//end ListItemComponent

onCreationCompleted: {
   //The data inside append is one item.

   //let's append a bunch of data
   for(var i=0;i<30;i++){
       //append 30 list items
       myDataModel.append("Header~Some data whatever~Status");
   }
}
}
  • In my example I am adding data to the model.

ListItemData - the full string

ListItemData.split("~") [0] - first part etc.

  • I shared parts of the data with a single symbol. In my case the «~»
  • To get the data I want to that I just throw a ListItemData.split("~"). It breaks the string into 3 parts.
  • I will be able to access somewhere I want using the notation ListItemData.split("~") [index]
  • You can include paths to images, or whatever the text you

AS IF THIS HELPED YOU!

Tags: BlackBerry Developers

Similar Questions

  • ListView with custom headers (sections)

    Hello

    I need custom headers (basically something like sections QML native ListView component http://doc.qt.nokia.com/4.7-snapshot/qml-listview.html#section.criteria-prop) in my ListView. In my case, I have list of comments that I want to be sorted by DateTime and contain headers: «Today, yesterday, last 7 days, Older» Source of ListView is GroupDataModel (QVariantList of SqlDataAccess).

    Any ideas?

    Thank you

    Jan

    As far as I'm concerned, I think that's not possible!

    Likewise, you cannot sort on key on a second key in DESC and ASC.

    In addition, the title of the header section is the value used to sort data

    So in anticipation, I add a prefix to my field in the QML and sort, I have re - format text.

    In your case, I do "1-Today", "2-Yesterday", "3-Last..." » ; then I sort on this key. and I don't value.substring (...) in QML

    To remove my prefix.

    Nicolas

  • How to dynamically add data in a Spark list control

    Hi, I have a spark list in one of my custom components() control(id="Cclist") and a text input control. When a value is entered in the entry of the texts, I want to dynamically add the same in the list control. I tried to do the following:

    protected function Cc_selectHandler(event:CustomEvent):void

    {

     var cctext:DisplayObject = event.data as DisplayObject
    CcList.enabled = true;
    CcListButton.enabled = true;

    CcList.addChild(cctext);

    }

    But I get an error saying "addChild() is not available in this category.  "Instead, use addElement(), or change the skin. So I tried to use addElement, but apparently it is not available at all. No idea what im doing wrong?

    Add the text entered in the textinput to the dataProvider of the list in the appropriate format.

    A simple example:

    
    
        
            
        
    
        
            
        
    
        
            
        
        
        
        
    
    
  • How to dynamically add a plot to a graph of mixed signals

    I have a graph of mixed signals where I'm plotting a signal from a time axis. I'm trying to dynamically add a second plot to this graph against the same time axis (with a different scale of Y), but when I built a 2D array and try to connect in the graph (using a local variable) I get an error of size mismatch. I know for sure I did in the past (cable tables with different sizes for a same MSG) with no problems but, today, for some reason any I can't solve this problem.

    Am I missing something?

    Yes, you're probably writing a table 1 d somewhere that is causing to accept only 1 d. To address your problem above, just put a table node build in whenever you have a 1 d table and it will be just a 2D array with a single line of data.

    To add a field to your current locations, your screenshot above should work once the plot knows that he has to accept the 2D tables.

    Reading from a local variable, change something and then write about it once again can lead to a lot of issues down the line. Race conditions are a pain in the butt, so get rid of that sort of thing is good to do from the start. I didn't know the rest of your code, so I don't know how you treat it, but just keep in mind that you add to your software.

  • In excel 2003, is there a way to keep your custom headers and customer footers to the same size as the page at 100% or 76% or 50%.

    In excel 2003, is there a way to keep your custom headers and customer footers to the same size as the page at 100% or 76% or 50%.

    Hello Terri Haineman,

    Thank you for visiting the Microsoft answers community.

    The question you've posted in Office-related and would be better suited to the office community. Please visit the link below to find a community that will provide the best support.
    http://www.Microsoft.com/Office/Community/en-us/default.mspx?DG=Microsoft.public.Excel.misc&lang=en&CR=us
    Chris.H
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to dynamically add an Option in the drop-down list?

    I have this code:

    {Drop-down list

    ID: list

    Title: 'list '.

    onCreationCompleted: {}

    opion var = new Option();

    opion. Text = "Hello";
    opion. Value = 4;

    List.Add (opion);

    }

    }

    After the launch of the application, the list is empty.

    Why my code does not work?

    It is easy to dynamically add options

    first add this to your attachedObjects:

    ComponentDefinition {
                id: optionDefinition
                Option {
                }
            }
    

    then do something like this

    var newOption = optionDefinition.createObject()
                newOption.text = ...
                newOption.value = ...
                newOption.description = ...
                newOption.selected = ....
                yourDropDown.add(newOption)
    
  • Dynamically add tabs QML from C++

    Hello world

    I have a simple TabbedPane defined in QML.  I am trying to reference the TabbedPane via C++ to dynamically add tabs.  Is this possible?  With my current setup, the application starts and crashes then with:

    Process 22253787 (MyTabsApplication) terminated SIGSEGV code=1 fltno=11 ip=79310524(/base/usr/lib/libbbcascades.so.1@_ZN2bb8cascades10TabbedPane6removeEPNS0_3TabE+0xf3) mapaddr=00110524. ref=00000010
    

    Here is the code:

    TabbedPane {
        id: mytabs
        objectName: "mytabs"
    
        Tab {
            title: "Tab 1"
            FirstPageView {}
        }
        showTabsOnActionBar: false
    }
    

    C++ :

    ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
            QObject(app) {
    
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
        qml->setContextProperty("app", this);
    
        AbstractPane *root = qml->createRootObject();
    
        TabbedPane *tabbedPane = root->findChild("mytabs");
        Page* page = Page::create();
        Tab* tab = Tab::create()
                     .title("tab2")
                     .description("This is only shown in the side bar");
        tab->setContent(page);
        tabbedPane->add(tab);
    
        app->setScene(root);
    
    }
    

    Thank you!

    Try to declare your root as:

    TabbedPane *tabbedPane =  qml->createRootObject();
    

    As TabbedPane is a class of AbstractPane

  • How we can dynamically add or remove action from the popup menu in qml item

    Hi all

    I want to just dynamically add or remove action from the actionset item in the contextual menu especially in qml.

    Thanks in advance.

    Kind regards

    Ankur

    You can do so by joining the actionitem as attachedObjects. Once the page is complete (signal onCreationCompleted), you can add it to the page using addAction()

    To remove, you simply delete the page using removeAction()

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__page.html

  • Add custom in the analytical center of the lines of obiee11g lines

    Hello

    I want to add custom table lines. Only lines custom placed after the specified lines, based on requirements.

    In the screenshot, lines custom here is sum (1 + 2 + 3), sum(4+5), sum (6 + 7 + 8)

    ERR4.jpg

    To do this, I created RPD and exported in Ms.

    I have the analytic choice to create the report.

    To add lines custom, I choose Add custom calculated item.

    I tried. But I have no way out.

    Please see the screenshots

    err1.jpg

    err2.jpg

    err3.jpg

    See the output

    err5.jpg

    Please help me. I couldn't place the lines custom after the specified lines.

    Thnaks in advance,

    Bruno has.

    Make 1 more column for Prod_ID and then use fx of expression to sort values Prod_ID using the Case statement.

    using PivotTable the aggregate value or icon of sigma to sum up the values.

  • How to add custom context menu menu items?

    How to add custom context menu menu items?

    through c++ sdk

    Hi Philippe,.

    to display a context menu you just replace the path of the menu. For example if you have a menu ' hand: & Layout: MyMenu "you can add it to the context menu"RtMouseLayout:MyMenu"in your MenuDef resource in the file en with the ActionID of your ActionComponent.

    Markus

  • OEM 12 c - add custom properties target - is it possible?

    We use the Oracle 12 c Cloud Control (12.1.0.1 BP).

    Targets have a number of Oracle-supplied properties that can be filled by the end user - comment, Contact, cost center, the identifier of the Customer Support, service, etc. For the purposes of database, these properties are accessible to Oracle Database/target/properties of installation in the GUI of the OEM.

    Is there a reasonably safe way or "Supported by Oracle" to add custom properties? For example, we would add a property of Type "backup" that we can maintain the same page as the Oracle-supplied properties.

    I see that there is a SYSMAN. Package MGMT_PROPERTIES, which seems to provide an API for manipulating the properties, but I found no official documentation for it.

    Thoughts?

    The verb add_target_property to emcli to add a custom target for a target type property.

    Ex:

    $ emcli add_target_property-target_type = "oracle_database" - property = "name of the owner.

    Property 'Owner name' added successfully

    For more information on the emcli verb, please see:

    http://docs.Oracle.com/CD/E24628_01/EM.121/e17786/cli_verb_ref.htm#CACDGGHJ

    Note: Currently target custom properties cannot be used to add targets of administrative groups. There is an improvement for this feature request.

    Kind regards

    Loc Nhan

  • Dynamic add to cart

    Hey everybody, just try to see if there's a way dynamically add something to the cart. I see the html code for how works the add to Cart button, but it looks like it uses the ID 'product' to add the product itself. However, I am not able to see how I can retrieve the id of the product if all I have is the 'Product Code' (from {tag_productcode}). These two values are different for non insiders.

    I know that if I work a little longer on that I could just get some ajax to visit the real great product page manually and find add to Cart button and enter the ID of the product in this way, this seems excessive.

    If anyone has any ideas, I would be very grateful.

    With the add to Cart then that.

    I don't know why people do not use the documentation - all that it:

    The developer reference

    {{id}} {tag_productid} System displays product ID.
    {{catalogId}} {tag_catalogueid}

    These two you will need dynamic, but make sure you also get the other correct settings.

  • JS script to add custom text and the name of file to file info in the title of the document

    Would be very happy for any help with this one...

    JS script add custom text and the name of file to file info in the title of the document

    Thank you very much

    Super: O)

    I have a folder of say 50 images and I want to run a lot of JS script

    example in the title of the document: image Nr 81205

    custom text is 'image Nr' + '81205 file name.

    activeDocument.info.title ="Nr of pictures"+ decodeURI(activeDocument.name);

    This would be correct without seening the ext file

    Thank you very much

  • Dynamically add UIComponent without refreshing entire page (JDEV 11.1.1.3)

    Hi all
    I have this problem.

    I need to dynamically add an element within a page without refreshing entire page jspx.

    For example, look at this page:


    Titus: _
    Name: _______
    Job: _ (+ add more jobs)

    When I click on (+ add more jobs), I add a new RichInputText:

    private RichPanelBox pb1;

    public String cb1_action2() {}
    RichInputText rc = new RichInputText();
    rc.setId (...);
    [....]
    This.PB1.GetChildren (). Add (RC);
    Returns a null value.
    }

    The field is displayed properly on the page, but the system do a full refresh and lose your position on the page.

    Obviously becomes inconvenient for the user to have to scroll the page up to a certain point where it was before.
    Is it possible to avoid this problem and to add the field without a complete refresh of the page?

    Thank you
    Cristian

    Published by: on February 11, 2011 baol 7,53

    Try with PartialSubmit for the button and use PPR as follows:

    JSPX Code:





    partialSubmit = 'true '.
    actionListener = "#{SamplePageBean.onAddJobs}" / >




    Bean code:

    public class SamplePageBean {}
    private RichPanelBox panelBox;

    public SamplePageBean() {}
    }

    {} public void onAddJobs (ActionEvent actionEvent)
    RichInputText richInputText = new RichInputText();
    richInputText.setId ("Id1");
    richInputText.setLabel ("Job Title");
    this.panelBox.getChildren () .add (richInputText);
    AdfFacesContext.getCurrentInstance () .addPartialTarget (this.panelBox);
    }

    {} public void setPanelBox (RichPanelBox panelBox)
    this.panelBox = panelBox;
    }

    public RichPanelBox getPanelBox() {}
    After a return;
    }
    }

    Thank you
    Nini

  • Dynamically add the instance of a class

    Im trying to dynamically add instances of a class. I need to do it in a loop. How would I go to do something of this nature?

    Basically...

    for (var i: uint = 0; i

    var newInstance:YourClassName = new YourClassName();

    addChild (newInstance);

    }

Maybe you are looking for

  • Word 2000 and compatibility of Windows 7 64-bit?

    A member of the forum confirm that Word 2000 will work with Windows 7 64 bit? Post edited by: bearjoshy

  • Check the picture on Nexus 3000

    Does anyone know the command to check a bin file that was copied to a Nexus switch?

  • Update statement with multiple joints

    HelloI use Oracle 12 c and here my Question:/*ledgerstb is an Oracle the ITO (TransNo column is the primary key)vledgerstb_gtt is a global temporary Tablevledgervc_gtt is a global temporary Table*/UPDATE(, SELECT ledgerstb. TransNoVC AS TransNoVC_Old

  • Quiero mi cancel suscripcion

    . Hola mi usuario are [deleted private info. Please use the private message for communication system], imply el pasado Día 7 JanuaryCloud Standard of Document Acrobat subscription (annual)Y quiero mi cancel suscripcion, el producto no cumple con put

  • Site of Muse with an expandable Page

    HelloI'm looking for a certain type of functionality within the Muse.I had originally thought I could achieve this effect with an accordion but am a having no chance.I want to have a page that is on a minimum height, but when the user triggers the co