Deselect a tab in a TabbedPane onTriggered?

Hello

I have 2 tabs in a tabbed pane. If the user selects the tab critical, based on conditonA, I want to deselect the critical tab and select the normal tab. When I tried the code below using tabbedObject.activeTab, the tabs Panel selects the normal tab.

I really appreciate any help on this issue. Thank you!

TabbedPane {}

ID: tabbedObject

....

Tab {}
ID: criticalTab
Title: qsTr ("Critical")
onTriggered: {}

var Declencheurun = true;
If (Declencheurun == true) {}

tabbedObject.activeTab = normalTab;
}
}
imageSource: "asset:///images/ic_stop.png."
    
}

Tab {}
ID: normalTab

Title: qsTr ("NormalTab")
onTriggered: {}
                        
           
}
imageSource: "asset:///images/ic_stop.png."
    
}

}

Solved

I have to listen to onActiveTabChanged in the TabbedPane and deselect it here.

Tags: BlackBerry Developers

Similar Questions

  • In the root of TabbedPane NavigationPane

    Hi all

    I have a TabbedPane and then a menu with a SettingsActionItem. When this settings button fires I want to push a page that contains the parameters to this subject, and then I can click back to return to tabs.

    import bb.cascades 1.0
    
    TabbedPane {
        Menu.definition: MenuDefinition {
            settingsAction: SettingsActionItem {
                onTriggered: {
                    var page = setingsView.createObject();
                    navigationPane.push(page);
                }
                attachedObjects: ComponentDefinition {
                    id: settingsView
                    source: "SettingsView.qml"
                }
            }
        }
        Tab {
            tite: "Tab1"
            NavigationPane {
                id: navigationPane
                Page {
                     //etc.....
                }
            }    }}
    

    However, the problem is that there is no navigation pane to push the new page. We cannot put a NavigationPane under the TabbedPane, but we can put it in a tab of a TabbedPane.

    So, how can I go all by pushing a new page?

    Thank you!

    [UPDATED ABOVE CODE]

    I got it work using files separated such as:

    hand. QML

    TabbedPane {
        id: newsPane
    
     Tab{
         title: ""
            TabOne {
                }
    }
    Tab{
        title: ""
           TabTwo {
               }
        }
    Tab{
        title: ""
           TabThree {
               }
        }
    Tab{
        title: ""
           TabFour {
               }
        }        
    
    }
    

    Then, he...

    TabOne.qml, TabTwo.qml, TabThree.qml and TabFour.qml:

    NavigationPane {
        Page {
           ....
           }
       }
    

    And it has an a NavigationPane feel TabbedPane when I can push to a page within the NavigationPane and action bar has more tabs, rather it changes the back button.  Can be illustrated in this app: http://appworld.blackberry.com/webstore/content/20197455/?lang=en (I wrote the application for OnlineTobago)

    So as much as your page 'Settings', why not use a spreadsheet?  This is exactly what a spreadsheet is intended, something that breaks the normal flow of navigation.  And it can be accessed via the system menu of any tab, if defined in the main.qml and using the property alias you can control the id defined in TabOne.qml, TabTwo.qml, etc. I have a sample where I do it too: http://bbcascades.com/index.php/tutorial-list/50-persistence-of-cascades-memory

    I hope this helps.

  • TabbedPane question

    Easy and probably + 1 for someone out there, but what I can trigger the first time my application on the first tab start?

    I mean, when my first app I need to call a function in C++ to run something, the other that I can use the onTriggered: {}. The first tab is not raised I think it's just selected by default.

    Thank you

    Ok. I see. The onCreationCompleted must be placed outside the tab, but within TabbedPane.

    If you want to load data for any tab, you can code a javascript function in this tab and call this function in the onCreationCompleted. Say,

    TabbedPane {
        Tab {
            TabABC{
                id: tabxxx
            }
        }
        onCreationCompleted: {
            tabxxx.reloadData();
        }
    }
    
  • The unique sharing of all tabs navigation pane.

    Hi all

    I have a tab pane in my app, now I have 4 components of navigation for 4 tabs.

    is it possible that all my 4 tabs share the same navigation pane?

    Answer please!

    Thank you.

    Well I don't know what you were doing in your code, but it works for me...

    TabbedPane {
        showTabsOnActionBar: false
        Tab {
            title: qsTr("Home") + Retranslate.onLocaleOrLanguageChanged
            NavigationPane {
                id: navPane
                Page {
                    Label {
                          id: navLabel
                            text: "Filter 1"
                      }
                }
    
                onPopTransitionEnded: {
                    page.destroy();
                }
            }
        }
        Tab {
            title: qsTr("Tab 2") + Retranslate.onLocaleOrLanguageChanged
            onTriggered: {
                navLabel.text = "Filter 2";
                var page = page2.createObject();
                navPane.push(page);
            }
        }
        Tab {
            title: qsTr("Tab 3") + Retranslate.onLocaleOrLanguageChanged
            onTriggered: {
                navLabel.text = "Filter 3";
                var page = page3.createObject();
                navPane.push(page);
            }
        }
    
        attachedObjects: [
            ComponentDefinition {
                id: page2
                source: "Label2.qml"
            },
            ComponentDefinition {
                id: page3
                source: "Label3.qml"
            }
        ]
    }
    
  • How can I stop Firefox opening old windows/tabs after a crash?

    every time it crashes and I try to re-open the program, it opens all my old tabs and windows. often, these are the videos which all begin to play both. or worse still, it opens the page that did crash in the first place and crashes again.

    How can I stop this annoying feature?

    If there is no way to stop it, can you recommend a simple browser that don't try to think for you?

    The value of the integer pref browser.sessionstore.max_resumed_crashes to 0 on the subject: config page in order to get the about: sessionrestore page immediately with the first start after a collision has occurred or the Task Manager was used for the closing of Firefox.

    This way, you see if the previous session is not close properly or it crashed and deselects the tabs that you do not want to reopen, but will reopen the other tabs.

    See:

  • Y at - it a command line option that overrides to the "show my windows and tabs from last time"?

    One of my friends sometimes runs into a web page which causes him problems. To be sure, it must note the URL and submit a bug report, if a page causes a browser crash, but in any case, although by default, he likes the browser to restore windows and tabs from the previous session, in the case of a heinous webpage, you * don't * want that to happen. I hope that I can set up an icon so he can click on that starts the browser on its homepage instead of restore the tabs and windows when it gets into trouble.

    The value of the integer pref browser.sessionstore.max_resumed_crashes to 0 on the subject: config page in order to get the about: sessionrestore page immediately with the first reboot after a failure has occurred or the Task Manager was used for the closing of Firefox.

    Which allows to deselect the tabs that you do not want to reopen, but will reopen the other tabs.

    See:

  • Is it possible to stop the firefox to automatically restore all my tabs after accident?

    Every time my computer crashes or I have to force quit firefox, the next time that I open it, it will immediately try to open all the tabs I had open previously, causing the major slowdown and memory hogging. I have to force stop again for it to appear the normal restore tabs dialog box. Is it possible to avoid this?

    Set the browser.sessionstore.max_resumed_crashes pref to 0 on the about: config to get page the on: sessionrestore page immediately with the first reboot after a failure has occurred or the Task Manager was used for the closing of Firefox.

    Which allows to deselect the tabs that you do not want to reopen, but will reopen the other tabs.

    See:

    See also:

  • When Firefox crashes and restart is necessary, Firefox always try to open the same tabs that caused the failure before.

    I use tabbed browsing all the time. When I open a tab of a Web site that poses a problem, freezing Firefox (but not the computer), I find that I can delete the Firefox problem only by restarting the computer. I am so appalled to find that Firefox then tries to recreate the same set of tabs that caused the problem in the first place, causing Firefox freeze again. Usually I can get it out by closing Firefox and very long wait for Firefox to close completely so that it can be restarted again.

    This problem occurs in version 4.0 as well as in the latest version of 3 that I had. I remember that in some versions previous Firefox asks if you want to recreate your tabs or open in a new browser window. I always took the second option. This choice is no longer makes its appearance.

    Set the pref browser.sessionstore.max_resumed_crashes to 0 on the about: config to get page the on: sessionrestore page immediately with the first reboot after a failure has occurred or the Task Manager was used for the closing of Firefox.

    Which allows to deselect the tabs that you do not want to reopen, but will reopen the other tabs.

    See:

    To open the topic: config page, type Subject: config in the address bar (address) and press the 'Enter' key, as you type the url of a Web site to open a Web site.

    If you see a warning then you can confirm that you want to access this page.

    You can use the filter at the top bar of the on: page config to more easily spot a pref.

  • How to display a message on the second tab when an option is selected in a drop-down

    Hello

    I use a combo of my title bar, to within my application to display a list of options that will trigger different URL webViews.

    On my first tab I have a Web of a page view and when the option is selected the webView will change and the second tab will load the same webView but with /deals at the end of the url.

    The problem I have is that one of the options does not have a page of /deals on their site so I was wondering if it would be possible to hide the second tab or display a message on the second tab, when this specific option is selected?

    Thanks in advance

    If your problem is what method to use to hide the tabs or what...

    You can use these functions... It will remove the tab but will not destroy the content, it's like hiding and showing a tab

    REMOVE / HIDE

    tabbedPane.remove (theTab);

    ADD / VIEW

    var index = 2; the tab index

    tabbedPane.insert (index, theTab);

  • Dynamically add tabs QML from C++

    Hello world

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

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

    Here is the code:

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

    C++ :

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

    Thank you!

    Try to declare your root as:

    TabbedPane *tabbedPane =  qml->createRootObject();
    

    As TabbedPane is a class of AbstractPane

  • How to reset the content when switching between tabs

    My use case, is that I have all of the multiple tabs displayed in the sidebar. The content of the tabs each has a title bar of free-form which is scalable. If lets say on tab 1, the title bar is developed, and then when you go to the tab 2, is it possible the collapse of the State of the title bar in tab 1 expanded. Or when you switch to tab 1, is it possible to reset the State of the title bar - meaning collapsed.

    I tried all possible solutions, such as the resetExpanded() or use of the definition of the extended property to false dynamically but no work.

    The only thing working is while I'm in tab 1, I develop the title bar while in the same tab, if I perform any other action, I could run resetExpanded() but that's it. Outside tab 1, as in the QML who has the tabbed pane, listening to side bar changed state events, events to change active tab etc., none to take effect.

    There is no ID for the expandableArea so I couldn't get to the extended property that I could create an Alias for.

    Also the unique ID that gets me access to the resetExpanded() is the ID of the

    FreeFormTitleBarKindProperties, and that's how I'm able to do the

    ID.expandableArea.resetExpanded () BUT that I couldn't create an Alias for this FreeFormTitleBarKindProperties because it is not to be an alias of an identifier is valid.

    So I don't know how to solve this problem, unless there is a way to destroy the contents of the tab whenever I switch to a different tab, but it is very inefficeint and suffers poor performance.

    Any ideas anyone how to solve this problem. Appreciate your help.

    Finally, I was able to solve it!

    Originally I had the game content tab statically at the beginning in the tab "as

    Before:

    Tab {}

    {somePage}

    }

    }

    After:

    Now, I created somePage using ComponentDefinition and assigined the content of the tab as

    tabbedPane.content = somePage, followed by all the properties of customization that I send to somePage

    Now in TabbedPane, I listen to two events below

    onActiveTabChanged: {}

    resetTabContent();

    }

    onSidebarVisualStateChanged: {}

    resetTabContent();

    }

    resetTabContent - calls the function

    function resetTabContent() {}

    mainPane.activeTab.content.resetDropDown ();

    }

    The resetDropDown() function is globally on all aspects for the TabbedPane

    {functionresetAccountsDropDown()}

    contentArea.expandableArea.resetExpanded ();

    }

    where contentArea is the ID of the kindProperties of the title bar

    {Page}

    title bar: title {} bar

    ID: pageTitle

    scrollBehavior: TitleBarScrollBehavior.Sticky

    type: TitleBarKind.FreeForm

    kindProperties: {FreeFormTitleBarKindProperties}

    ID: accountsArea

    {Of container

    }

    {expandableArea}

    }

    }

    }

    }

    Enjoy!

  • Create dynamic tabs

    Hi I want to create a tab dynamically with a function in c, I had something like that, what am I missing? or whats wrong?

     QmlDocument *qml = QmlDocument::create("asset:///UIcities.qml").parent(this);
         AbstractPane *root = qml->createRootObject();
         Tab* tab = Tab::create().title("title").description("description");
         tab->setContent(root);
         tabbedPane->add(tab);
    

    In the header in C++, something like this:

    class YourApp : public QObject {
       TabbedPane* tabbedPane;
    
    public:
       Q_INVOKABLE void setPane( TabbedPane* pane );
    }
    

    Then in your cpp file:

    void YourApp::setPane( TabbedPane* pane ) {
       this->tabbedPane = pane;
    }
    

    And finally your QML:

    TabbedPane {
       id: tabbedPane
    
       onCreationCompleted: {
          app.setPane(tabbedPane);
       }
    }
    

    Of course, this assumes that you have exposed Yourapplication to QML app. Now you can access your TabbedPane anywhere in your CPP like this-> tabbedPane. The reason why I like to do it this way, it is that I am absolutely sure that the pane was created entirely before you set the pointer in C++. I had difficulties in the past using findChild() where the component had not been entirely built before I tried to access it.

    edusal100 wrote:
    Thank you, yes you are right, it is defined in my qml, can you do me a small example of the first?

  • In-App purchase issue

    While the investigation into the issue of images do not hit any fly/scrolling in a Webview (http://supportforums.blackberry.com/t5/Native-Development/Issue-With-Scrolling-Images-In-Webview/m-p...) I came across the question if a user buys my in-app purchase then removes the application and reinstall the in-app purchase did not work.

    First of all, in-app purchase is to remove the ads - it does that very well, but when the application is removed and reinstalled ads appear once more and I don't want to force consumers to pay twice, so I really need to get this fixed number as it is preventing me to release an update of my application.

    I'm working out of this example: http://supportforums.blackberry.com/t5/Native-Development/Sample-Removing-In-App-Ads/m-p/2783323/hig... and have used it to create buying app for my application.

    Here's my source, my main.qml of my application file code:

    import bb.cascades 1.0
    import bb.platform 1.0
    import com.sample.payment 1.0
    
    TabbedPane {
        id: tabbedPane
        property variant payment
    
        Menu.definition: MenuDefinition {
            id: appMenu
            actions: [
                ActionItem {
                    title: "About"
                    imageSource: "asset:///IMG/ic_info.png"
    
                    onTriggered: {
                        aboutSheet.open()
                    }
                },
                ActionItem {
                    title: "Contact Us"
                    imageSource: "asset:///IMG/ic_email.png"
    
                    onTriggered: {
                        emailInvocation.query.uri = "mailto:[email protected]?subject=Shopping For eBay App: Contact"
                        emailInvocation.query.updateQuery();
                    }
    
                },
                ActionItem {
                    id: upgradeAction
                    title: "Remove Ads"
                    imageSource: "asset:///IMG/ic_clear_list.png"
    
                    onTriggered: {
                        if (tabbedPane.payment) {
                            /* replace the values in quotes "" below with the values from
                             * your vendor account for this application's add-on. */
                            payment.mPaymentControl.pid = "{REMOVED}"
                            payment.mPaymentControl.sku = "{REMOVED}"
                            payment.mPaymentControl.name = "Remove Ads"
                            payment.mPaymentControl.metadata = "Purchasing this will remove the adverts!"
                            payment.mPaymentControl.getPrice(payment.mPaymentControl.pid, payment.mPaymentControl.sku);
                            payment.mPaymentControl.purchase(payment.mPaymentControl.pid, payment.mPaymentControl.sku, payment.mPaymentControl.name, payment.mPaymentControl.metadata)
                        }
                    }
                    attachedObjects: [
                        // Definition to hold the PaymentControl so it is only created when neccesary
                        ComponentDefinition {
                            id: paymentdef
                            Container {
                                id: payContainer
                                onCreationCompleted: {
                                    console.log("Payment Definition Created - Checking for Existing Purchases")
                                    paymentControl.getExisting(true);
                                }
    
                                property alias mPaymentControl: paymentControl
    
                                attachedObjects: [
                                    PaymentServiceControl {
                                        id: paymentControl
                                        property string pid
                                        property string sku
                                        property string name
                                        property string metadata
    
                                        // Play receipt animation on purchase response
    
                                        onPurchaseResponseSuccess: {
                                            cpp.saveValueFor("removedAds", "23");
                                            root.removedAds = 23;
                                            console.log("purchaseResponse - " + receiptString)
                                        }
                                        onInfoResponseError: {
                                            console.log("Purchase Error - " + errorCode + " - " + errorText)
                                        }
    
                                        onExistingPurchasesResponseSuccess: {
                                            if (receiptsString == "(No purchases)") {
                                                console.log("existing unable to find receipt")
                                            } else {
                                                console.log("existing receiptString - " + receiptsString)
                                                cpp.saveValueFor("removedAds", "23");
                                                root.removedAds = 23;
                                            }
                                            console.log("existingPurchaseResponse Success - " + receiptsString)
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                },
                ActionItem {
                    title: "Share App"
                    imageSource: "asset:///IMG/ic_share.png"
    
                    onTriggered: {
                        invokeShare.trigger("bb.action.SHARE")
                    }
                },
                ActionItem {
                    title: "More Apps"
                    imageSource: "asset:///IMG/ic_buy.png"
    
                    onTriggered: {
                        invokebb.trigger("bb.action.OPEN")
                    }
                }
            ]
            attachedObjects: [
                Sheet {
                    id: aboutSheet
                    About {
                    }
                },
                Invocation {
                    id: invokeShare
                    query {
                        mimeType: "text/plain"
                        data: qsTr("Get your shopping done easily on your #BlackBerry10 with 'Shopping For eBay'; check it out in @BlackBerry World: http://appworld.blackberry.com/webstore/content/35964888/")
                        invokeActionId: "bb.action.SHARE"
                    }
                },
                Invocation {
                    id: invokebb
                    query {
                        mimeType: "text/html"
                        uri: "appworld://vendor/64825/"
                        invokeActionId: "bb.action.OPEN"
                    }
                },
                Invocation {
                    id: emailInvocation
                    query.mimeType: "text/plain"
                    query.invokeTargetId: "sys.pim.uib.email.hybridcomposer"
                    query.invokeActionId: "bb.action.SENDEMAIL"
                    onArmed: {
                        emailInvocation.trigger(emailInvocation.query.invokeActionId);
                    }
                }
            ]
        }
        showTabsOnActionBar: false
        Tab {
            title: qsTr("Home") + Retranslate.onLocaleOrLanguageChanged
            imageSource: "IMG/101.Home.png"
            NavigationPane {
                id: navigationPane0
                Page {
                    onCreationCompleted: {
                        root.removedAds = parseInt(cpp.getValueFor("removedAds", ""))
                        if (root.removedAds != 23) {
                            tabbedPane.payment = paymentdef.createObject(navigationPane0);
                        } else {
                            console.log("Not Creating Payment Definition, User has Already Paid To Remove Ads")
                        }
    
                    }
                    id: page1
                    //actionBar actions
    
                    //Title bar
    
                    Container {
                        id: root
                        property int removedAds
    
                        onRemovedAdsChanged: {
                            if (removedAds == 23) {
                                myAds.visible = false
                                myAds2.visible = false
                                appMenu.removeAction(upgradeAction)
                            }
                        }
                        Container {
                            id: myAds
                            horizontalAlignment: HorizontalAlignment.Center
                            layout: StackLayout {
    
                            }
                            MyAds {
                                horizontalAlignment: HorizontalAlignment.Center
                                topPadding: 15.0
                            }
                        }
                        Container {
    
                            layout: DockLayout {
    
                            }
                            // To enable scrolling in the WebView, it is put inside a ScrollView.
                            ScrollView {
                                id: scrollView
    
                                scrollViewProperties.overScrollEffectMode: OverScrollEffectMode.None
                                // We let the scroll view scroll in both x and y and enable zooming,
                                // max and min content zoom property is set in the WebViews onMinContentScaleChanged
                                // and onMaxContentScaleChanged signal handlers.
                                scrollViewProperties {
                                    scrollMode: ScrollMode.Vertical
                                    pinchToZoomEnabled: true
                                }
    
                                //Webview
    
                            } // ScrollView// A progress indicator that is used to show the loading status
                            Container {
                                bottomPadding: 25
                                horizontalAlignment: HorizontalAlignment.Center
                                verticalAlignment: VerticalAlignment.Bottom
    
                                ProgressIndicator {
                                    id: progressIndicator
                                    opacity: 0.0
                                }
                            }
                        }
                    } // End of container
                }
            }
        } //End of first tab
    } //End of tabbedPane
    

    Any help and advice in this regard would be greatly appricated.

    Thanks in advance!

    If you test using a sandbox past purchases account cannot be restored. Purchases made with a sandbox account did not get connected to the server, so if you try to restore (ex after you remove and then re - install the app even) then no purchase will be returned.

    You can test your rollback logic with purchases in the same session of the app: open the app, make a purchase, try a restore, all this without closing the application.

    The only other option would be to remove your account from the sandbox and try buying using real $$

  • How to call a function in c ++ QML?

    Hi all

    In my application, I saw two QML and a class of CPP.

    Saying one of my root qml: main.qml is a root page, which displays a list. And the line of the list is an another qml (Customrowlist). And I put the contextProperty for main.qml in the PRC and I need to call a function in the PPC of

    Customrowlist.QML.

    I want to call the deleteAccountData(..,..,..) function. Customrowlist.qml, so how can I do.

    Here is my code

    hand. QML

            TabbedPane {
    
                //property Page about
    
                id: tabbedPane
                showTabsOnActionBar: true
    
                Tab {
                    title: "Manage Accounts"
                    onTriggered: {
                        objectAM.fetchAccountData();
                    }
                    imageSource: "asset:///images/list.png"
                    NavigationPane {
                        id: navPane
                        Page {
                            Container {
                                background: back.imagePaint
                                layout: StackLayout {
                                }
                                ImageView {
                                    imageSource: "asset:///images/head.png"
                                    scalingMethod: ScalingMethod.AspectFit
                                    opacity: 1.0
                                }
                                ListView {
                                    id:savedaccount
                                    objectName: "savedaccount"
                                    listItemComponents: [
                                        ListItemComponent {
                                            type: "item"
                                            CustomListRow {
                                            }
                                        }
                                    ]
                                }
                            }
                            actions: [
                                ActionItem {
                                    id: about
                                    title: "About"
                                    imageSource: "asset:///images/info.png"
                                    ActionBar.placement: ActionBarPlacement.InOverflow
                                    attachedObjects: [
                                        ComponentDefinition {
                                            id: aboutPageMA
                                            source: "about.qml"
                                        }
                                    ]
                                    onTriggered: {
                                        var profilePage = aboutPageMA.createObject();
                                        navPane.push(profilePage);
                                    }
                                },
                                ActionItem {
                                    id: help
                                    title: "Help"
                                    imageSource: "asset:///images/help.png"
                                    ActionBar.placement: ActionBarPlacement.InOverflow
                                    attachedObjects: [
                                        ComponentDefinition {
                                            id: helpPageMA
                                            source: "Help.qml"
                                        }
                                    ]
                                    onTriggered: {
                                        var profilePage = helpPageMA.createObject();
                                        navPane.push(profilePage);
                                    }
                                },
                                ActionItem {
                                    id: settings
                                    title: "Settings"
                                    imageSource: "asset:///images/settings.png"
                                    ActionBar.placement: ActionBarPlacement.InOverflow
                                    attachedObjects: [
                                        ComponentDefinition {
                                            id: settingsPageMA
                                            source: "Settings.qml"
                                        }
                                    ]
                                    onTriggered: {
                                        var profilePage = settingsPageMA.createObject();
                                        navPane.push(profilePage);
                                    }
                                }
                            ]
    
                        }
                    }
                }
    
                attachedObjects: [
                    GroupDataModel {
                        id: feedsDataModel
                        sortingKeys: ["text"]
                        sortedAscending: false
                        grouping: ItemGrouping.None
                    },
                    DataSource {
                        id: feedsDataSource
                        source: "mydata.json"
                        type: DataSource.Json
                        onDataLoaded: {
                            feedsDataModel.clear();
                            feedsDataModel.insertList(data);
                        }
                        onError: {
                            console.log("Error Occured" + errorMessage);
                        }
                    },
                    ImagePaintDefinition {
                        id: back
                        repeatPattern: RepeatPattern.XY
                        imageSource: "asset:///images/bg.jpg"
                    }
    
                ]
            }
    

    My Customlistrow.qml

    import bb.system 1.0
    import bb.cascades 1.0
    import bb.data 1.0  
    
          Container {
                layout: AbsoluteLayout {}
                Container{
                    id: usr
                    layoutProperties: AbsoluteLayoutProperties {
                        positionX: 0.0
                        positionY: 0.0
                    }
                    background: Color.create ("#ffffff")
                    preferredWidth: 768
                    preferredHeight:120
                    Container{
                        layout: AbsoluteLayout {}
                        ImageView {
                            id:accountimg
                            imageSource: ListItemData.account
                            preferredWidth: 78
                            opacity: 1.0
                            layoutProperties: AbsoluteLayoutProperties {
                                positionX: 10.0
                                positionY: 16.0
                            }
                        }
                        Label {
                            id: username
                            text: ListItemData.username
                            textStyle.base: SystemDefaults.TextStyles.TitleText
                            multiline: true
                            textStyle.color: Color.Black
                            textStyle.textAlign: TextAlign.Left
                            layoutProperties: AbsoluteLayoutProperties {
                                positionX: 110.0
                                positionY: 25.0
                            }
                        }
                        ImageButton {
                            defaultImageSource: "asset:///images/delete.png"
                            pressedImageSource: "asset:///images/deletepressed.png"
                            preferredWidth: 78
                            opacity: 1.0
                            layoutProperties: AbsoluteLayoutProperties {
                                positionX: 680.0
                                positionY: 16.0
                            }
                            attachedObjects: [
                                SystemToast {
                                    id: myQmlToast
                                    body: username.text
                                }
                            ]
                            onClicked: {
                                myQmlToast.show()
                                objectAM.deleteAccountData(username.text,password.text,"asset:///images/twitter.png");
                            }
                        }
                        Divider {
                            layoutProperties: AbsoluteLayoutProperties {
                                positionX: 0.0
                                positionY: 118.0
                            }
                        }
    
                    }
    
                    gestureHandlers: [
                        LongPressHandler {
                            onLongPressed: {
                                id:finalx.play();
                                secondcontainer.visible = true;
                            }
                        }
                    ]
    
                    onTouch: {
                        if (event.isUp ()){
                            initialx.play();
                            secondcontainer.visible = false;
                        }
                    }
    
                    animations: [
                        FadeTransition {
                            id:finalx
                            toOpacity: 0
                            duration: 300
                        },
                        FadeTransition {
                            id:initialx
                            toOpacity: 1
                            duration: 300
                        }
                    ]
                }
            }
    

    in my PPC

    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    qml->setContextProperty("objectAM",this);
    
    void AccountManager::deleteAccountData(QString user,QString pass,QString imgSource){
    SystemToast *toast = new SystemToast();
    toast->setBody("Entered delete account!!!");
    toast->show();
    }
    

    I got your problem. Your CustomListrow does not receive the reference to your context "objectAM".

    Please update your main.qml with the following... function and store the reference to the global object and then from your call of customListRow as "Qt.objectAM.deleteAccount ();

    In the hand. QML on finished creation

    onCreationCompleted: {}
    Qt.objectAM = objectAM;
    }

    In CustomListRow...

    onClicked: {}
    myQmlToast.show)
    objectAM.deleteAccountData (username.text, password.text, "asset:///images/twitter.png");
    Qt.objectAM.deleteAccountData ("Me", "pwd", "asset:///images/twitter.png");
    }

    Hope it will work.

    Thank you

  • Gow I stop Firefox from opening a Web site that crashed or stop it when I restart?

    Sometimes a Web site is not responding, I close firefox manually, usually a c; tab dare on my windows pc. When I restart firefox, it goes back to this site, rather than 'well, it's embarrassing...'. y at - it a way to stop this. When I close my firefos, I have it set to clear the history. You helpr oe can shed some light?
    Thank you.

    Firefox will automatically try to restore the tabs and windows from last session if an accident occurred or Firefox does not close properly the last time.
    If the session blocks once, then you will get the page "well, it's embarrassing" (topic: sessionrestore) the next time you start Firefox.
    You can set the pref browser.sessionstore.max_resumed_crashes to 0 on the subject: config page in order to get the about: sessionrestore page immediately with the first start after a collision has occurred or the Task Manager was used for the closing of Firefox.

    This way, you see if the previous session is not close properly or it crashed and deselects the tabs that you do not want to reopen, but will reopen the other tabs.
    If you cannot start Firefox, then you can add this line to the file prefs.js to prevent Firefox to restore the last session automatically.
    user_pref ("browser.sessionstore.max_resumed_crashes", 0);

Maybe you are looking for