onPopTransitionEnded
Hey, maybe I missed something, but is it possible for me to identify what page just fucked? page.ID does not appear to be a value any. Thank you.
use page.objectName
of course, we must add this property when you create the page:
{Page}
objectName: "Edit."
}
Tags: BlackBerry Developers
Similar Questions
-
Passport system: Add support for scrolling through the physical keyboard
Hi guys,.
as you know peripheral Pasport is the new support feature: scrolling in the list view/Scroll through the physical keyboard. It seems that this function should work automatically, but it is not working at all in my application. It works only partially to control the display of Web pages and only on the pages of the subsites of my web content.
Looks as the root cause of this issue is the list view must focus to handle keyboard events. OK, so the workaround can be call requestFocus() on the list view. It's a job but only until I do not touch the other control or scroll this list via the screen point of view! Or for example my app can show popup by clicking on list view and when this popup will be rejected the focus won't return to the display of the list...So my question is what good way to add support for this feature? Do I really need to play with requestFocus()? Or maybe there's a simple way to always keep the focus on the display of the list?
I really need help.I've added a few features such as
requestFocusForScrolling()
then get the signal of this active tab has changed, you can call this function to get the new focus
or on NavigationPane if returning to onPopTransitionEnded () calling the requestFocus on page function now on top
In my Pages, I always have a few features added like connect(), disconnect() cleanUp() init() and now also at the request of focus. In a few pages, these functions are empty, but I can use them in the generic functions where I only got one Page
----
not easy to touch OS oriented to add a key activated area outside the screen
It always depends on the field with the development: think of an Image when you change the size of gestures touch on keyboard or take a look at sales-charts where you "scroll" in the months of keyboard
Same pages may also have ScrollView and/or one or several ListView - it's do you stunts where is the update for keyboard gestures.
-
Structure of good app to make high-level navpane on pane tabs?
What is the structure of the correct application for objectives menu navigation, slide-top like for example 'settings' and 'About' pop on top an application with a tabbed pane as its structure of high level, in a navpane - like fashion?
See for example the menu of top-parameters for the BB10 calendar application. At the top of the structure nav app we have tabs views for the month, day, week, agenda, etc., but no matter what the tab showing, we are on, settings page invoked since the application slide-top menu appears on top of the active tab.
When I try to place a TabbedPane inside a NavigationPane, QML editor gives the error message:
"'FirstPage' default property value type mismatch. Waiting for Page and found TabbedPane. »
I guess I could put a navpane within each tab, but first of all, it's bad code factoring for slide-top action menu (it should be set in one place), and secondly, it would require me to determine the active tab in the menu slide-top manager and push the target page navigation - from the active tab calculated.
Conceptually, I'm trying to do something like this:
import bb.cascades 1.3 NavigationPane { id: navigationPane attachedObjects: [ ComponentDefinition { id: infoPageDefinition source: "asset:///infoPage.qml" } ] Menu.definition: MenuDefinition { actions: [ ActionItem { title: "Info" imageSource: "asset:///images/ic_info.png" onTriggered: { var infoPage = infoPageDefinition.createObject(); navigationPane.push(infoPage); } } ] } TabbedPane { tabs: [ Tab { // Tab 1 stuff }, Tab { // Tab 2 stuff } ] } onPopTransitionEnded: { // Destroy the popped Page once the back transition has ended. page.destroy(); } }
in order to have a similar structure to the calendar app nav app.
You don't need to have the specific content of the tab inside the tab itself. You can use a NavigationPane + Page with tab specific containers, move that visible on the signal of onTrigger tab. Then, you can push everything you need on top of the NavigationPane.
-
onTriggered retail Info (LISTVIEW)
Hello
Sorry to ask again
I want to show the details of my promo
It's my main QML
NavigationPane { id : nav1 onPopTransitionEnded: page.destroy() Page { Container { Header{ title: "Promo" } ListView { id: listViewDemo dataModel: GroupDataModel { id : prm1 grouping: ItemGrouping.None } listItemComponents: [ ListItemComponent { type: "promo" Container { layout: StackLayout { orientation: LayoutOrientation.LeftToRight } WebView { preferredWidth: 150 preferredHeight: 90 verticalAlignment: VerticalAlignment.Top url : ListItemData["ImageLink"] } StandardListItem { title: ListItemData["promoID"] + "." + ListItemData["Title"] description: ListItemData["Description"] leftMargin: 30 verticalAlignment: VerticalAlignment.Center } } } ] function itemType(data, indexPath) { return "promo"; } onTriggered: { if(indexPath!=0){ var promo = prm1.data(indexPath); var promodetail = promocontent.createObject(); promodetail.promo = promo; nav1.push(promocontent); } } } } } } attachedObjects: [ DataSource { id: serviceDataSource source: "http://www.rws.rajaspot.com/rs_promoclient.php" type: DataSourceType.Json onDataLoaded: { listViewDemo.dataModel.insertList(data.promo_info) } }, ComponentDefinition { id : promocontent source : "PromoContent.qml" } ] onCreationCompleted: { serviceDataSource.load(); }
It's my promodetail
Page { property variant promo; Container { id: container1 verticalAlignment: VerticalAlignment.Center horizontalAlignment: HorizontalAlignment.Center topPadding: 50 WebView { id : imageview horizontalAlignment: HorizontalAlignment.Center url: promo["ImageLink"] preferredWidth: 400 preferredHeight: 400 } Label { id:label1 textStyle.base: SystemDefaults.TextStyles.BigText horizontalAlignment: HorizontalAlignment.Center text:promo["Title"] } Label { id:label2 textStyle.base: SystemDefaults.TextStyles.SubtitleText horizontalAlignment: HorizontalAlignment.Center text:promo["Description"] } } }
the following error message are
url: promo["ImageLink"]
text:promo["Title"]
text:promo["Description"]
He can't call my main.qml
any suggestion?
Thank you
In some cases, your promo property can be "undefined" after you press page. Because it is not yet assigned. You can avoid this if you check the property on your page.
For example:Page{ property variant promo: null Container{ layout: DockLayout{} leftPadding: 20 rightPadding: 20 topPadding: 20 Label{ id: label horizontalAligment: HorizontalAligment.Center /* In some cases will be the text empty. Because promo property is not yet assigned*/ text: promo.Description } } }
-------------------------------------------------
See the simple example. You have two options to avoid ownership promo "undefined".
1. replace the text property of the label with this
text: promo? Promo. Description:
2. signal property promo label definition
onPromoChanged: if (promo) label.text = promo. DescriptionMy English is bad, so I hope you understand what I mean. Maybe someone who has good English can specify my 'answer '.
EDIT:
You can also find 'Data passing between the QML pages' for more information
-
TabbedPane NavigationPane and return
Hi all
I am currently working on an application that has a TabbedPane as root control, one of the tabs has a grid of buttons which, once clicked will be display a NavigationPanel which will allow the user to scroll through the different pages.
The problem I have is how to return to the TabbedPane, once I'm done with the NavigationPane. Is the closest I have set up an action close in the action menu that displays the last page, then tries to restore the tabs panel display using the "Application::instance()-> setScene (root);", unfortunately, this causes app to freeze.
Ideally, I would go back to the TabbedPane using the default back button on the first page, but it seems to be disabled, adding that a custom button also fails IE does not appear.
So I was wondering if I'm missing something, IE the TabbedPane need to recreate?
Thanks for any help, how to integrate the different controls seems a little light on documentation.
Thanks and greetings
James
You don't need to return the pane tabs - use the following structure:
TabbedPane { Tab { id: tab1 title: "First Tab" NavigationPane { id: nav1 Page { id: page1 /* put your buttons here */ } onPopTransitionEnded: { page.destroy(); } } } Tab { id: tab2 } }
The structure above would output a blank page in your first tab. There will be no back along the action bar button, and the action bar itself will be invisible unless you put some ActionItems in there. Put your buttons on this first page (put it in a separate QML file so that your main.qml is sharper).
When you press a button on your home page (page1), pushing an extra page for 'nav1' it will be pushed ontop of page1 - and you'll get a back button this time. You have no need to do something to get back to the basic page, except by pressing the back button. When the top of the page gets jumped, you will automatically return to the base of the base. Be sure to destroy the pages you create in the onPopTransitionEnded handler.
-
How to register a list of some fun pages?
Hi all
I'm developing an application where I save my split pages references and that push their return in the Navigation stack to demand. What would be the best way to go about this?
So far I tried a qml property:
property list
pages However all attempts get pages to come under the name "undefined".
I also tried to create and save a custom in QML C++ class, however I can't seem to pass references to pages of may of QML to C++.
Any suggestions?
Thank you!
I frequently save QStringList in QML, I think that it is supposed to work with a list of QObjects also. I don't have access to my computer, so can't check my code to store/edit a list of string.
You can try this:
NavigationPane {}
ID: root
[property pageList variant:]...
...
onPopTransitionEnded: {}
var tempList = new Array()
for (int i = 0; i)< root.pagelist.length;="">
tempList [i] = root.pageList [i]
tempList [tempList.length] = page
root.pageList = tempList
Console.Debug ("PageList length:" + root.pageList.length)
root.push(root.pageList[0]) / / you really want to push the first page of the list as soon as a page is out?
} -
TypeError: Result of expression 'item' [undefined] is not an object.
Hello
I can userstand the good way to spend the ListItemData given to a page entry. In the example ListView generated here is what is generated.
import bb.cascades 1.2 NavigationPane { id: nav Page { Container { ListView { dataModel: XmlDataModel { source: "data.xml" } onTriggered: { if (indexPath.length > 1) { var chosenItem = dataModel.data(indexPath); var contentpage = itemPageDefinition.createObject(); contentpage.itemPageTitle = chosenItem.name nav.push(contentpage); } } accessibility.name: "Listing" } } } attachedObjects: [ ComponentDefinition { id: itemPageDefinition source: "ItemPage.qml" } ] onPopTransitionEnded: { page.destroy(); } }
import bb.cascades 1.2 Page { property alias itemPageTitle: titlebar.title titleBar: TitleBar { id: titlebar } Container { } }
If I wanted to copy the input data to the push page, then I can do that.
import bb.cascades 1.2 NavigationPane { id: nav Page { Container { ListView { dataModel: XmlDataModel { source: "data.xml" } onTriggered: { if (indexPath.length > 1) { var chosenItem = dataModel.data(indexPath); var contentpage = itemPageDefinition.createObject(); contentpage.item = chosenItem nav.push(contentpage); } } accessibility.name: "Listing" } } } attachedObjects: [ ComponentDefinition { id: itemPageDefinition source: "ItemPage.qml" } ] onPopTransitionEnded: { page.destroy(); } }
import bb.cascades 1.2 Page { property variant item titleBar: TitleBar { id: titlebar title: item.name } Container { } }
And this also works except that it generates a
TypeError: Result of expression 'item' [undefined] is not an object.
error. Thus, it is written in the ebook learn Blackberry App Development 10. Anyone know how to get this to work without him spit the error type?
Thank you
the problem is that the point is not defined when the page is created.
a solution would be to use onItemChanged to set the title.
or use something like element? Item.Name;
There are many other possible solutions, but these two come to mind that the easier. -
Problems running the example NavigationPane
Hi, just trying to get an idea how to use the NavigationPane in my application.
I'm trying to follow this example: https://developer.blackberry.com/cascades/reference/bb__cascades__navigationpane.html
This is how my class looks like where I want to add a NavigationPane:import bb.cascades 1.0 NavigationPane { id: navigationPane Page { // Root Container Container { ... CustomButton { text: "Click me" btnBackground: "asset:///btn-lightblue.png" btnSelected: "asset:///btn-green.png" bottomPadding: 12.0 topPadding: 12.0 // This is where I want the second Page to show up onTouch: { var page = pageDefinition.createObject(); navigationPane.push(page); } attachedObjects: ComponentDefinition { // where should this go? id: pageDefinition; source: "SecondDialog.qml" } } ... } // Container } // Page onPopTransitionEnded: { page.destroy(); } } // Navigation Pane
But when the user clicks on the button "Click me" the SecondDialog.qml does not appear... Can someone point out what I'm doing wrong...? Thank you.
OK, it is resolved, the problem is in the second page I add me to the navigation pane, missed me an "import bb.cascades 1.0" - it
-
onPeekStarted and onPeekEnded signals not firing
Here's a simple QML which shows that the onPeekStarted and onPeekEneded signals not shooting. What I am doing wrong?
NavigationPane { id: navigationPane Page { Container { Button { id: button text: "Navigate" onClicked: { var page = pageDef.createObject(); navigationPane.push(page); } } } } attachedObjects: [ ComponentDefinition { id: pageDef Page { id: secondPage Label { text: "Second page" } paneProperties: NavigationPaneProperties { backButton: ActionItem { title: "First page" imageSource: "back.png" onTriggered: { navigationPane.pop(); } } } } } ] onPopTransitionEnded: { page.destroy(); button.text = "Page destroyed" } onPeekStarted: { button.text = "peek started"; } onPeekEnded: { button.text = "Peek ended"; } }
Reading the documentation, the onPeekStarted and onPeekEneded signals are sent to the Page and not the NavigationPane. It makes sense that the Page is the component that is to be read on.
NavigationPane { id: navigationPane Page { onPeekStarted: { button.text = "Peek started"; } onPeekEnded: { button.text = "Peek Ended"; } Container { Button { id: button text: "Navigate" onClicked: { var page = pageDef.createObject(); navigationPane.push(page); } } } } attachedObjects: [ ComponentDefinition { id: pageDef Page { id: secondPage Label { text: "Second page" } paneProperties: NavigationPaneProperties { backButton: ActionItem { title: "First page" imageSource: "back.png" onTriggered: { navigationPane.pop(); } } } } } ] onPopTransitionEnded: { page.destroy(); button.text = "Page destroyed" } }
-
Destroy... on the page?
Hi, maybe this is a stupid question but in qml, how can we know when the page is destroyed?
For example, using a glance, user can access the previous page, but this, I want to change some settings. This process of 'destroy' can be detected?
Edit: there may be a trigger to be "exposed" on the previous screen?
good, after reading a few docs and now in the back burner, I realized that this page subject was setting, not the actual page id (as seen in almost every doc on navigationPane)...
Simply call:
onPopTransitionEnded: { page.destroy(); }
will destroy the page at each time all along of the app...
-
Sends data to a QML page to the other
I did an application based on QML and Python.
I use NavigationPane as described here: https://developer.blackberry.com/cascades/reference/bb__cascades__navigationpane.html
Now, my question:
As the handle of the page is created immediately and locally when the page is advanced, how can I share information with her before or after its creation?
I thought to create the page earlier so there are already, but don't know how that would be possible.
Please don't suggest not any C++ solution since I'm NOT using C++ for this app!
If you want that it is global, you can always he do that with properties.
// in root element NavPaneOrWhatever { id: root property variant myPage ... // wherever you create the dynamic Page onTriggered: { if (!root.myPage) root.myPage = pageDef.createObject(); root.push(root.myPage); } // if you do it that way, don't do this in the root component: onPopTransitionEnded: { root.myPage.destroy(); }
If you want to the page once and never destroyed, if (! root.myPage) thing. Otherwise that out and just re - create the page each time, and then add the call destroy() to clean things up when the page is closed.
-
setProperty in pushed NavigationPane Page
How to set the property on the page, which was pushed from NavigationPage?
hand. QML
import bb.cascades 1.0 NavigationPane { id: navigationPane Button { text: qsTr("Game") onClicked: { navigationPane.push(gameDef.createObject()) } } attachedObjects: [ ComponentDefinition { id: gameDef source: "game.qml" } ] onPopTransitionEnded: { // Destroy the popped Page once the back transition has ended. page.destroy(); } }
Game.QML
import bb.cascades 1.0 Page { property int life: 40000 //rest correct, not important }
applicationui.cpp
//fragment QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this); qml->setContextProperty("app", this); // Create root object for the UI root = qml->createRootObject
(); root->setProperty("life", int(4)); //not work What to put in this CPC file, to change the ownership of life in the game.qml file?
Thanks in advance
I think you're going to struggle to write a full app so if you think it takes too much time.
It's not a tip, it's a more condensed way to do what you already do part.
If you do not do it this way it will NEVER work because THERE is NO such thing as the page that you want to access in applicationui.cpp.
[Edit] I have also a problem with findChild as long as you understand its functionality and where and how to use it, then he has a purpose distinct and separate from the definition of property values.
-
Navigate from a to an other navigation pane navigation pane
Hi all
In the navigation pane, we can spread one component to the next.
But what happens if I want to navigate from a navigation to another part of the navigation pane.
for example: -.
hand. QML: -.
ActionItem { title: qsTr ("ReadFromSD") imageSource: "asset:///images/action_addcontact.png" ActionBar.placement: ActionBarPlacement.OnBar onTriggered: { if (_addressBook.detectSD()) { var page = secondPageDefinition.createObject(); navigationPane.push(page); } } }
and the second page definition is like: -.
ComponentDefinition { id: secondPageDefinition source: "filePicker.qml" Page { Container { } paneProperties: NavigationPaneProperties { backButton: ActionItem { title: "Back" onTriggered: { /*username.text = ""; password.text = "";*/ navigationPane.pop(); } } } } }
The problem that is happening, is that the flow is not the trigger from one component to the other:
NavigationPane { id: navigationPaneFilePicker onPopTransitionEnded: page.destroy() Page { titleBar: TitleBar { title: qsTr ("Select contacts File") } Container { layout: DockLayout {} // The background image ImageView { horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill imageSource: "asset:///images/background.png" } FilepickerScrollView { Container { horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill ................................................ ...............................................
When I click the first page its not sailing does not to the second. When the second does not have the navigation pane it worked correctly, but as soon as I added the tag in navigation pane to it it stopped working
Please suggest
The element root firstPage.qml and secondPage.qml doesn't have to be a NavigationPane but a page element. You already have a navigationPane in your hierarchy of context and as a result, you can refer to your main QML file NavigationPane directly.
For example:
hand. QML:
include bb.cascades 1.3 NavigationPane { id: root Container { Button { text: "Push the first pane" onClicked: { var first = firstPane.createObject(); root.push(first); } } } attachedObjects: ComponentDefinition { id: firstPane source: "firstPage.qml" } }
firstPage.qml
include bb.cascades 1.3 id: navigationPane // The initial page Page { content: Container { Button { text: "Display First Page" onClicked: { var second= secondPage.createObject(); // Use the navigationPane defined in main.qml root.push(second); //pushes the defined component definition (first) } } } // end of Container attachedObjects: [ ComponentDefinition { id: secondPage source: "place the asset filepath to your secondPageQML here" } ] // end of attachedObjects list } // end of Page
-
deleteLater vs destroy QML dynamic objects
this thread I know its safe in C++ to use deleteLater().
even if the user creates a new before that was really destroyed
the use of components that were created dynamically in QML I am always using. destroy() to remove
in the most recent samples I noticed that instead of destroy() now deleteLater() was used in QML
What is recommended?
and deleteLater() in QML as safe as used from C++?
If it works well?
pseudocode NavigationPane property Page myPage pushing the Page: myPage = ...created by Component... push myPage coming back: onPopTransitionEnded() myPage.deleteLater
.. If the user hits just the Action of pushing the new Page before destroyed
It works the same from C++ (explained by ZMey)?
No matter what happens to the property of myPage after the call to deleteLater won't change that past to the object of this deleteLater was called. It will be deleted again. Actually, a safe bet is to value null edit after the call to deleteLater so that you can not access it again. It doesn't matter if the 1st page was deleted after the creation of page 2. The object real edit pointed to before you change the value of the myPage property is not affected.
A note on signals:
DirectConnections have the behavior described above, but if this isn't what you want, you can use a QueuedConnection. See http://qt-project.org/doc/qt-4.8/qt.html#ConnectionType-enum for more details on this.
-
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" } ] }
Maybe you are looking for
-
I recently bought an iphone 6s and I'm having a hard time activating my number imessage FaceTime. I migrated to an iphone 6 and where everything worked like a charm to a nightmare without end I tried all support apple suggests more change my sim card
-
Missing features of touchpad on y laptop Pro broadcast
Hi all First, I lost the button scrolling, vertical & horizontal grey carrier out trying, check them. I then downloaded the current driver. Tried FN - 9/7, nothing has workedThen I returned to the previous driver and who lost me synaptic buffer setti
-
How can I fix the change of office function after Trojan attack
I was attacked by a Trojan horse through adobe pop up and I cannot change my desktop screen since. It happens with change Office disabled see administrator. I'm the administrator of this computer. Aero noticed the error but counld't fix. Please notif
-
Customize the desktop photos does not properly
As of yesterday, something happened to the image on my desktop. The image fills the screen, but there is a vertical line down the right third of the image. The color to the right of the vertical line is low. When I click on customize desktop, that I
-
How will I know my product key?
How will I know my product key? I'm on windows7 and I have no DVD or CD with laptop. There is no return to the top. I don't have it in my laptop. can someone help me please? Thank you Nefaul Hossain