Parameters in data models

Hey gurus!

I use 10.1.3.3.3 and am having a problem with the settings. If I just use a SQL for my data model and create a setting, it works very well. I will have a problem when I use a data model in my data model and try and use a parameter.

The beginning of my data model is the following:

< dataTemplate than one dataSourceRef = "oltpdev" name = "mdd_rmv_stuff" defaultPackage = "mdd_rmv_stuff" >
Properties of <>
< property name = "xml_tag_case" value = "upper" / >
< / properties >
< Parameters >
< name of the parameter = "p_manager_product_id" dataType = "integer" / >
< / Parameter >
< lexicals >
< / lexicals >
< dataQuery >
< SQLStatement instance name = "Q_MAIN" >

Select mp.manager_product_id mp_id,
MP.manager_product_name,
MP.manager_roof_id
of manager_product mp
where mp.manager_product_id =: p_manager_product_id
< / sqlStatement >

You can see where I'm trying to use the parameter. I get this error when I try to view the report:
====================================================================
Error

The report cannot be made because of an error, please contact the administrator.
Detail of the error


ORA-06550: line 2, column 1:
PLS-00201: identifier ' MDD_RMV_STUFF. P_MANAGER_PRODUCT_ID' must be declared
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored

====================================================================
Any help would be appreciated!

Kris Henning
www.piocon.com

I think you need to create the specification of the package in the database, then:

create or replace package mdd_rmv_stuff
as
number of p_manager_product_id;
end mdd_rmv_stuff;
/

Either that, or some else can answer the question differently?
I just saw the post from Sharky: Sharky - you left the "defaultPackage" on XML, but you also added "defaultValue" to the parameter. Many of those removed the requirement of a package specification to create?

Tags: Business Intelligence

