Custom element data datamodel property

ListView {
            id: idListView
            accessibility.labelledBy: idListView
            objectName: "idListView"
            horizontalAlignment: HorizontalAlignment.Center
            layoutProperties: StackLayoutProperties {
            }

            listItemComponents: ListItemComponent {
                type: "it"

                Container {
                    layout: AbsoluteLayout {

                    }

                    topPadding: 4
                    bottomPadding: 4

                    Label {
                        text: ListItemData // <----
                        textStyle {
                            base: SystemDefaults.TextStyles.BodyText
                            fontSize: FontSize.Large
                            fontWeight: FontWeight.Normal
                            color: Color.create ("#ffffffff")
                        }
                    }
                }
            }

        }

I made a custom for my listview data template and set it from code. The above code works very well, if a QString QVariant returned from data() model. I wanted to return a TableItem (my custom table point) containing several Q_PROPERTY - ies, and set the values of different properties for different components. My data model:

QVariant TableModel::data(const QVariantList& indexPath) {
    if (indexPath.at(0).toInt() == 0) {
        // first cell (header)
        return QVariant("header");
    }

    int index = indexPath.at(0).toInt();

    TableItem* item= _tableItems.at(index-1);
    QVariant var= QVariant::fromValue(item);

    return var;
}

I have posted the question before returning and all properties are very well (has a valid value). All properties return QString and the class has a declared metatype. If I come to the question as I write, I get ".

Asset: / / / table. "QML:52: impossible to assign s1::TableItem * to QString", which means TableItem is successfully transmitted. I tried to access different properties by calling:

