TabbedPane - sending of property value when the new tab is selected

Hi just designed tutorial, I have two tabs: vegetables and fruits.

The two tabs will use the same qml file (inside is a unique list) but of course will use different DataModel.

So, I set up a property for the DataModel source and place it when the current tab changes,

Here's my simplified code:

//main.qml
TabbedPane{
    Tab{
        title: "Veggie"
        MyNextPage{}
    }
    Tab{
        title: "Fruit"
        MyNextPage{}
    }
    //Looks like here's the problem
    onActiveTabChanged:{
        var page = myComponentDefinition.createObject();
        if(activeTab.title == "Veggie")
            page.dataModelSource = "models/veggie.xml";
        else{
            page.dataModelSource = "models/fruit.xml";
        }
    }

    attachedObjects: [
        ComponentDefinition {
            id: myComponentDefinition
            source: "MyNextPage.qml"
        }
    ]
}
//MyNextPage.qml
Page{
    property alias dataModelSource: myListView.dataModel.source
    Content{
        ListView{
            id: myListView
            layout: ...
            dataModel: XmlDataModel{
                source: "models/veggie.xml"
            }
        }
    }
}

But he blocks my request. I don't know about works like that of property. Anyway the solution or alternative to send a value to another page?

Thanks before

It's easier if you do not attach the page, as follows:

//MyNextPage.qml
Page{
    property alias dataSource: dataModel.source
    Content{
        ListView{
            id: myListView
            layout: ...
            dataModel: XmlDataModel{
                id : dataModel
                //source: "models/veggie.xml"
            }
        }
    }
}

and then in your tabbedpane

TabbedPane{
    Tab{
        title: "Veggie"
        MyNextPage{
dataSource : "models/veggie.xml";
}
    }
    Tab{
        title: "Fruit"
        MyNextPage{
    dataSource : "models/fruit.xml";
}
    }
}

Tags: BlackBerry Developers

