ListView Access of ListItemComponent context action onTriggered model
Consider following piece of code:
ListView { id: listView dataModel: model listItemComponents: ListItemComponent { content: StandardListItem { title: ListItemData.name contextActions: ActionSet { actions: ActionItem { title: "Delete" onTriggered: { //ListItem.view.model .... doesn't work } } } } } } }
When the user chooses to delete a line, I would like to access the listview model and remove the line given. But I can't get my hands on the model (as it is now defined as attached property).
Docs say:
ListItem.view - The ListView in which this item is visible. The item is in a context separate from the ListView, so any symbols from the ListView context that are to be accessible from items must be placed as dynamic properties on the ListView
But to be honest I don't understand what I need to do to make it work (ie. have access to the parent listView.
Any help would be greatly appreciated.
Oh, I would do this without falling back into C++ code. I know how to solve this problem with c ++.
Thank you
You must reference it in your ListItemComponent ListItem:
myItem.ListItem.view.dataModel
Tags: BlackBerry Developers
Similar Questions
-
What is the difference between Action Cam model HDR-AS10A and HDR-AS10B
What is the difference between Action Cam model HDR-AS10A andB of the HDR-AS10
Hello
Welcome to the community of Sony.There is no Action Cam with HDR-AS10A model number available in the United States. Only the AS10-HDR and HDR-AS10/B are available. The only difference between the two is that the 'B' in the HDR-AS10/B model number matches the color of the camcorder, which is black.
Thank you for your message.
-
I downloaded and install a copy of assessment of RC of windows 7 build 7100 and use the key to legitimate windows 7 RC to activate and he succeeded.
After a few days, my pc hangs and after reset, he began asking to activate windows now. Although pressing ok product error '0x80070005' (I am using the administrator account). Even using the command "slmgr.vbs" does not display ' error: 0 x 80070005 access denied: the requested action requires elevated privileges. "
Please help and thank you.
Your question has nothing to do with Windows Update (compared to the upgrade of Windows). Please repost your question here rather: http://social.answers.microsoft.com/Forums/en-US/w7install/threads ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft
-
Not able to access the ListItemComponent property
Hello
I've created a property of type "string" in a page qml as follows
import bb.cascades 1.0 import bb.data 1.0 import com.du.data 1.0 import du.image.slider 1.0 Page { id: homeListPage property string imagePath ........ }
IAM having a ListView in the same page qml. IAM trying to set this property as the text of a label which is a listItemComponent.
My problem is:
When Iam trying to put the text of the label (the label is a ListItemComponent) with the property and then an error pops up:
ReferenceError: Can't find variable: imagePath
It's my qml file
import bb.cascades 1.0 import bb.data 1.0 import com.du.data 1.0 import du.image.slider 1.0 Page { id: homeListPage property string imagePath Container { ListView { preferredHeight: 4 * 350 id: homeList objectName: "homeList" layout: GridListLayout { columnCount: 2 cellAspectRatio: 1.0 horizontalCellSpacing: 12 verticalCellSpacing: 12 } dataModel: homeDataModel listItemComponents: [ ListItemComponent { id: myComponent type: "item" Container { id: homeListItemContainer layout: AbsoluteLayout {} ImageButton { defaultImageSource:listItemData.imagePath } //imageview Container { layout: AbsoluteLayout { } Label { id:lab1 text: imagePath //here Iam using the proprty imagePath } } //container } //container } //list component ] // listItemComponents } //list view
Please please help me solve this problem
ListItemComponents have different context, but it is possible to access outside properties indirectly via the id of the top-level ListItemComponent element. Please see the updated code, I have marked the changes with //---UPD---
import bb.cascades 1.0 import bb.data 1.0 import com.du.data 1.0 import du.image.slider 1.0 Page { id: homeListPage property string imagePath Container { ListView { //----------UPD---------- function getImagePath() { return imagePath } //----------UPD---------- preferredHeight: 4 * 350 id: homeList objectName: "homeList" layout: GridListLayout { columnCount: 2 cellAspectRatio: 1.0 horizontalCellSpacing: 12 verticalCellSpacing: 12 } dataModel: homeDataModel listItemComponents: [ ListItemComponent { id: myComponent type: "item" Container { id: homeListItemContainer layout: AbsoluteLayout {} ImageButton { defaultImageSource:listItemData.imagePath } //imageview Container { layout: AbsoluteLayout { } Label { id:lab1 //----------UPD---------- text: homeListItemContainer.ListItem.view.getImagePath() //----------UPD---------- } } //container } //container } //list component ] // listItemComponents } //list view
-
Explorer.exe crashes when access to the context menu of any file character 1 long
I use Windows XP SP3 and Explorer keeps if crush when I access the contextual (right click menu) not any folder that is one character long (a - z, 0-9). For example, the folder labeled a will fail if it contains files or subfolders, if there in any directory, if it is on another drive, on the context menu. In addition, in order to exclude any invalid context record, I have disabled all non-Microsoft tool ShellMenuView context menus. I also tried to run Fixit 50043. I also did a scan antivirus with norton antivirus. Found nothing, no improvement. It is 100% compatible. BTW, I have already run System File Checker, and asides from this problem my system is perfect. Everyone knows about this problem? Any ideas on how to fix this problem without having to re - install XP?
This applies only when the folder is labeled 1 character. I don't know how the visual c ++ runtimes into play with explorer.exe in the context menu. Re-don't install C++ runtimes for 2005, 2008, 2010 shows no improvement and install it with success.I get an error in visual c ++ runtime library.Nevermind, pretty sure winmount was the culprit. Somehow, he escaped ShellMenuView, I disable the integration of shell of in the program and the turn is played.
-
Access to the context using the keyboard rather than the mouse menu?
I'm back using Windows (7) to my new job after using the iOS for 15 years.
Now I find I want to use the keyboard to do many things that you can do with the mouse on iOS.
The "Accelerator" keys are very practical. So - if I type, then - then I activate the command paste in Word, for example.
Access keys are also available via a context menu. However, the only way to access the context menu - I can find - is a right click with the mouse.
So now I'm back using the mouse AND keyboard, which sort of defeats the purpose.I find no way to pop open a context menu by using the keyboard. Any ideas?
Unfortunately, if it is not a "integrated" way, it won't help, because I can't make any changes by programming to my computer either. It's very tight here :(
Thanks for any help.
A quick search on Google reveals that it is the key to use - if your keyboard has it:
-
Updating of the access points in the environment, the models?
I'm going slow in the environment by replacing the access points 80 AIR-1252. I decided to replace our 1142 s at the same time so that the environment is up to date. I was curious what the replacement recommended for these access points. I see Cisco recommends the 1262 in lieu of the 1252.
I work for an oil and gas company with locations across the country. We use two 5508 s with Flex Connect runs the last code 7.3 7.4 into account in the next 6 months. Our sites are a mixture of office space with warehouse or other environments difficult. I think 2602 s to replace the 1142 s and 1252 s mounted in offices, and I'm leading 1242 s to replace the 1252 s mounted in our warehouse/truck Bay environments.
Well the 1262 did replace the 1252, but then Cisco came out with the 3502e and the 3602e. Then maybe you should look at is using the 2602i in the office areas and maybe the 2602e in the area rugged or even look at the 3502e/3602e. This way, you have all the AP that can sustain CleanAir.
Thank you
Scott
Help others by using the rating system and marking answers questions as 'response '.
-
Can not access the context property of the Interior of the ListView checkbox - onCheckedChange event
I have a context property called "app" that connects to my C++ application. My listview has a box with onCheckedChange event listener. In this method, when I make a call to the C++ side. application app.runAction, the system displays not found error app.
If I move the box outside the list view, it will correctly trigger app.runAction.
Can you please take a look? Thank you!
On the side of C++ on how I set the context property.
QmlDocument * qml = QmlDocument::create("asset:///main.qml").parent(this);
If (qml-> {hasErrors())}
Returns false;
}QML-> setContextProperty ("app", this);
navigationPane = qml-> createRootObject
();
If (! navigationPane) {}
Returns false;
}QML side
NavigationPane {}
ID: nav{Page}
ID: mainPage
{Of container{To ListView
listItemComponents:]
{ListItemComponent}
type: 'point '.
{Of containerCheckbox {}
Determine whether the check box should be checked
According to a value in the data model
checked: ListItemData.checked
onCheckedChanged: {}
app.testAction ();
}
}This is a scope issue... I really hope the devs find a way to fix it properly apart from this ugly solution:
You can solve this problem by setting your app variable in the global object Qt
NavigationPane { id: nav onCreationCompleted: Qt.app = app Page { id: mainPage Container { ListView { listItemComponents: [ ListItemComponent { type: "item" Container { CheckBox { // Determine whether the CheckBox should be checked // according to a value in the data model checked: ListItemData.checked onCheckedChanged: { app.testAction(); Qt.app.testAction(); } }
all code in a ListItemComponent will suffer from this 'framing' question
-
HOWTO: Use the contextual action with ListView in C++
Hello
I need your advice and the best way to manage the user in the context menu action, linked to a ListItem (or the MultiSelectActionItem)
My skeleton of ListView is defined in QML. In C++, I create and fill in ListView. ListView can be instancied multiple times (each with its own data model). So for each ListView, I get the same action of context.
Now, how to manage the action trigger signal. Sample for ListItem delete action, I can not connect a slot to the signal of ListItem. Otherwise, I have to do for each ListItem! I think that this is not the right way.
I looked at the bucket sample. Stocks are managed directly by the datamodel.
The second point is that the action item process is long and regular through the event of Qt. loop (and of course the content list may change before the end of the process).
Another solution could be: QML send a signal custom ListView object (and not the ListItem).
Nicolas
I see what you mean about Battambang: there are a series of action applied to each element.
In many cases, it may be wiser to join acts to list. I suggest something along these lines:
Addition of stampcollector main.qml in the ListView after the ListItemComponents:
contextActions: [ ActionSet { ActionItem { objectName: "ooglyAction" title: "oogly" } ActionItem { objectName: "booglyAction" title: "boogly" } DeleteActionItem { objectName: "deleteAction" title: "Delete" } } ]
In stampcollectorapp.cpp:
(a) in the constructor:
ActionItem* action = nav->findChild
("ooglyAction"); if (action) connect(action, SIGNAL(triggered()), this, SLOT(onListActionOogly())); action = nav->findChild ("booglyAction"); if (action) connect(action, SIGNAL(triggered()), this, SLOT(onListActionBoogly())); DeleteActionItem* daction = nav->findChild ("deleteAction"); if (daction) connect(daction, SIGNAL(triggered()), this, SLOT(onListActionDelete())); (although you can use the same signal for all the actions non - handler remove if you want to turn on the text of action in Manager)
(b) methods as:
void StampCollectorApp::onListActionOogly() { qDebug() << "Here I am: oogly!"; qDebug() << sender(); } void StampCollectorApp::onListActionBoogly() { qDebug() << "Here I am: Boogly!"; qDebug() << sender(); } void StampCollectorApp::onListActionDelete() { qDebug() << "Here I am: Delete!"; qDebug() << sender(); DeleteActionItem* action = dynamic_cast
(sender()); if (action == 0) { qDebug() << "Not expected type"; return; } qDebug() << "Yes, found!"; QObject* parent = action->parent(); // get ActionSet if (parent != 0) parent = parent->parent(); if (parent == 0) { qDebug() << "No parent!"; return; } const QMetaObject* m = parent->metaObject(); if (m == 0) { qDebug() << "No metaobject!"; } qDebug() << m->className(); } In other words, use sender()
Stuart
-
Created in the ListView lost when C++ ListItem custome context reference
Hi all
I have a listview that generates a list of the custome listviewItems (ie the containers). Containers have a setContextProperty to my database object. But when they are added to the list view, I can't access the database context property. I realize that the listview is not in the same context as the page but I don't understand why when I bind context for the real item the reference he lost?
Error: asset:///WorkoutListItem.qml:17: ReferenceError: can't find variable: _Dal
List.QML
Page { Container { ListView { id: workoutList horizontalAlignment: HorizontalAlignment.Fill dataModel: _Dal.ListofWorkouts listItemComponents: [ ListItemComponent { type: "item" WorkoutListItem { workoutId: ListItemData.id workoutName: ListItemData.name } } ] }//End List }//End root }//EndPage
WorkoutListItem.qml
Container { id:root property int workoutId: -1 property variant workoutName: "" layout: StackLayout { orientation: LayoutOrientation.LeftToRight } Button { id: workoutDelete text: "Delete" onClicked: { var result = _Dal.DeleteWorkout(root.workoutId) } } Label { id: workoutNumberLabel text: root.workoutId } Label { id: workoutNameLabel text: root.workoutName } Button { id: workoutEdit text: "Edit" onClicked: { //TODO: Open workout page } }}
application.cpp
QmlDocument *WorkoutListItem = QmlDocument::create("asset:///WorkoutListItem.qml").parent(this); WorkoutListItem->setContextProperty("_Dal", dal);
Thanks in advance for any help
-J
itemRoot.ListItem.view.yourFunction(ListItemData)
yourFunction (data) is defined in the ListView itself
from there, you have access to your context
-
Two different palpable area in a ListItemComponent in a ListView
Hi all
Here's my problem:
I have my ListView with my ListItemComponent including the two cities, and I would like to be able to open another page, if I click in one place or the other.
Unfortunately onTriggered is available for all the ListItemComponent.
Someone has an idea?
Thank you.
Your element needs to list an ID, so to access something from the list view, that you should do something like that (obviously the syntax isn't everything is correct, but you get the idea)
{To ListView
{ListItemComponent}
{Of container
ID: testitem
{Label
onTouch {testItem.ListItem.view.pushPage1 (ListItemData)
}
}
function pushPage1 (data) {}
dowhatever
}
}
-
How to access the properties of the ListItemComponent Page in QML
Hello
I'm new to BB10 development. I need help for the problem mentioned (in red) below
{Page}
ID: page
property storage storage / / this is a C++ class that is registered for access from pages QML
{Of container
{To ListView
listItemComponents: {ListItemComponent}
{CustomListItem}
ImageButton {}
text: "Save."
onClicked: {}
Storage.Save)
I am not able to get the reference of the storage property defined in the Page. It is always [NULL], I get the mention very well outside the ListView
}}}}}}
PS: I only provided the necessary code
I found the solution
added CustomListItem id as
ID: customCell
now
customCell.ListView.view.parent.parent.storage
-
ADF access binding context in Servlet
Hello. I'm trying to use a Servlet to present some XML in a framework that is inserted on the JSF page. The inlineFrame takes its Source from the URL of the servlet. I use JDeveloper 11.1.2.1.0.
The XML is stored on the database, so I will try to get it back in the Servlet (based on a parameter value). However, I get a Null pointer Exception in the Servlet because nothing is returned in the BindingContext - no containers or controls data.
I looked at different blogs, messages etc. which suggest methods to do so. So far, I have:
-set up the Servlet in the web.xml file, as follows:
-the Servlet is also added to the DataBindings.cpx file as follows:<servlet> <servlet-name>ShowXMLServlet</servlet-name> <servlet-class>view.ShowXMLServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>ShowXMLServlet</servlet-name> <url-pattern>/showxmlservlet</url-pattern> </servlet-mapping> <filter> <filter-name>adfBindings</filter-name> <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class> </filter> <filter-mapping> <filter-name>adfBindings</filter-name> <servlet-name>ShowXMLServlet</servlet-name> <dispatcher>FORWARD</dispatcher> <dispatcher>REQUEST</dispatcher> </filter-mapping>
- and of course, I created the dummy PageDef (view_dummyPageDef1.xml), which currently has a single binding.<pageMap> <page path="/showxmlservlet" usageId="view_view_dummyPageDef1" /> <page path="/view_dummy.jsf" usageId="view_view_dummyPageDef1"/> </pageMap> <pageDefinitionUsages> <page id="view_view_dummyPageDef1" path="view.pageDefs.view_dummyPageDef1"/> </pageDefinitionUsages>
-C' is the extract of Servlet code that attempts to access the binding context. This causes Null pointer exception, but the dcBindingContainer is null.
I tried also access to liaison with reference to the active DataControlFrame at the point the Servlet is called and stored in a session variable. But this was not either - same result.BindingContext bindingContext=null; bindingContext = BindingContext.getCurrent(); DCBindingContainer dcBindingContainer = bindingContext.findBindingContainer("view_dummyPageDef1");
I missed a simple step here? Thanks for your help.I'm not in front of my vo to check your code, but you can check out my blog on the file and image manipulation. Part 3 (http://wp.me/pcBZk-bU) had a sample servlet access to the link.
Timo
-
Definition of user access to the specific context.
Hi experts,
I have a requitement
We have some limitations for the user to access specific scenarios. But what is happening is that these users can able to run scenarios in any CONTEXT.
If we want to restirict the user to access a specific context, how can we do?
Please advice...
concerned,
KHi K,
Adding a few more points to the previous answer,
user10439173 correct me if I'm wrong... :)
1 duplicate the CONNECTION profile provided with ODI (Sunopsis) and rename the copy as MY NG CONNECT.
2. in the new MY NG CONNECT profile, for the purpose of 'Context', on the ' * view * ""Definition"of the method tab, uncheck"class Privilege ".
3. assign the new profile MY NG CONNECT to targeted users ODI (Sunopsis).
4 create/update the user with this profile. Finally, drag & drop on each user name, the contexts to which access must be allowed (since the topology Manager).Thank you
G -
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(); }
Maybe you are looking for
-
iDVD on the part of an external DVD burner
The optical drive on my mac mini 2009 died. I need to burn a project to a DVD. I have attached an external DVD burner for mac. I play DVD. How to record from iDVD please?
-
System of TimeShifting and not automatic sync
Hello together, as I updated my MBP late 2008 for OS X 10.11 sometimes my system date and spend several days and hours. The time is not corrected by the time of synchronization automatically until I have shut down and restart the synchronization time
-
Activation &; deactivation display view
Hello I would like to integrate some text objects in my reports and I was wondering if there is a method to the devil the border around the object. I use DIAdem 2015 32 bit Thank you
-
Computer in a loop of continuous reboot after Windows update
Original title: serious windows update conflicts with the software driver reinstallation I just did a clean reinstall of windows family basic on my dell vostro 1400 using the reinstallation cd (I don't have the driver cd). Later, I was able to insta
-
HARD drive dead, retrieve files from external hard drive
Hi all, my HARD drive is dead, I installed a new. I have a complete copy of my system to an external drive, including my o/s, it was created using Vista upward.I cannot now access these files or the o/s.How can I use to load all my data on my new HAR