Label {
       text: ListItemData.myPropertyName 

or

Label {
       text: ListItemData.myPropertyGetter 

but without success.

How can I get a property value of an item that is spent by the Member my data model custom data() function?

Thanks in advance

Hello

I see two ways to solve your problem...

1 use a card instead of your object (friendly variant)

2. use a GroupDataModel - it can store QObject *-not just Variant. This post shows this work... http://supportforums.BlackBerry.com/T5/native-development/update-sorting-in-ListView/m-p/2629493#M50...

GroupDataModel can do automatic headers. You can also just insert a header in the datamodel-, so you do not need to override the data function...

Thank you.

Tags: BlackBerry Developers

Similar Questions

  • How can I update the custom object data card?

    Hello world

    We maintain a field check box on one of our custom objects data sheets.  I took a quick glance at the Eloqua REST API of Fred Sakr and found c# library class "customobjectdata", but there are only methods to get data cards and create new maps.  Someone at - it an example of updating an existing data card?

    I also took a glance to the bulk API but this would bring additional complexity to our development effort.  It seems that there must be a way to do this with a single call.

    I am open to the use of the SOAP API if this action is not possible using REST.

    Thank you

    Hey Austin Christmas Yes, you can update CDO via the REST API. We found this material useful for the performance of the access/mutation operations for CDOS: REST API - the custom metadata object

  • List control with selection/converter custom element highlight problem

    Hello

    I created a sample project to illustrate my problem, my data provider actually use the same valuables as there might be same objects with the same data in a table collection.

    When I bring the mouse over the list control, I get no blue sky selection / highlight, and I cannot even click on them and I don't get any change either event.


    Here is the code, you can also download the attached project and experience it locally.

    List problem

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application creationComplete="compApp();" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
         <mx:Script>
              <![CDATA[
                   import mx.collections.ArrayCollection;
                   
                   [Bindable] private var dp:ArrayCollection = new ArrayCollection();
                   
                   private function compApp():void{
                        for(var i:Number =0; i < 10; i++){                         
                             var person:Person = new Person("Raza", "raza.jpg");
                             dp.addItem(person);                         
                        }
                   }     
                   
              ]]>
         </mx:Script>
         
         <mx:List variableRowHeight="true" width="200" height="300" id="listControl" dataProvider="{dp}" itemRenderer="ListRenderer"/>     
    </mx:Application>
    

    Element converter

    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" verticalAlign="middle">
         <mx:Script>
              <![CDATA[
                   
                   override public function set data(value:Object):void{
                        if(!value){
                             return;
                        }
                        fullName.text = Person(value).name;
                        photo.source = Person(value).photo;
                   }
                   
                   
              ]]>
         </mx:Script>
         <mx:Image id="photo"/>
         <mx:Label id="fullName"/>
    </mx:HBox>
    
    

    Thank you

    It's actually quite simple, but quite obscure.

    Add a property in your object of the person and make sure that it is unique (or

    Wrap your Person objects in a custom for the grid object and ensure that

    which has the property uid on it).

    Take a look at the UIDUtil class (on line 325 in the 3.2 SDK) to learn more

    Details.

  • Personalized with custom functions callabe DataModel

    Hi all

    I am creating a data template customized with some features available in the QML code. This is the header file:

    #ifndef XMLDATAMODEL_HPP
    #define XMLDATAMODEL_HPP
    
    #include 
    #include 
    #include 
    #include 
    
    #include 
    #include 
    #include 
    #include 
    
    class XmlDataModel: public bb::cascades::DataModel{
    
    public:
        XmlDataModel();
        virtual ~XmlDataModel();
    
        // Required interface implementation
        virtual int childCount(const QVariantList& indexPath);
        virtual bool hasChildren(const QVariantList& indexPath);
        virtual QVariant data(const QVariantList& indexPath);
    
    public:
    
        Q_INVOKABLE
        void load(const QString& file_name);
    
        Q_INVOKABLE
        void setHeaderName(const QString& headerName);
    
    private:
        QVariant *m_sourceList;
        QString *m_headerName;
    
    };
    
    #endif
    

    And it's the QML app:

    onCreationCompleted: {
            console.log("main.qml loaded");
    
            _model.setHeaderName("hello");
        }
    

    But when the QML code try to run the setheaderName function, I get this error:

    TypeError: Result of expression '_model.setHeaderName' [undefined] is not a function.
    

    I have the _topSpeed is accessible by the QML code, but I don't know why I can't run my own functions...

    Can someone help me?

    Make a Q_OBJECT:

    class XmlDataModel: public bb::cascades::DataModel{  Q_OBJECT  ...
    
  • Get value of custom attributes in VO property programmatically

    Hello

    I have a custom VO (based on SQL, not an EO instruction), I know it's possible to get programmatically the attribute names (of in the central) using something like:

    AttributeDef[] meta = vo.getAttributeDefs();
    //...
    int attrCount = vo.getAttributeCount();
    for (int i = 0; i < attrCount; i++) {
    String curName = meta[i].getName(); 
    //...
    }
    

    However I would like to know if there is a way to get the value defined in the element of the Description of the custom for each attribute in the VO properties?

    jDeveloper: 10g

    EBS: 12.1.3

    Kind regards
    Carl

    If you are after the custom property to the VO level then you can use the code given by AnilA.

    If you are Custom "DESCRIPTION" property when defined at the level of the attribute, then you can get that by adding a line in your code as below:

            AttributeDef[] meta = testVO.getAttributeDefs();
            //...
            int attrCount = testVO.getAttributeCount();
            for (int i = 0; i < attrCount; i++) {
                String curName = meta[i].getName();
                System.out.println("curName:" + curName);
                String curNameDesc = (String)meta[i].getProperty("DESCRIPTION");
                System.out.println("curNameDesc:" + curNameDesc);
                //...
            }
    

    I hope this helps.

    See you soon

    AJ

  • Set when you call WS thru ADF webservice SOAP header element data control

    Experts,

    I'm trying to call/call a webservice (using the command of ADF data web service) awaits the element in the SOAP header. I want to know the steps required to define the custom SOAP header when using ADF data control web service. Custom SOAP header element will be of type string, something like
    < soap: Header > < element1 > String < / element1 > < / soap: Header >

    Thank you
    Ashish

    Hello

    extend the SOAPProvider class

    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPException;
    import javax.xml.soap.SOAPMessage;
    
    import oracle.adf.model.adapter.AdapterException;
    
    import oracle.adfinternal.model.adapter.webservice.provider.soap.SOAPProvider;
    
    public class CustomSOAProvider extends SOAPProvider {
        public CustomSOAProvider() {
            super();
        }
    
        //expose protected method to public
    
        public void handleRequest(SOAPMessage soapMessage) throws AdapterException {
    
            super.handleRequest(soapMessage);
        }
    
        //Expose protetcted method to public
    
        public void handleResponse(SOAPMessage soapMessage) throws AdapterException {
    
            super.handleResponse(soapMessage);
        }
    

    And configure it in the file DataControls.dcx to your WS DC project


    ...
    xmlns = "http://xmlns.oracle.com/adfm/datacontrol" >


    name = "..." "version ="1.0 ".
    Provider = "ADF. Sample.wsdc.CustomSOAProvider ".
    WSDL = "http:/ /...". ">
    ...

    Frank

  • How to maintain the synchronization of the hierarchy of the table with customer-specific data

    Series of paintings in our system, we have:

    Promotions (id, descr, datefrom, dateto,...)
    PromotionClients (promotionId, clientId) = list of clients whose promotion is valid
    PromotionProducts (promotionId, itemId) = list of products on sale

    The synchronization logic is simply that all promotion tables must be synchronized just to the customers present in the PromotionClients table. So each select element for these tables of publication contains something like "... and there are (select 1 from c PromotionClients where c.clientId =: CLIENTID). It works fine until there are some changes in the PromotionClients table. After the change of PromotionClients table starts to sync, but other tables do not - there is in fact no updates on their respective folders.

    Is there a solution to this problem other than to manually create the triggers for the PromotionClients table that would execute model-update on each related table? I mean - is there an existing function in OracleLite that woud let set a few references - to load to a point of publication/table?

    And in the face of similar problem - there is also Promotions.datefrom/dateto limitation. Promotion tables must be synchronized at the time where actual date is between Promotions.datefrom and dateto. When someone modifies some of these values and so the promotion valid for the time related tables does not automatically update and so they do not start to synchronize. Just the Promotions table begins to synchronize. So we might need to implement another trigger to perform updates dummy on the tables of PromotionClients + products, Promotions.datefrom/dateto update.

    I do not like the personalized relaxation approach - it just duplicates the synchronization logic and it is inconvenient to maintain the synchronization logic in two places (pubitem selects + custom triggers). I would like to find a solution of OL-native - as referring to load tables for each publication element that would cause triggers to OL to also catch the person in charge of the lines of tables (which were not actually modified) to be marked as dirty and synchronized to the client. Is there a solution like this? Or is there an alternative better than custom triggers?

    When you trigger an event in a related table, it gets registered for PGM compose the data in this table. If there is a suspicion, MGP will compose the data in these tables as well.

    So if you have something like a REGION_MAPPING table that maps the users in various locations and if you change the table data and want other tables that are joined with him to compose the data, and then add a hint of dependency to the tables mapping them to REGION_MAPPING. If these tables is regularly updated and data are being composed for the child tables, then you don't need the trick, just good practice to add it.

  • DBTools extract element data

    Hello

    Calling a stored procedure from a MS - SQL database 2005, and he returned the 2 dozen fields.  I need to combine the result data in a cluster for my client.

    Its cluster contains booleans, strings and I32s and slna.

    I need to do the same thing, but my data comes from the function "dbtools extract the data of the item.  Problem is that I can't get output anywhere to convert native data types so that the function of the original function of the customer Cluster beam.

    Can someone point me to an example of LV function for this code?  I tried to use the "database of Variant data", but I have not found the magic way to make sure the function bundle sees a native data type.

    Help to LV and this forum are not telling me what I need to know.

    Any help is greatly appreciated!

    Dave

    OK maybe the 'database of Variant data"is most appropriate?

  • VROPs 6.2 - No custom dashboard Data

    Hi all

    All my dashboards customized is blue with 'No data '. I checked and the adapter is OK. State of collection and the State of the Collection.

    I tried to change the table edge, but when I used find it looking for a host, I noticed that the State of the Collection of the host is start State and collection = none.

    Sometimes, when I click on home, I receive an error "Internal Server Error" and did not find the requested source.

    No idea how to solve this problem?

    vROPs 6.2

    Thank you

    Fixed.

    Some objects have been removed from the cluster that I had indicated in the dashboard.

  • Dynamic variable data caption property management

    I have a dynamic form that contains a number of areas including legends will vary according the data than him. Say that the data looks like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <Root>
       <Drinks>
          <Drink>
             <Name>Coke</Name>
          </Drink>
          <Drink>
             <Name>Pepsi</Name>
          </Drink>
          <Drink>
             <Name>RC Cola</Name>
          </Drink>
       </Drinks>
    </Root>
    

    I tried to set the caption of each field for name matching using dynamics, $record properties. Drinks.Drink [*]. In this case the name.

    The following text is generated in the XML file: < target = "caption.value #text setProperty" ref group "$record. Drinks.Drink [*]. Name "/ >"

    But the result is that all the legends are the same value, the first child node of drinks (Coke).

    A link to the PDF file is here: https://files.acrobat.com/a/preview/987ba4fa-19e4-4e38-8147-a75c12daaa7c. You can import the XML above to reproduce the problem.

    Hello

    Looks that the designer has confused extensible group management, if you change the link caption "$." Name' it works.

    Linking in the setProperty element should be compared to its parent (drink in this case).

    See "$record" in the binding expression is something that I always check because it seems added to the when Designer wants to generate an expression outside the current binding context, $record is as a reference to the document level.  Even if the binding of the legend has a [*] in reference to the [*] in reference to binding the subform drink is what motivates the layout, so decides the name.

    Concerning

    Bruce

  • Data storage property not defined successful dimension build data loading

    Hello

    I am trying to load data as below on a dimension without members - that works - but the dynamic Calc property does not set even though I map to the appropriate field and I get no error?

    My rule file using parent / child and maps the fields as Parent, child, Alias and property respectively.

    Below is a small snippet of my data.
    Period,YearTotal,"Year Total","Dynamic Calc"
    Period,OpeningBalance,"BegBalance","Store Data"
    But, all things being equal, if I load the aggregation rule - (minus sign that is) in the same column, it works fine.

    Is there an outside tip to set the property to store data that I need to know?

    Thank you

    Robert.

    If you load that using a rule of the load, use X for dynamic Calc.

    There is a chapter in SER60 who talks about it.

    http://docs.Oracle.com/CD/E12825_01/EPM.111/esb_dbag/frameset.htm?dotrules.htm

  • Custom field data center-VM

    The difficulty to fill the property column in the report.

    Here is my code:

    $report = @)

    $csvfile = "D:\Get_DC_Perms.csv".

    $datacenters = get-data center | name sort

    ForEach ($datacenter to $datacenters)

    {

    $vms = get-vm -location $datacenter

    ForEach ($vm to $vms)

    {

    $ReportObj = "" | Select 'Data center', 'Virtual Machine', 'Property DL'

    $ReportObj. "' Data center ' = $datacenter.name

    $ReportObj. "' Virtual Machine ' = $vm.name

    $ReportObj. "' Property DL ' = {$vm. CustomFields}}

    $Report += $ReportObj

    }

    $report | Export CSV $csvfile -NoTypeInformation

    Thank you

    This should not be a problem.

    Have you tried the script from the prompt PowerCLI?

    Maybe stop/start prompt PowerCLI or the GUI where you start the script.

    If this doesn't help, I'm afraid, that I am at a loss

  • Customizing "No Data View" in 11g

    Hello

    I want to know how to put "No Data" in 11g, I used a 'HTML Code' to display 'Symbol' in 10g, but the same code does not work in 11g.


    Kindly help

    Kind regards
    Jitendra

    Published by: Jitendra Bigras June 7, 2011 12:30 AM

    Hi Jitendra

    How can I get the image I want to display with this message?

    The easiest way is to host the image on another server and reference it via a HTML img like this tag:

    The most complex is to host the image on the same server as your OBIEE 11 g install but you will need to do some customization to deploy a web application. The procedure can be found here.

    http://www.rittmanmead.com/2010/12/Oracle-BI-EE-11g-styles-skins-custom-XML-messages/

    You should always use a HTML image tag in this case also.

    Kind regards
    Paul

  • Custom (by date) in a DataGrid sort

    So I have a data grid component connected to a provider of data like so:

    var weekData:XML = / / some xml loaded and more soon...

    var weekGrid:DataGrid = new DataGrid();

    var dataProvider:DataProvider = new DataProvider();

    for each {var entry: XML (in weekData)}

    dp.addItem ({event:entry.title, date: FormatDate.format (new Date (entry.@startDate), 5), data:entry.@startDate});})

    }

    The title column, it's just what you think. The date Colum is actually a format such as may 2012 or 2013 Feb. And the "column" of data is not displayed in the dataGrid control that it is the 'key' to sort by date. It contains the getTime() value date as 1328515200000. So, who's going to date sort just a case of with the appropriate Array.DESCENDING Array.NUMERIC if necessary.

    I found that if I do this:

    weekGrid.dataProvider.sortOn ("data", Array.NUMERIC)

    weekGrid.invalidate ();

    It works and the grid is sorted - IF I have any other button to click to make this code executes.

    I would like to forge with the click on the header of the grid event. As follows:

    weekGrid.addEventListener (DataGridEvent.HEADER_RELEASE, sortDataGrid);

    And I get the event and all, but obviously fireing off built-in sorting what happens after mine. And it is not what I want.

    No idea how to stop this and allow my perferred sort taking place?

    Found a smoother response.

    weekGrid.addEventListener (DataGridEvent.HEADER_RELEASE, sortDataGrid);

    {sortDataGrid(e:DataGridEvent):void funciton

    var dg:DataGrid = e.target as DataGrid;

    {if(DG.sortIndex==1)}

    e.preventDefault ();

    do what I want.

    }

    }

  • Get the values and elements of object property

    If I have an object,

    MyObject = ({a: 3, b:5, c:8})})

    How can I get a list of items and their values according to their position

    Let's say I want to know what the name of the second element, how can I get the answer "b"?

    In addition, without knowing the name of the element how can I get the value of the second item "5"?

    Thank you

    Trevor

    It is, of course, a matter of Javascript, and the answer is not specific to InDesign, but I think you knew that already.

    The short answer is: you do not have. JavaScript does not have something on the positioning of the members of an object.

    There is no guarantee that b will remain the second element, and there is no way to get the members of an object by a sort of index rather than by their name.

    BTW, you write:

    MyObject = ({a: 3, b:5, c:8})})

    Which is too complex (extra parens) and missing a semicolon from the finish line. It is better written as:

    MyObject = {a: 3, b:5, c:8};

    You can iterate through the names of the keys of myObject, with i in myObject {...}, but still there is no guarantee of order. In ExtendScript, you could use myObject.reflect.properties to return the keys in a table, but you will get some extra junk and it's not really consider good practices to use the objects of reflection in non debug code.

    If you are wanting to do this, you are probably not using objects correctly.

    Can you tell us more about the problem you are trying to solve, please?

Maybe you are looking for

  • opacity of URL bar

    When you start typing in the url there is a menu drop-down indicating the locations you have visited but the opacity of it is also dark u can't read it.you see through it...

  • Cannot find 9.3 update on iphone 5s 9.2.1

    I have iPhone 5s 9.2.1 when I'll update, it says that your software is up-to-date! How while it has 9.3?

  • SLATE 21 MEMORY STICK

    Hi, I have a slate 21 my problem is that when I plug in my memory stick I can see it in the file manager, but not the content. All the files on the memory stick are in Hp media player and the books I have on there under the picture so that I can't re

  • Need help Configureing Netgear router so I can connect to Playstation Network.

    My playstation 3 says "Failure of Type NAT" and will not sign into the playstation network. I have a router Netgrear that connect PS3 to Internet, but times out when you try to connect to the PS network. How can I configure the router? I use a wired

  • in windows, xp:shirtcut keys are missing and attach files are missing. How can I fix?

    I use windowx xp family and after uninstalling a program, suddenly atleaste the half of my Desktop Icons (shortcuts) are displayed with a generic icon and lack the key shortcut. When I try to open a program, an error message comes up saying Windows c