How to load a Listview

Hello I hope yo can help me.

I m, creating an application in Spanish, so. I want to fill a listview and when I select some item, send row, call a qml and fill the other listview in this other qml. All this is done. except, I can filter the query to the data source.

Hery my code

hand. QML where I have a Navegationpane, then SegmentedControl and Lisview (myLVNuevo). When I select an item, I take the Id (selectedItem.IdLibro), I create and send another to the qml (bibliapage.qml). His works, in fact.

 NavigationPane {
            id: navpaneBible
            Page {
                Container {
                    horizontalAlignment: HorizontalAlignment.Fill
                    verticalAlignment: VerticalAlignment.Fill

                    leftPadding: 30
                    topPadding: 30
                    rightPadding: 30
                    bottomPadding: 30

                    SegmentedControl {
                        id: sgfavorites
                        accessibility.name:  sgfavorites
                        Option {
                            id: option1
                            text: "Antiguo"
                            selected: true
                        }
                        Option {
                            id: option2
                            text: "Nuevo"
                        }

                        onSelectedOptionChanged: {

                            if (selectedOption == option1) {

                                myLVNuevo.visible = false;                          

                            } else if (selectedOption == option2) {

                                myLVNuevo.visible = true;                        

                            }
                        }
                    }

                    // The contact list filter input
                    TextField {
                        id: txtBuscar
                        hintText: qsTr ("Buscar...")

                        // onTextChanging: _addressBook.filter = text
                    }
                    //lv2
                    ListView {
                        accessibility.name: myLVNuevo
                        id: myLVNuevo
                        dataModel: gdmNuevo
                        listItemComponents: [
                            ListItemComponent {
                                type: "item"
                                StandardListItem {
                                    title: ListItemData.IdLibro + ". " + ListItemData.NombreLibro

                                }
                            }
                        ]
                        onTriggered: {
                             if (indexPath.length > 1) {
                                 var selectedItem = gdmNuevo.data(indexPath);
                                 var contentpage = pageDefinition.createObject();
                                 contentpage.idlibro = selectedItem.IdLibro;
                                 contentpage.texto = selectedItem.NombreLibro;
                                 navpaneBible.push(contentpage);

                             }
                        }

                    }
                }
                attachedObjects: [

                    GroupDataModel {
                        id: gdmNuevo
                    },
                    DataSource {
                        id: dtNuevo

                        // Load the data from an SQL database, based on a specific query
                        source: "asset:///sql/MyBiblia.db"
                        query: "select IdLibro, NombreLibro, Testamento from Libros Where Testamento = 'Nuevo' order by IdLibro DESC"
                        onDataLoaded: {
                            // After the data is loaded, insert it into the data model
                            gdmNuevo.clear();
                            gdmNuevo.insertList(data);
                        }
                    } // end of DataSource
                ]

                onCreationCompleted: {
                        dtNuevo.load();
                }
            } // end of Page

But then when the page is loaded, is not load or filter by property string idlibro. Becuse the query in the data source is idlibro.

 import bb.cascades 1.4
import bb.data 1.0
import bb.cascades.datamanager 1.2
Page {
property string idlibro;
property alias texto: lblNombre.text;

    titleBar: TitleBar {
        id: titlebar
        title: texto
    }
    Container {
        id: bibliapagina;

        Label {
            id: lblNombre
            accessibility.name: lblNombre

            text: texto //qsTr("Pagina de la biblia") + Retranslate.onLocaleOrLanguageChanged

        }
        ListView {
            accessibility.name: myLVCapitulos
            id: myLVCapitulos
            dataModel: dm //gdmCapitulos
            listItemComponents: [
                ListItemComponent {
                    type: "item"
                    StandardListItem {
                        title: ListItemData.Capitulo
                        description: ListItemData.Versiculo
                        status: ListItemData.IdVersiculo
                    }
                }
            ]
            onTriggered: {
                if (indexPath.length > 1) {

                }
            }

            attachedObjects: [
                GroupDataModel {
                    id: gdmCapitulos

                },
                DataSource {
                    id: dtCapitulos

                    // Load the data from an SQL database, based on a specific query
                    source: "asset:///sql/MyBiblia.db"
                    query: "select ('Capítulo ' || IdCapitulo) as Capitulo, IdVersiculo, Versiculo from CapitulosVers Where IdLibro = " + lblNombre.text + " GROUP BY IdCapitulo ORDER BY IdCapitulo DESC" 
onDataLoaded: {
                        gdmCapitulos.clear();
                        gdmCapitulos.insertList(data);
                    }
                }
            ]

            onCreationCompleted: {
                dtCapitulos.load();

            }

        }
    }
}

HOW CAN I ACHIEVE THIS?

ITS important to say, its fine words is a set a query without params. example (select * from CapitulosVers Where idlibro = 1).

THANKS IN ADVANCE

I did the solution...

in the second .qml, just before closing the page, put this:

 onIdlibroChanged: { dtCapitulos.query = "select ('Capítulo ' || IdCapitulo) as Capitulo, IdCapitulo, IdVersiculo, Versiculo from CapitulosVers Where IdLibro = " + idlibro + " GROUP BY IdCapitulo ORDER BY IdCapitulo DESC" dtCapitulos.load();

 }
 onCreationCompleted: {
                dtCapitulos.load();

            }

Tags: BlackBerry Developers

Similar Questions

  • How to load my cd collection from my windows computer to my nano?

    I just bought an ipod nano. I am very new to this. How to load my cd collection from my windows computer to my nano? Thanx

    < re-titled by host >

    Import iTunes library, click hereand follow the instructions.

    (142174)

  • How to load the CMOS (get the Bios settings) on Lenovo IdeaCentre K330

    Hello

    How to load the CMOS (get the Bios settings) on Lenovo IdeaCentre K330? Found no parameters. I can click on F2, then network and passwords, is this all I could configure?

    OK, I got it - you must click F1 several times when starting system upward!

  • How to load Windows "On-screen keyboard" application using LabVIEW

    Hello

    If someone can tell me how to load windows "On-screen keyboard" application using LabVIEW.

    Kind regards

    Bharath


  • How to load the operating system of split hard drive D of Aspire5315?

    OS in my laptop does not work correctly. Standard recovery system does not work - no food no points.

    How to load the operating system of split hard drive D of Aspire5315? -step by step please.

    Please consult this useful link: http://acer.custhelp.com/app/answers/detail/a_id/2631/

  • How to load a "remote desktop"?

    I need to use something called "remote desktop" but cannot find or understand how to load?  Is this software?  I have to add my windows disk?  Help!

    Read the Microsoft KB article:

    Article number: 315328 - how to use the Windows XP Professional Remote Desktop feature
     
  • Diagram on how to load envelopes


    Hey @claregirl7,

    I understand that you are experiencing problems printing envelopes to your HP Officejet 4500 all-in-One Printer G510g. I want to help you solve this issue. As you said, you know how to load envelopes and you just need advice on where to change the pattern of how the envelope is responsible. In order for me to give you the troubleshooting steps specific I have a few questions for you.

    1. what operating system is on your computer?

    What is my OS?

    2. what type of program are you printing envelopes of?

    3. you print the envelope size #10 standard?

    That being said, most people print envelopes in Word so I'll give you the steps on how to correctly print an envelope through this program. Again, these steps should be incorrect do not forget to reply to this message with your operating system and the program you are printing from so I can give you exact measurements.

    How to print envelopes from Word:

    1. Open Word and click Mail Merge to top
    2. Select "Envelopes" in the upper left side
    3. A page of envelopes and labels should now open. Enter your delivery and return address.
    4. Select 'Options' on the lower right.
    5. Under the tab"Options of the envelope 'to ensure that your envelope size is correctly selected.
    6. Select the tab"print"at the top Options Now you must select the method of diet appropriate for your product.
    7. Make sure that you choose the option 'face '.
    8. Also to ensure that "Needles" is enabled.
    9. Press 'OK' and 'print '.

    Also, I'll include loading envelopes paper for your printer for additional advice.

    Loading envelopes

    Please reply to this message and let me know if the steps to solve your problem. Good luck!

  • MacBook Pro OS 10.8 retina no DVD drive, how to load drivers for HP PhotoSmart Premium C310 please

    MacBook Pro OS 10.8 retina no DVD drive, how to load drivers for HP PhotoSmart Premium C310 please?

    We do not have the software 10.8 HP for your printer posted on hp.com and yet, once that happens, you can just download and install. You don't need to do it though, in order to get your printer running on your new Mac.  Simply connect your printer, on the sur le meme same wireless network or via a USB cable, add in printing and fax and let the operating system find and install the software from the Apple software update.  You will be able to the printer and scanning will however be of Image Capture.

  • I have a hp printer and cannot figure out how to load envelopes size 10 for printing

    I have a hp printer and cannot figure out how to load envelopes size 10 for printing. Any help would be appreciated.

    Hello HeidiZarecky,

    You can follow the instructions in this document to load envelopes for your printer.

  • How to recharge a ListView when an item is deleted or changed?

    So I have a ListView in a Page that lists the files.  And the selected files are sometimes renamed or deleted on the triggering of action items, how to refresh the ListView to reflect these changes?

    I would refresh my data model during the outbreak of the follow-up action. It would be just a matter of ListView redisplay with the new data model data.

    It is not in a Navigation pane so I can't push a ComponentDefinition.

    Hello

    Have you tried clearing the datamodel and re - insert the data into it.

    Clear() - http://developer.blackberry.com/cascades/reference/bb__cascades__groupdatamodel.html#function-clear

    insertList() - http://developer.blackberry.com/cascades/reference/bb__cascades__groupdatamodel.html#function-insert...

  • How to load a web page with the Web page class

    Hello world

    I try my app to display the title and favico starting from a given url without showing the content of the Web page itself using the class bb::cascades:WebPage, but after the constructor method and setUrl, apparently not start the loading content and methods title() both icon give anything (or loading())

    Any idea on how to load the webpage using this class?

    void handleInvoke (const bb::system:InvokeRequest & request) {}

    Web page * bookmark = new WebPage();

    Bookmark-> setUrl (request.uri ());

    root->findChild ('message')-> setProperty ('text', QString (bookmark-> title()));

    }

    Thanks in advance

    Diego

    I have use the class Web page, but the documentation, it seems you should subscribe to the loadingChanged signal and wait for the download to complete. The download can begin asynchronously so loading() might return false immediately after the definition of the URL.

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__webpage.html#loadingchanged

  • How to load programs from a CD which does not automatically load

    I am new to windows 7. I want to load a program from a CD. It was easy with the Control Panel Add and deleate one program; or the execution of the order. Now, I don't know how to load a program from a CD which does not automatically load. Help!

    How can I install software on a disk?

    1. Insert the CD/DVD
    2. If the CD is not automatic open start Windows Explorer - click on start, then click computer.
    3. in the Windows Explorer window, open the drive that contains the installation files. For example, if they are on a CD or DVD open that drive or the letter of the disk drive.
    4. in the disk that contains your files, look for either a configuration or installation of the file. Double-click on this file should launch the installation of the program, a game or utility. If you see more than one configuration or install files, try to locate the file for the Application, double-click each setting or install files until you find the file that starts the installation.

    Questions about installing Windows 7?
    FAQ - Frequently Asked Questions from Installation Windows 7 & responses

  • How to load the second list meter if I have something in the first list of select/focus?

    How to load the second list meter if I have something in the first list of select/focus?

    public class spintest extends BaseScreen implements {FocusChangeListener}

    final String [stateList] = {"New York", "Washington"};
    final String [] NYcities = {'Manhattan', 'Queens', 'Brooklyn', 'Bronx'};
    final String [] WashCities = {"Redmond", "Kent", "Seattle", "Bellevue"};

    public SpinTest() {}
    SpinBoxFieldManager spinBoxMgr = new SpinBoxFieldManager();

    SpinBoxField spinBoxStates = new TextSpinBoxField (stateList);
    spinBoxStates.setFocusListener (this);

    SpinBoxField spinBoxCities = new TextSpinBoxField (NYcities);

    spinBoxMgr.add (spinBoxStates);
    spinBoxMgr.add (spinBoxCities);

    Add (spinBoxMgr);
    }

    ' Public Sub focusChanged (field field, int context) {}
    If (spinBoxStates == field) {}
    Salt string = (String) spinBoxStates.get (spinBoxStates.getSelectedIndex ());
    If (sel.equals ("New York")) {}

    I have to load all the cities of New York in the second wheel if I select 'New York' in the first wheel

    }
    else {if (sel.equals ("Washington"))

    I have to load all the cities of Washington in the second wheel if I select 'Washington' in the first wheel

    }

    }

    Simply call the TextSpinBoxField.setChoices method, transmitting your new list of choices.

  • How to load a web page

    Hi friends,

    It's my first query on the forum.

    I'm new to Blackberry applications. Basically, I'm a developer of j2me.

    I want to write a small application that loads a Web page.

    I tried a small piece of code:

    Private bs = Browser.getSession (Browser.CID_BROWSERCONFIG);

    bs.displayPage ("http://www.google.com");

    But it did not help me.

    How to load a Web page for blackberry devices.

    Can someone help me please.

    Thank you

    Maury.

    See this article.

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800440/How_To _...

  • Smartphones blackBerry how to load ringtone

    Hello

    I have a 7250 terminal and don't know how to load a mp3 ringtone from my PC to my terminal office.  I looked in the Desktop Manager but can not find a way to do it.

    Thank you

    You cannot copy ringtones (or other) for the 7250 from the PC. This is a feature that is available in some models after the 7250. Your only option is to email it to yourself as an attachment or upload it to a Web page.

Maybe you are looking for

  • error code A 80071, 91

    I get error code A 80071, 91 I saw there was a response where I have to type something in the cmd screen, but I don't know how to log on as an administrator and even less follow these instructions! My laptop has not updated for over a year!

  • Base of screen is stuck in the down position

    I posted this earlier today and for some reason any, that it has been deleted. (I know it's there an hour after I posted it, so I'm not sure why it was deleted).  Anyway. I have a screen Dell UltraSharp 2405FPW monitor and today by chance, I pushed t

  • Laptop HP 530 - HDD and RAM upgrade

    Hello, I'm on HP 530 and I want to spend her hard drive. In the specified documentation that my laptop supports only 80 / 120Gb hard drives and up to 2 GB of RAM. Is this true? I can't RAM or HARD disk capacity. And what type of HARD drive I should b

  • Example of payment for BB10 Cascades

    Hello I'm looking for an example of implementation of payment for BB10 Cascades service. I don't know about the docs, but a working example would be more appropriate. One such example is there?

  • Ken

    1. the information Windows 10 says that Windows 10 is FREE for 12 MONTHS.  What happens once you have agreed to accept this version, and after the first month, you take the option to keep 10 and do not use your previous version of Windows.  After 12