Similar Questions

  • Data model - dynamic query with parameters

    Hi friends, is it possible to dynamically call a query using the parameters of the data models?

    I try to have a BEEP report with data model something like that

    Data model
    Param1

    Q1 = Select * from table 1
    Q2 = Select * from table 2

    If Param1 = X then
    FinalQuery = Q1
    On the other
    FinalQuery = Q2
    End

    Any help is greately appreciated.

    Thank you
    SAI.

    Take a look at the following:

    http://www.Oracle.com/global/de/community/BIP/tipps/dynamische_queries/index_en.html

    http://blogs.Oracle.com/XmlPublisher/files/BIPublisher_dynamic_column%20Blog.PDF

    Thank you!

  • How to pass parameters to Date on the data model

    Hi all
    I try to pass parameters of date on the data model and unable to pull all the data. When I tried hard-coded in the SQL query, it works. Here is the data model, can I pass parameters directly to the dataquery?
    I searched a lot but couldn't find it. Any help is greatly appreciated.

    <? XML version = "1.0" encoding = "WINDOWS-1252"? >
    < name of dataTemplate = "AIMS_VDIS_VALIDATION_REPORT" description = 'Invalid records in the GOALS and for the given date VDIS' version = "1.0" >
    < Parameters >
    < name of the parameter = "p_start_date" dataType = "date" / >
    < name of the parameter = "p_end_date" dataType = "date" / >
    < / Parameter >
    < dataQuery >
    < SQLStatement instance name = "T4" >
    <! [CDATA [SELECT pgw_custom. Account_Validate (acct_new) invalid,
    acct_new,
    DECODE (pgw_custom. Account_Validate (acct_new), 0, 'ACCOUNT OF OBJECTIVES not VALID', 'VALID OBJECTIVES ACCOUNT') message
    Of
    (SELECT DISTINCT SUBSTR (acct, 1, 3) |) JE_CAP | SUBSTR(ACCT,8) acct_new
    Of
    (SELECT the jav.jav_hours hours,
    ACCT GCC.concatenated_segments,
    GCC.code_combination_id ccid,
    $ (bua.hourly_rate * jav.jav_hours);
    CASE WHEN (um.class2 IN (' a ',' B', 'C', d ', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', ',' n, 'O', 'P', 'Q', 'R', 't')) THEN '3201'
    WHEN (um.class2 IN ('Z', "ZA", "ZA1', 'W', 'U', 'V', 'X', 'Y',"ZA2","ZB","ZC","ZD", the from ')) THEN '3301 '."
    END je_cap
    OF pgw_custom.jems_aims_vehicle jav,.
    Apps.mtl_generic_dispositions mg/d,
    Apps.gl_code_combinations_kfv gcc,
    mfour.unit_main@m4prg01 uh,.
    BUA mfour.bill_unit_acct@m4prg01
    WHERE jav.jav_glaccount = mgd.segment1 AND
    MGD.distribution_account = gcc.code_combination_id AND
    JAV.jav_vehicle = um.unit_no AND
    UM.unit_id = bua.unit_id AND
    JAV.jav_project IS NULL AND
    JAV.jav_task IS NULL AND
    JAV.jav_charge_date BETWEEN: p_start_date AND: p_end_date AND
    GCC.detail_posting_allowed = 'Y' AND
    GCC.enabled_flag = 'Y' AND
    NVL (gcc.end_date_active, TO_DATE('31-DEC-4720','DD-MON-YYYY')) > = SYSDATE AND
    SUBSTR (bua.billing_code, 1, 1) = "I" AND
    ((bua.eff_dt < = (SELECT date_fin)))
    OF apps.gl_periods
    WHERE period_name = (SELECT TO_CHAR(:p_end_date,'MON-RRRR') FROM DUAL)) AND
    BUA.end_dt IS NULL)
    OR
    (bua.end_dt >(SELECT start_date)
    OF apps.gl_periods
    WHERE period_name = (SELECT TO_CHAR(:p_end_date,'MON-RRRR') FROM DUAL)))
    ORDER BY valid, acct_new]] >
    < / sqlStatement >
    < / dataQuery >

    < dataStructure >
    < group name = "G_ACCTS" source = "T4" >
    < element name = "VALID" value = "valid" / >
    < element name = "NEW_ACCOUNT" value = "acct_new" / >
    < element name = "MESSAGE" value = "message" / >
    < / Group >
    < / dataStructure >
    < / dataTemplate >

    the parameter name must be

    p_start_date
    p_end_date

    And when the report is run, a value must be selected in the settings. Try this default sysdate.

  • Multiple datasets in single data model

    Dear experts,

    We have created a unique data model that has several sets of data sharing common to BI 11 g Publisher parameters.

    We are facing a problem of performance (data recovery is very slow) while to fetch data from database on execution.

    How to improve the performance in this case?

    Your help will be very appreciated.

    Thanks in advance!

    DB BLOB data recovery should not be a problem. But just to make sure that you remove your SQL BLOB type and see to it there improvements?

    Unfortunately I can't find any documents which mention the process of execution of the data sets.

    But you can do a proof for yourself:

    Add sysdate with timestamp on each set of SQL data and you can see the date with timestamp in the output xml (data view tab) which will show you what set of data is performed first and then what that and etc...

    It will be executed in the order of your data set creation. You can see the structure of the data set in the Structure tab.

    Have you considered the approach below?

    I recommend you to do.

    Is there is no adjustment to make in your SQL, then you can use triggers of events (before the data type).

    You can create a package that runs your sql DB and insert the data into a temporary table and then just ask the temporary table on the data set.

  • Export file DDL in SQL Developer Data Modeler

    I export my last project of relational model of the DDL weeks in hopes of getting a quick and precise way to create my 17 tables. In the relational model, Cust_ID is the PK yet there is nothing indicating it in the script that is created from the export file DDL.  That's what he created.  Now, when I right click on the customer table in the view of the relational model and then choose Preview DDL, it adds the line of alter table. But when I do this for most of the opther whose phones table tables in the image below, it's just the fields, no PK or PK info. How can I get the PK and FK stand? Thank you, Peter

    CREATE THE customer TABLE

    (

    Cust_id INTEGER NOT NULL,

    Name VARCHAR2 (128).

    Address VARCHAR2 (128 CHAR)

    ) ;

    ALTER TABLE customer ADD CONSTRAINT Customer_PK PRIMARY KEY (Cust_ID);     <-this is displayed in the preview of the DOF, not export file DDL. The telephone table does not show the constraints or keys in each view. Even with almost all tables.

    That's what I have for phones

    CREATE TABLE phones

    (

    Phone_ID INTEGER NOT NULL,

    Phone_Type NVARCHAR2 (10),

    Phone_Number TANK (14),

    Customer_Cust_ID INTEGER NOT NULL

    ) ;

    pkfk.PNG

    Hi Peter,.

    A couple of points to check for definitions of key primary and missing foreign key:

    1. the relational model for the primary keys and foreign keys dialogs have both checkboxes 'Generate in DDL', which are normally set.  Make sure they are always defined.

    2. When you make a DDL generation, on the generation of DDL Options screen, select the PK tabs and UK and foreign key constraints and check the boxes 'Selected' for relevant pharmacokinetics and the FKs are defined.  (These settings are remembered from one generation of DDL to the other, and an overview of the DDL will normally use the same parameters as the most recent generation of DDL).

    What Data Modeler version do you use?

    David

  • assistance in case of data model BI Publisher

    Hi all


    I created the data model of BI Publisher,

    < Parameters >
    < name of the parameter = 'documents' dataType = 'character' defaultValue = "" / >
    < / Parameter >
    < dataQuery >
    < SQLStatement instance name = "Q1" >
    <! [CDATA]
    If (: documents == "s") then {}
    Select "ihbojnlj" double s; }
    else {}
    Select "ffffffj" double s;
    }
    []] >
    < / sqlStatement >
    < / dataQuery >

    I am facing problem how to use in case of syntax, if the value of documents = initiative so I'll run A query
    If the value of documents = pr, then I'll start query B and so on.

    do you have any idea?
    Thanks in advance

    You can use something like
    Select "ihbojnlj" s where double: documents == "s".
    UNION
    Select "ffffffj" s where double: documents == 'a '.

  • Increased support of Type of object in Data Modeler

    Hello

    It is a matter primarily for the development team to shape data as well as the Group of tools. First of all, the production of Data Modeler 3.0 version is very nice and improvements in data types on which was in EA1 are large. Thanks for adding to the support of the domain to the definition, attributes and parameters for methods which makes life much simpler and opens the door to a range more wide object type modelling and ease of implementations because consistency can now be maintained much easier through areas. Support for the smoothing of lines is also impressive. It is the best app that I've seen, even better than what we had in the Design Editor in the Oracle Designer, Bravo still once the team which built the diagrammer interfaces.

    My question is, going forward will be Data Modeler has continued to be improved to fully support the Oracle objects and object relational (OR) model? I ask this question because as users of Oracle RDBMS, we do not have a tool that allows to fully model and implement the functionality provided by the server group in the field of object-relational features. Oracle Designer had a capacity of modeling of GOLD, but the end of the product life has stopped any further development. One of the common excuses is there is no request for the market for object - relational modeling. I would say, that the absence of the market demand for object - relational applications is because we have never had a tool that fully supports the relational Oracle - model object. Nor do we have a development tool that allows us to implement a fully developed relational Oracle - model object. The Tools group stopped the development of Oracle Forms support for nested objects and collections. The LOV REF columns feature is quite impressive, but we are unable to get nested collections, still less a nested collection of REFs.

    So as a member of the end user community, we are stuck in this Catch 22. The server group continues to support and improve the object - model relationship, but the tools and modelling groups have not kept with the tools to model or to implement the features and the features supported by the database. As a result, we have a partially constructed set of tools that allows you to scratch the surface of the object - model relationship, but is not able to take full advantage of the powerful features of legacy, legacy and extensive collections, the ability to inherit and extend methods, etc...

    The object - relational model introduced with Oracle8, 10g solved the problem of evolution of type which has made the implementation of the production of realistic objects. My question is; Data Modeler is finally going to fully support the relational Oracle - model object? If until the end user community, we finally get a tool that totally supported the model of GOLD, finally, we will be able to model, generate and deploy applications that will in turn create this market demand which is lacking for the relational model object.

    Thanks in advance,
    ACE

    Hi Ace,

    Thanks for the good words.

    will be the Data Modeler has continued to be improved to fully support the Oracle objects and object relational (OR) model?

    Short time - Yes. What do you want Besides lack of support now nested columns (and related to these constraints, including the PK constraint) and the generation of the 'Alter Instructions?

    Philippe

  • How to store the result of a query in a variable in the data model

    In a model of date I want to do something like this

    < name of dataTemplate = than one dataSourceRef "HURDetail" = "BRM_DATA_SOURCE" >
    < Parameters >
    < parameter name = "PARAM_THRESHOLD_VALUE" dataType = "number", defaultValue = "0" / >
    < / Parameter >

    < SQLStatement instance name = "Q1" >
    <! [CDATA]
    SELECT count (*) FROM TABLE_NAME
    []] >
    < / sqlStatement >

    -I want to assign the output of the above query to PARAM_THRESHOLD_VALUE so I can use it in future requests...
    -My query is complex, for reason of performance I want to store the output of the query.

    Please suggest how do...
    Made a package with the PARAM_THRESHOLD_VALUE parameter and the function value entry assigns the done variable to work?

    Thank you
    Shiva

    Hey Shiva,

    If you want to use the value of the counter in the other queries in the data model, you can have an alias for the extraction of County and use it as a bind variable in other queries as


    SELECT count (*) PARAM_THRESHOLD_VALUE
    FROM TABLE_NAME
    ]]>

    and can use it in another query as


    SELECT XYZ
    FROM TABLE_NAME2
    WHERE XXX = *: PARAM_THRESHOLD_VALUE *.
    ]]>

    Hope this is what you want.
    Thank you.

  • Is it possible to make the condition depending on the sql statements in the data models

    Hi all

    Is it possible to include the condition based on sql statements in the data models.

    For example
    if (some parameter is not null)
    <sqlstatement name="STATEMENT_1">
    ...
    </sqlstatement>
    else
    <sqlstatement name="STATEMENT_2">
    ...
    </sqlstatement>
    Is something like this? Also, the good doc is available for ' how to take full advantage of the "data models" in BI Publisher?

    Thank you
    -Sookie

    Hello Sookie,
    I couldn't find the time to get a data model of demonstration of work for you, but I'll try to explain.

    First, write a PL/SQL package. Make sure that you set all the parameters of model of data such as a global variable in the default PL/SQL package.

    CREATE OR REPLACE
    package as employee
    function BeforeReportTrigger return Boolean;
    query_text varchar (2000);
    number of p_DEPTNO;
    END;
    /

    CREATE OR REPLACE
    package as body employee
    function BeforeReportTrigger return Boolean IS
    Start

    IF (p_DEPTNO = 10) THEN
    query_text: = select col1, col2, col3 from HR.
    elsif (p_DEPTNO = 20) THEN
    query_text: = select col1, col2, col3 hr_history.
    on the other
    query_text: = select col1, col2, col3 hr_history1.
    end if;
    Returns true;
    end;
    /

    Use this package in the default package in your data model. Check the "defaultPackage ="employee"in the following data model header.

    Sample data model
    ------------------------------












    --
    --
    --
    --

    Before running the query SQL, data engine reads the "before the release of the report" and all the texte_requete argument based on the p_DeptNo value. When executing the Q1, engine sqlQuery analyze the query ' & quert_text and replace it with the actual value. For example if the p_deptno = 10, the query will be "select col1, col2, col3 from HR.

    Try it...

  • Problem of data model ORA-00911: invalid character

    I am confronted with error when I run beep

    Help me


    < name of dataTemplate = "SrBysrtype" description = "ServiceRequestBySrtype" than one dataSourceRef = 'demo' defaultPackage = "BIP_DateRange" >
    < Parameters >
    < name of the parameter 'p_Fromsrdate' = 'char' dataType = / >
    < name of the parameter 'p_Tosrdate' = 'char' dataType = / >
    < / Parameter >
    < dataQuery >
    < SQLStatement instance name = "Q1" >
    <! [CDATA]
    SELECT
    incident. Incident_Number as ServiceRequestNumber,
    To_char (incident.incident_date,'DD-MON-YYYY "") as ServiceRequestDate,
    incident. Summary summary,
    agenttime. AgentName as Nom_agent,
    TO_CHAR (agenttime.agentstarttime,'DD-MM-YYYY HH24:MI:SS) as StartTime.
    TO_CHAR (to_date('00:00:00','HH24:mi:SS') +)
    (agenttime. EndTime - agenttime.agentstarttime), "HH24:MI:SS") as TimeSpent
    OF cs_incidents_all_b the incident cs_agenttime_agv agenttime, where & srwhereclause;]] >
    < / sqlStatement >
    < / dataQuery >
    < name dataTrigger = "beforeReport" source = "BIP_DateRange.BeforeReport ()" / >
    < dataStructure >
    < name of group = "G_SR" datatype = "varchar2" source = "Q1" >
    < element name = "Incident_Number" value = "ServiceRequestNumber" / >
    < element name = "Incident_date" value = "ServiceRequestDate" / >
    < element name = "Summary" value = "Summary" / >
    < element name = "nom_agent" value = "Nom_agent" / >
    < element name = "agentstarttime" value = "StartTime" / >
    < element name = "AgentDuration" value = "TimeSpent" / >
    < / Group >
    < / dataStructure >
    < / dataTemplate >





    create or replace
    package BIP_DateRange as

    srwhereclause varchar2 (1000): = ' ';
    p_Fromsrdate varchar2 (400);
    p_Tosrdate varchar2 (400);

    function BeforeReport return Boolean;

    end BIP_DateRange;




    create or replace
    package body BIP_DateRange as

    function boolean return BeforeReport is
    Start

    If p_Fromsrdate is not null then
    srwhereclause: = 'agenttime.incident_id = incident.incident_id | ' AND incident.incident_date between TO_DATE ('| p_Fromsrdate |', "DD-MON-YYYY")';
    end if;
    If p_Tosrdate is not null then
    srwhereclause: = srwhereclause | "AND TO_DATE ('| p_Tosrdate |',"DD-MON-YYYY")';
    end if;
    Returns true;
    end;

    end BIP_DateRange;




    help me I am new to BEEP with data model

    Hmm, can you send me an email to [email protected] please?

    I think that there are two different methods. In fact I have no test system for this here at the moment, so I can't try for me...

    Add two parameters to your package specifications:

    >
    create or replace
    package BIP_DateRange as

    srwhereclause varchar2 (1000): = '1 = 1';
    P_FROM varchar2 (400);
    p_to varchar2 (400);
    p_fromdate varchar2 (400);
    p_todate varchar2 (400);

    function beforereport (p_from varchar2, p_to in varchar2) return Boolean;

    end BIP_DateRange;

  • SQL IN keyword does not not in the data model. ???

    I created a data model that extract codes window a table by using the IN keyword.

    < name of dataTemplate = "Enonce1" defaultPackage = "" than one dataSourceRef 'Flex' = > "
    Properties of <>
    < property name = "include_parameters" value = "true" / >
    < property name = "include_null_Element" value = "true" / >
    < property name = "include_rowsettag" value = "false" / >
    < property name = "scalable_mode" value = "off" / >
    < property name = "db_fetch_size" value = "300" / >
    < / properties >
    < Parameters >
    < name of the parameter = Valeurdefaut 'branchcode"="000"/ >
    < / Parameter >
    < lexicals / >
    < dataQuery >
    < name sqlStatement = than one dataSourceRef "Q2" = "" >
    <! [CDATA]
    SELECT branch_code from sttm_branch@dbuser1 where branch_code IN(:branchcode)
    []] >
    < / sqlStatement >
    < / dataQuery >
    < dataStructure >
    < name of the group = "G_BRANCHES" source = "Q2" groupFilter = "" >
    < element name = "BranchCode" value = "branch_code" / >
    < / Group >
    < / dataStructure >
    < / dataTemplate >

    I created a LOV named branches that hold the entire industry codes and have created a branchcode parameter and set its type from the menu and have assigned branches LOV. I've also selected the check box "Multiple Sélection" and "Can select all" for
    ' Can SΘlectionner everything ' I select 'pass all values '.

    Now I am faced with two questions.
    (1) when I select "All" from the LOV and try to view the report there is no counter code be passed as a parameter. When I select "All" in LOV the XML that is generated, that's how.

    <? XML version = "1.0" encoding = "UTF-8"? >
    < Enonce1 >
    < > 000 BRANCHCODE < / BRANCHCODE >
    < / STATEMENT1 >
    As you can see he is just passing the value defined as defaultValue in the data model.

    (2) when I select several entries of LOV they demonstrate them as parameter in XML, but no data is returned. Resulted in the XML is like that.
    <? XML version = "1.0" encoding = "UTF-8"? >
    < Enonce1 >
    < BRANCHCODE '000 ', '001','002 ' > < / BRANCHCODE > (these are the parameter values)
    < / STATEMENT1 >

    Hello

    you need a lexical parameter in your query:

    SELECT DEPTNO, DNAME, LOC FROM DEPT * & deptwhereclause *.

    This glossary can be defined in one before the report according to your setting of multiple selection

    If p_deptno is not null then
    deptwhereclause: = ' WHERE DEPTNO IN ('| p_deptno |') ' ;
    end if;

    This complete example is here: http://www.oracle.com/global/de/community/bip/tipps/dynamische_queries/index.html

    It's in German, but the screenshots and code may help anyway.

    Concerning
    Rainer

  • Lexical in data model...

    Hi all..

    I have a lexical reference in my data like this model...

    < name of dataTemplate = "dataTemplateName" description = "Description of the model" defaultPackage = "XXXXX_pkg" >
    Properties of <>
    < property name = "include_parameters" value = "true" / >
    < / properties >
    < Parameters >
    < name of the parameter 'p_emp_id' = 'char' dataType = / >
    < / Parameter >
    < lexicals >
    < / lexicals >
    < dataQuery >
    < SQLStatement instance name = "Q1" >
    <! [CDATA [SELECT empno
    deptno
    WCP
    dept
    where emp.deptno = dept.deptno
    & whereclause
    []] >
    < / sqlStatement >
    < / dataQuery >
    < name dataTrigger = source = "XXXXX_pkg.return_where" / "beforeReport" >
    < dataStructure >
    < name of group = "Q1" source = "Q1" >
    < feature name = 'empno' value = 'empno' / >
    < element name = "deptno" value = "deptno" / >
    < / Group >
    < / dataStructure >
    < / dataTemplate >

    where XXXXX_pkg.return_where is a package that contains the function return_where that can select several values...

    When I try to run the report. He eventually show an error as... SQL statement has not successfully completed...

    What is the right way to make a lexical reference? But if I use a single table as example only emp. I get the data correctly without error... when I joined in the clause where I found myself with an error message saying not properly completed sql statement...

    Where could I go wrong... Pointers...

    Thanks in advance...

    Hello

    your query in the data model is
    SELECT EmpNo, deptno FROM emp, dept where emp.deptno = dept.deptno & whereclause

    Now you define whereclause in the package as follows:
    WhereClause: = ' where empno in ('| p_emp_id |') ' ;

    which translates
    SELECT EmpNo, deptno FROM emp, dept where emp.deptno = dept.deptno where empno...

    that is a request not valid.

    Try in your package with
    WhereClause: = ' and empno in ('| p_emp_id |') ' ;

    concerning
    Rainer

  • Activity indicator for loading data model

    Hello

    I'm looking in using an activity indicator to show for my list view to load the user (as it takes 2-3 seconds to display list to be filled with data that it receives the files from my server).

    Here is my list view & data source:

    ListView {
                                    id: listView1
                                    dataModel: dataModel1
    
                                    leadingVisual: [
                                        Container {
                                            id: dropDownContainer1
                                            topPadding: 20
                                            leftPadding: 20
                                            rightPadding: 20
                                            bottomPadding: 20
                                            background: Color.create("#212121")
                                            DropDown {
                                                id: dropDown1
                                                title: qsTr("Date:") + Retranslate.onLocaleOrLanguageChanged
                                                Option {
                                                    id: all
                                                    text: qsTr("All") + Retranslate.onLocaleOrLanguageChanged
                                                    selected: true
                                                }
                                                Option {
                                                    text: qsTr("23/06/2014")
                                                    value: "23/06/2014"
                                                }
                                                Option {
                                                    text: qsTr("24/06/2014")
                                                    value: "24/06/2014"
                                                }
                                                Option {
                                                    text: qsTr("25/06/2014")
                                                    value: "25/06/2014"
                                                }
                                                Option {
                                                    text: qsTr("26/06/2014")
                                                    value: "26/06/2014"
                                                }
                                                Option {
                                                    text: qsTr("27/06/2014")
                                                    value: "27/06/2014"
                                                }
                                                Option {
                                                    text: qsTr("28/06/2014")
                                                    value: "28/06/2014"
                                                }
                                                Option {
                                                    text: qsTr("29/06/2014")
                                                    value: "29/06/2014"
                                                }
                                                Option {
                                                    text: qsTr("30/06/2014")
                                                    value: "30/06/2014"
                                                }
                                                Option {
                                                    text: qsTr("01/07/2014")
                                                    value: "July 1 2014"
                                                }
                                                Option {
                                                    text: qsTr("02/07/2014")
                                                    value: "July 2 2014"
                                                }
                                                Option {
                                                    text: qsTr("03/07/2014")
                                                    value: "July 3 2014"
                                                }
                                                Option {
                                                    text: qsTr("04/07/2014")
                                                    value: "July 4 2014"
                                                }
                                                Option {
                                                    text: qsTr("05/07/2014")
                                                    value: "July 5 2014"
                                                }
                                                Option {
                                                    text: qsTr("06/07/2014")
                                                    value: "July 6 2014"
                                                }
                                                onSelectedIndexChanged: {
                                                    if (selectedOption == all) {
                                                        dropDownDataSource1.sQuery = ""
                                                    } else
                                                        dropDownDataSource1.sQuery = dropDown1.at(dropDown1.selectedIndex).value;
                                                }
                                            }
                                        }
                                    ]
    
                                    listItemComponents: [
                                        ListItemComponent {
                                            type: "item"
                                            StandardListItem {
                                                title: ListItemData.fixtureInfo
                                                description: Qt.formatTime(new Date(ListItemData.timestamp * 1))
                                            }
                                        }
                                    ]
    
                                    onTriggered: {
                                        var selectedItem = dataModel1.data(indexPath);
                                        var detail = fixtures.createObject();
    
                                        detail.fixtureInfo = selectedItem.fixtureInfo
                                        detail.dateInfo = selectedItem.dateInfo
                                        detail.timeInfo = selectedItem.timeInfo
                                        detail.timeZone = Qt.formatTime(new Date(selectedItem.timestamp * 1))
                                        detail.courtInfo = selectedItem.courtInfo
                                        detail.resultInfo = selectedItem.resultInfo
    
                                        navigationPane1.push(detail)
                                    }
                                }
    
    GroupDataModel {
                        id: dataModel1
                        sortingKeys: [ "dateNumber", "id" ]
                        grouping: ItemGrouping.ByFullValue
                        sortedAscending: false
                    },
                    DataSource {
                        id: dataSource1
                        property string sQuery: ""
                        onSQueryChanged: {
                            dataModel1.clear()
                            load()
                        }
                        source: "http://tundracorestudios.co.uk/wp-content/uploads/2014/06/Fixtures.json"
                        type: DataSourceType.Json
    
                        onDataLoaded: {
                            //create a temporary array tohold the data
                            var tempdata = new Array();
                            for (var i = 0; i < data.length; i ++) {
    
                                tempdata[i] = data[i]
    
                                //this is where we handle the search query
                                if (sQuery == "") {
                                    //if no query is made, we load all the data
                                    dataModel1.insert(tempdata[i])
                                } else {
                                    //if the query matches any part of the country TITLE, we insert that into the list
                                    //we use a regExp to compare the search query to the COUNTRY TITLE (case insenstive)
                                    if (data[i].fixtureInfo.search(new RegExp(sQuery, "i")) != -1) {
                                        dataModel1.insert(tempdata[i])
    
                                        //Otherwise, we do nothingand donot insert the item
                                    }
    
                                }
    
                            }
    
                            // this if statement below does the same as above,but handles the output if there is only one search result
                            if (tempdata[0] == undefined) {
                                tempdata = data
    
                                if (sQuery == "") {
                                    dataModel1.insert(tempdata)
                                } else {
                                    if (data.fixtureInfo.search(new RegExp(sQuery, "i")) != -1) {
                                        dataModel1.insert(tempdata)
                                    }
                                }
                            }
                        }
                        onError: {
                            console.log(errorMessage)
                        }
                    },
    
    onCreationCompleted: {
                    dataSource1.load()
                }
    

    In another part of my application, I use an activity indicator to load a webView but I couldn't reshape it for the list view.

    The following code works when my webView loads:

    WebView {
                        id: detailsView
                        settings.zoomToFitEnabled: true
                        settings.activeTextEnabled: true
                        settings.background: Color.Transparent
                        onLoadingChanged: {
                            if (loadRequest.status == WebLoadStatus.Started) {
    
                            } else if (loadRequest.status == WebLoadStatus.Succeeded) {
                                webLoading.stop()
                            } else if (loadRequest.status == WebLoadStatus.Failed) {
    
                            }
                        }
                        settings.defaultFontSize: 16
                    }
    
    Container {
                id: loadMask
                background: Color.Black
                layout: DockLayout {
    
                }
                verticalAlignment: VerticalAlignment.Fill
                horizontalAlignment: HorizontalAlignment.Fill
                Container {
                    leftPadding: 10.0
                    rightPadding: 10.0
                    topPadding: 10.0
                    bottomPadding: 10.0
                    horizontalAlignment: HorizontalAlignment.Center
                    verticalAlignment: VerticalAlignment.Center
                    ActivityIndicator {
                        id: webLoading
                        preferredHeight: 200.0
                        preferredWidth: 200.0
                        horizontalAlignment: HorizontalAlignment.Center
                        onStarted: {
                            loadMask.setVisible(true)
                        }
                        onStopping: {
                            loadMask.setVisible(false)
                        }
                    }
                    Label {
                        text: "Loading Content..."
                        horizontalAlignment: HorizontalAlignment.Center
                        textStyle.fontSize: FontSize.Large
                        textStyle.fontWeight: FontWeight.W100
                        textStyle.color: Color.White
                    }
                }
            }
    
    onCreationCompleted: {
            webLoading.start()
        }
    

    Therefore, what I am trying to make is: get the activity indicator to show when the list view is charging and when it's over, for the activity indicator be invisible. Also, if the user doesn't have an internet connection or loses the signal while the data is filling: would it be possible to recover data from a file stored locally instead ("asset:///JSON/Fixtures.json")?

    Thanks in advance

    With the help of a few other developers I maneged to make everything work properly.

    Jeremy Duke pointed out that I would need to use the onItemAdded in my data model of the Group:

    onItemAdded: {
                            myActivityIndicator.stop();
                            myActivityIndicator.visible = false;
                            loadMask.visible = false;
                            searchingLabel.visible = false;
                        }
    

    Adding that, the loading stops when an element has completed the list.

    Thanks for your help

  • Group data model does not

    Hello

    I am developing a revision update for my app BB10 stunts and I use a data model to pull in the elements of the application do not forget; the only problem I encounter is that I can't get the data model of the group work so that I can arrange the items by the first character instead the data are currently presented as Z - A, even if I could get it to display in A - Z would be enough, but what I am looking to achieve is to get the model to display in A - Z and then sort by the first character, while a header for each letter is displayed.

    Here is the list (QML) and my data model (C++)

    ListView {
                                dataModel: _noteBook.model
    
                                listItemComponents: ListItemComponent {
                                    type: "item"
    
                                    StandardListItem {
                                        title: ListItemData.title
                                        description: ListItemData.status
                                    }
                                }
    
                                onTriggered: {
                                    clearSelection()
                                    select(indexPath)
    
                                    _noteBook.setCurrentNote(indexPath)
    
                                    _noteBook.viewNote();
                                    navigationPane.push(noteViewer.createObject())
                                }
                            }
    

    NoteBook.cpp

    #include "NoteBook.hpp"
    
    #include "NoteEditor.hpp"
    #include "NoteViewer.hpp"
    
    #include 
    
    using namespace bb::cascades;
    using namespace bb::pim::notebook;
    
    //! [0]
    NoteBook::NoteBook(QObject *parent)
        : QObject(parent)
        , m_notebookService(new NotebookService(this))
        , m_model(new GroupDataModel(this))
        , m_noteViewer(new NoteViewer(m_notebookService, this))
        , m_noteEditor(new NoteEditor(m_notebookService, this))
    {
        // First Character grouping in data model
        m_model->setGrouping(ItemGrouping::FirstChar);
    
        // Ensure to invoke the filterNotes() method whenever a note has been added, changed or removed
        bool ok = connect(m_notebookService, SIGNAL(notebookEntriesAdded(QList)), SLOT(filterNotes()));
        Q_ASSERT(ok);
        ok = connect(m_notebookService, SIGNAL(notebookEntriesUpdated(QList)), SLOT(filterNotes()));
        Q_ASSERT(ok);
        ok = connect(m_notebookService, SIGNAL(notebookEntriesDeleted(QList)), SLOT(filterNotes()));
        Q_ASSERT(ok);
    
        // Fill the data model with notes initially
        filterNotes();
    }
    //! [0]
    
    //! [1]
    void NoteBook::setCurrentNote(const QVariantList &indexPath)
    {
        // Extract the ID of the selected note from the model
        if (indexPath.isEmpty()) {
            m_currentNoteId = NotebookEntryId();
        } else {
            const QVariantMap entry = m_model->data(indexPath).toMap();
            m_currentNoteId = entry.value("noteId").value();
        }
    }
    //! [1]
    
    //! [2]
    void NoteBook::createNote()
    {
        // Prepare the note editor for creating a new note
        m_noteEditor->reset();
        m_noteEditor->setMode(NoteEditor::CreateMode);
    }
    //! [2]
    
    //! [3]
    void NoteBook::editNote()
    {
        // Prepare the note editor for editing the current note
        m_noteEditor->loadNote(m_currentNoteId);
        m_noteEditor->setMode(NoteEditor::EditMode);
    }
    //! [3]
    
    //! [4]
    void NoteBook::viewNote()
    {
        // Prepare the note viewer for displaying the current note
        m_noteViewer->setNoteId(m_currentNoteId);
    }
    //! [4]
    
    //! [5]
    void NoteBook::deleteNote()
    {
        m_notebookService->deleteNotebookEntry(m_currentNoteId);
    }
    //! [5]
    
    bb::cascades::GroupDataModel* NoteBook::model() const
    {
        return m_model;
    }
    
    QString NoteBook::filter() const
    {
        return m_filter;
    }
    
    //! [6]
    void NoteBook::setFilter(const QString &filter)
    {
        if (m_filter == filter)
            return;
    
        m_filter = filter;
        emit filterChanged();
    
        // Update the model now that the filter criterion has changed
        filterNotes();
    }
    //! [6]
    
    NoteViewer* NoteBook::noteViewer() const
    {
        return m_noteViewer;
    }
    
    NoteEditor* NoteBook::noteEditor() const
    {
        return m_noteEditor;
    }
    
    //! [7]
    void NoteBook::filterNotes()
    {
        NotebookEntryFilter filter;
    
        // Use the entered filter string as search string
        filter.setSearchString(m_filter);
    
        const QList notes = m_notebookService->notebookEntries(filter);
    
        // Clear the old note information from the model
        m_model->clear();
    
        // Iterate over the list of notes
        foreach (const NotebookEntry ¬e, notes) {
            // Copy the data into a model entry
            QVariantMap entry;
            entry["noteId"] = QVariant::fromValue(note.id());
            entry["title"] = note.title();
            entry["status"] = NoteViewer::statusToString(note.status());
    
            // Add the entry to the model
            m_model->insert(entry);
        }
    }
    //! [7]
    

    NoteBook.hpp

    /* Copyright (c) 2012, 2013  BlackBerry Limited.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
    
    #ifndef NOTEBOOK_HPP
    #define NOTEBOOK_HPP
    
    #include 
    #include 
    #include 
    
    #include 
    
    class NoteEditor;
    class NoteViewer;
    
    /**
     * @short The controller class that makes access to notes available to the UI.
     */
    //! [0]
    class NoteBook : public QObject
    {
        Q_OBJECT
    
        // The model that provides the filtered list of notes
        Q_PROPERTY(bb::cascades::GroupDataModel *model READ model CONSTANT);
    
        // The pattern to filter the list of notes
        Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged);
    
        // The viewer object for the current note
        Q_PROPERTY(NoteViewer* noteViewer READ noteViewer CONSTANT);
    
        // The editor object for the current note
        Q_PROPERTY(NoteEditor* noteEditor READ noteEditor CONSTANT);
    
    public:
        NoteBook(QObject *parent = 0);
    
    public Q_SLOTS:
        /**
         * Marks the note with the given @p indexPath as current.
         */
        void setCurrentNote(const QVariantList &indexPath);
    
        /**
         * Prepares the note editor to create a new note.
         */
        void createNote();
    
        /**
         * Prepares the note editor to edit the current note.
         */
        void editNote();
    
        /**
         * Prepares the note viewer to display the current note.
         */
        void viewNote();
    
        /**
         * Deletes the current note.
         */
        void deleteNote();
    
    Q_SIGNALS:
        // The change notification signal for the property
        void filterChanged();
    
    private Q_SLOTS:
        // Filters the notes in the model according to the filter property
        void filterNotes();
    
    private:
        // The accessor methods of the properties
        bb::cascades::GroupDataModel* model() const;
        QString filter() const;
        void setFilter(const QString &filter);
        NoteViewer* noteViewer() const;
        NoteEditor* noteEditor() const;
    
        // The central object to access the notebook service
        bb::pim::notebook::NotebookService* m_notebookService;
    
        // The property values
        bb::cascades::GroupDataModel* m_model;
        QString m_filter;
    
        // The controller object for viewing a note
        NoteViewer* m_noteViewer;
    
        // The controller object for editing a note
        NoteEditor* m_noteEditor;
    
        // The ID of the current note
        bb::pim::notebook::NotebookEntryId m_currentNoteId;
    };
    //! [0]
    
    #endif
    

    If something you can help me with then this would be very useful - if you need to see more of code then let me know too!

    Thanks in advance

    Try to add in constructor (after a call to setGrouping):

    QStringList keys;
    key<>
    m_model-> setSortingKeys (keys);

    May require alterations, I have not tried this compilation.

  • Get the first item in the data model

    I'm trying to get the first item in a data model. I expect the following to work, but it returns-1

    var firstItem = myDataModel.indexOf(0)
    

    Row is a table, and data() must return a specified row element:

    if (myDataModel.size() > 0) {
      var firstItem = myDataModel.data([0])
    }
    

    indexOf search a value and returns it is row.

    UPD:

    In ArrayDataModel, there is also. value() function which takes a simple index.

    Data() is more generic function inherited from DataModel.

    So, it can be simplified to:

    var firstItem = myDataModel.value(0)
    

Maybe you are looking for

  • I'm trying to find away to disable firefox version 14.0.1 to browse the local drives of the sytem.

    I'm on Firefox 14.0.1 in a Citrix environment and applications are to be virtualized. If a user is running Firefox, the user is able to navigate machine and launching local applications if he or she knows the way to the applications.exe. I was able t

  • Pavilion G6-23391nr: cannot restart or start my computer hp laptop

    I have a pavilion hp G6, and since yesterday, I was unable to boot or reboot my laptop.  I tried unplugging everything, remove the battery and pressing the power button for 15-20 seconds and then reconnect the AC power chsarger and the battery withou

  • Impossible to format cells in numbers

    A range of cells is formatted as numbers, but when I enter a number, it displays as text (cells at random) and I can't reformat then into numbers using cells > number.  This causes formulas using invalid text cells.  I transferred this worksheet to a

  • width of plots of bars

    How can I change the width of the bars draw? I used before the property node but the maximum is 5, I want more while. Thank you

  • 0211 keyboard error - Win98 HP

    Hello. I have a Windows 98 HP Pavilion 8380 office. I have the mouse and keyboard that goes with it. When I start it, I get the title screen and then I get a double beep. On the screen, it shows all the copyright info, etc... and then "0211: Keyboard