Similar Questions

  • How to remove add it on to google search when the new tab is selected.

    The location of the default cursor is in the search box that is displayed when a new tab is selected. It's a firefox add-on. I would remove that add on. So that the cursor will move to the browser when a new tab is selected.

    Hi cor - el

    Who did the trick. Now, I own empty screens when I open my home page or open a new tab. I like the simplicity - I don't want to see ads or irrelevant guff loads when I use internet. I like a clear workspace, it makes me more relaxed and more productive. I am now very happy!

    Thanks a lot for your help to solve my problems.

    And thanks to Monez01 to start the discussion.

    All the best wishes, FriedEgg (keeping my Sunny Side Up!)

  • Firefox reduced when the new tab is open

    When I open some links that open in a new tab (for example my bank statement has an option 'printable version' and when I click on this link and it will open in a new tab) firefox suddenly minimizes and becomes much smaller. I have to maximize the screen again and it becomes boring after a while. What gives?

    Oh and I'm running on a Mac (OS X).

    This has happened

    Don't know how many times

    With the genie effect too?
    Try this:
    Go in Firefox > Preferences > content.
    Next to "Enable JavaScript", click Advanced.
    Uncheck the box move or resize existing windows.

  • Firefox keeps looking for updates when the new tab open.

    I'm under the latest version of Firefox (40.0.3) with adblocker more like my single addon. However whenever I try to open a new tab it take ages to open because Firefox is constantly looking for an update. It takes 2-3 minutes each time. Did you try refreshing Firefox, uninstall and reinstall without success. My system is 8.1 Win on a Lenovo PC i7. Everything worked well until the last FF update. I have no problem with the same version installed on my laptop.
    Any help/suggestions would be apprciated. Thank you.

    As long as it works. Play well.
    Please report your last post as solved while others will know.

  • His plane will stop when the new tab is open on Mac.

    Please share the steps to do this stop to be heard.

    Go to the Plug-ins.
    Click Activate never for Quicktime.
    Worked for me.

  • some site does not load when their new tab appears, just a white page that says done on the bottom

    If I am on a site and you click a link to open a new tab, the tab is open but never load the page. I just get a blank page, and instead of the name of the page on the new tab, it says 'click (GIF, produce 1 x 1 Image)' and the address bar will have this http://click.linksynergy.com/fs-bin/click?id=6o8JG0hWlQI & offerid = 143696.10000259 & subid = 0 & type = 4 & afsrc = 1 & 01_2270023365_101019092649_184443883_Z = u1. happens to me on several sites. I can't figure it out... Please help. If you click on the link, you will see what I see when the new tab open. I hope someone can tell me how to solve this problem.

    Some firewalls like Kaspersky can block content and send a GIF 1 x 1 instead.

    Kaspersky":" Protection > firewall > Filtration System: disable the banner "Ad Blocker"

    See also the Configuration of Kaspersky Internet Security and that configure the firewall so that Firefox can access the Internet

  • When I click on the new tab button, new tab does not open.

    Also, do a right click on the new tab and selecting open, does not open the new tab.

    Why can't I open new tabs, and what needs to be done to solve this problem?

    Uninstall the Ask Toolbar. It can cause this problem.

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

  • I don't want to move to the new tab immediately when I select text and search it from the context menu.

    When I select text and right-click on it and looking for it, the new tab open and switched to immediately. I don't want that. Instead, I want to stay on the page that I am and don't want new tab to switch immediately.

    Hi Obaid.Farooq, please try the following:
    enter on: config in the address bar of firefox (confirmed the message information where it appears) and search for the preference named browser.search.context.loadInBackground. Double-click it and change its value to true.

  • Is it possible to have the new tab page is displayed by default when you start Firefox?

    Firefox may be set to view the new tab page when the browser is started? In Options > general, the only choices under "Startup of Firefox" is the home page, a blank tab or restore previous session.

    Alternatively, the new tab page is adjustable as home page?

    The value 'When Firefox starts' to 'Show my home page' and 'Home Page' "subject: newtab".

  • How can I get the default for the new tab page when there is no improved/classic/empty choises when I click on the gear icon.

    When I open a new tab, I used to get a page which had tiles for some of the sites I visit often. Now I get the Bing search page. The help of instructions say I can change the default new tab page by clicking on the gear on a new improved, classic, or blank page icon in a drop-down list. When I click on the train, I don't get this list of options. Instead, a settings page appears, allowing me to make various changes, but improved, classic or white new tab page choices aren't there. What should I do?

    To modify the new page tab, please follow these steps:

    1. Go to about:config in Firefox
    2. Locate the browser.newtab.url string
    3. Set the value of this string on the URL of your page to the desired tab

    This should change the new tab page.

    Notes:

    • Set the about:newtab to get the page of the new classic tab
    • Set the about:home to get the default home page
    • Set the about:blank to get the blank page
  • How to get back to my default went recently to the sites when I click on the new tab?

    You see, I downloaded kind of something which changed the squares which showed what I... went in front. (Sometimes just recently, but it registers itself it.) I don't mind.)

    Now it shows Yahoo. And I don't want Yahoo NOT showing when I click New tab. I want that return sites.

    I always love reading, if I get on the Web sites that have stories and quizzes as Quotev!

    Example: You click on the new tab, and it shows the websites, you went on a field. You just click to go to her. I also added the Bookmarks tab, but... It's not the same feeling, there is for me?

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    • Do NOT click on the reset button on the startup window Mode without failure.

    You can use the SearchReset extension to reset preferences to default values.

    Note that the SearchReset extension runs only once and then uninstalls automatically, so it will not appear on the page "> Firefox Add-ons" (topic: addons).

    If you do not keep the changes after a reboot or have problems with preferences, see:

  • Is it possible that when the new record is inserted in a table then this empty inserted record is automatically displayed without scrolling?

    Mr President.

    Is it possible that when the new record is inserted in a table then this empty inserted record is automatically displayed without scrolling?

    Because I change the size property of the table 5 range and my new record is inserted at no 10.

    When I click the addRecord button the new parallel line does not appear, do scroll down to see it.

    I want that we don't have to scroll down.

    The line is displayed automatically.

    as shown in the photo my behavior of page.

    scrolling.png

    Concerning

    If you just need the newly created line to be visible,

    You can simply set contentDelivery = 'immediate' and displayRow = "selected".

    P.S. the blog mentioned above only.

    See you soon

    AJ

  • How to add a transient attribute of a table values in the new attribute group wise transient that is to say wise customer?

    Mr President.

    How to add a transient attribute of a table values in the new attribute group wise transient that is to say wise customer?

    as below

    custwisevalue.png

    Concerning

    Hello world

    for an overview in the following form

    This is the sql query that reach this format

    SELECT c.name customer_name,
            p.name product_name,
            sl.sal_qty,
            sl.unit_sal_price,
            sl.sal_qty*sl.unit_sal_price AS salesvalue,
            CASE
              WHEN ROW_NUMBER () OVER (partition by c.cust_id order by p.prod_id desc,sl.sal_id desc) = 1 THEN
                  SUM (sl.sal_qty*sl.unit_sal_price) OVER (PARTITION BY c.cust_id)
            END totals
    FROM customer c INNER JOIN sales s ON s.cust_id = c.cust_id
    INNER JOIN salesline sl ON sl.sal_id = s.sal_id
    INNER JOIN product p ON p.prod_id = sl.prod_id
    ORDER BY c.cust_id,p.prod_id,sl.sal_id
    

    Cheers and enjoy

    Respect of

  • How to make the homepage to appear when opening new tab

    Under Firefox 40.x whenever I opened a new tab, my home page appeared. When I upgraded to 41.0, opening a new tab displays the suggested sites. How do I have my home page appear whenever I open a new tab?

    41 of Firefox is no longer uses the browser.newtab.url setting in about: config because he was constantly attacked by malware. From 41 of Firefox, you need an add-on to change the new tab page.

    Here are a few options (I'm learning more all the time):

    • If you are already using Classic theme restaurant: There is an option somewhere (!) in his dialogues of the parameters to select another page in the new tab.

    Setting up substitute again tab

    After installing this extension, you must use the Options page to set the new desired tab page (instead of use subject: config).

    Open the page modules using either:

    • CTRL + SHIFT + a (Mac: Cmd + shift + a)
    • "3-bar" menu button (or tools) > Add-ons

    In the left column, click Extensions. Then on the side right, find the new tab override and click the Options button. (See first screenshot attached).

    Depending on the size of your screen, you may need to scroll down to enter the address in the form. (See second screenshot attached). For example:

    • (Default) page thumbnails = > subject: newtab
    • Blank tab = > subject: empty
    • Built-in Firefox homepage = > topic: welcome
    • Any other page = > full URL of the page

    Then tab or click this form field and you can test using Ctrl + t.

    Success?

    Once you have set it as you wish, you can close the Add-ons page (or use the back button to return to the list of Extensions of this Options page).

  • Yahoo appears when I press the new tab now and continues to do so even if I change it back

    I tried the subject: config and the removal of Yahoo / change in about: newtab - it works, but in about 30 minutes, it is for Yahoo. I checked add-ins and extensions, and the only thing I'm running is Norton. I even tried to go back to the original version of Firefox, in case Yahoo has uploaded a new modified version, and that seems to work, yesterday. But today, when I clicked on the new tab - Yahoo back again. Nothing to do, it seems made a difference - it's worse than a virus, as it seems to keep regenerating itself. Can anyone help please?

    I have "think THAT"I could find a resolution. I included here for info to others.
    Went to the control panel in Windows
    Choose to uninstall a program
    Clicking the column installed on everything in date order.
    Noticed that at the same time I installed another piece of software a 2nd piece has been installed without my permission. It was called Hub a lot of results.
    Selected many results Hub and uninstalled.
    To do this, I noticed that it closed Firefox.
    After uninstalling, I restarted the PC, just in case he left something in memory
    Then once it restarts again, I uninstalled Firefox (tbh, I probably didn't need to do that, but wasn't any risk)
    Rebooted again (probably no need to do)
    Once the PC itself started, I installed a version of Firefox.

    Now, fingers crossed, it worked. If it has, I'll come back here tomorrow and this will mark as resolved.

Maybe you are looking for

  • Questions music Siri

    When I ask Siri to tell me that the notes of music of a rope, as c major it looks like in my notes app instead of say, C, E, G I saw a list of orders Siri and orders is... find the notes of b minor. All ideas Thank you

  • Aspire 572 display scratches r7

    Recently, I noticed something that really bothered me: (by all means a small stripe appeared on the screen: /.) I'm really well so that that sort of thing does not happen. Well... when I looked carefully he noticed that there where scratching them ar

  • Can not update Windows XP Pro!

    My computer came from a church.  In January we had a fire in their apartment, so we lost everything. Including our computers. If the Church gave me one that was given to them. And the admin password is at stake. And nobody knows. I can't download the

  • WinRE doesn't work anymore, is there a way to reactivate it or download a new copy.

    Windows Recovery appeared a start when F8 has been exploited, .no longer made & can not be found in the computer.

  • BBM Help!

    I just got a blackberry bold 9900 and I've set up bbm, it was working fine until I updated. Now, he does not appear to connect to my id at all. He keeps doing another account rather than use the one I have already.