Action on multiple selection ListView onTriggered
Hi, I have a listview with multiSelectHandler impleted and so can select multiple items.
I'm having a problem on how to perform the action on these several items though.
Documentation, http://developer.blackberry.com/cascades/documentation/ui/lists/list_view_selection.html, does not show how to perform the action when several items to the listview are selected.
Does anyone know how to make measurements on multiple items? i.e. remove it from the list, get the text of each article, changes to the user interface, etc.
Hello
Have you seen Battambang sample? I remember well, it can perform operations on several list items:
https://github.com/BlackBerry/Cascades-samples/tree/master/bucketlist
Tags: BlackBerry Developers
Similar Questions
-
Can't get multiple selections of work ListView
The example code here seems very simple:
https://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__multiselecthandler.html
I use the code example to use with ListView as my model:
ListView { id: listView objectName: "listView" dataModel: photosModel.photoGridModel snapMode: SnapMode.LeadingEdge layout: GridListLayout { id: gridListLayout objectName: "gridListLayout" } onTriggered: { var newPage = photosPageDefinition.createObject(); photosModel.setPage(newPage); navigationPane.push(newPage); navigationPane.peekEnabled = false; photosModel.launchFullscreen(indexPath); } multiSelectAction: MultiSelectActionItem {} multiSelectHandler { // These actions will be shown during multiple selection, while this // multiSelectHandler is active actions: [ ActionItem { title: "Tag" imageSource: "asset:///images/tag.png" onTriggered: { // TODO } }, ActionItem { title: "Share" imageSource: "asset:///images/share.png" onTriggered: { // TODO } }, ActionItem { title: "Move" imageSource: "asset:///images/folder.png" onTriggered: { // TODO } }, DeleteActionItem { } ] status: "None selected" onActiveChanged: { if (active == true) { console.log("Multiple selection is activated"); } else { console.log("Multiple selection is deactivated"); } } onCanceled: { console.log("Multi selection canceled!"); } } }
When loading the application, I long press on an item in the GridView control and nothing happens.
Can you clarify what this means 'does not '?.
EDIT:
OK, now I see. To make it work, you must set an empty or nonempty ActionSet for each listitem.
StandardListItem { title: ListItemData.title contextActions: [ ActionSet { } ] }
Now, it will work.
-
Problem Manager multiple selection with system dialog box
I currently have a problem with the help of system on a manager of multiple selection dialog as the code below works fine:
multiSelectHandler { status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged actions: [ DeleteActionItem { id: deleteActionItem onTriggered: { var selectionList = listView1.selectionList(); var selectedItem = dataModel.data(selectionList); console.log(selectedItem); for (var i = 0; i < selectionList.length; ++ i) { _sql.deleteClient(dataModel.data(selectionList[i]).clientID) dataSource.loadData() } } } ] }
However, when it is changed to use that a dialogue system, the feature does not work and the console record results:
selected list: undefined
selected item: undefined
multiSelectHandler { status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged actions: [ DeleteActionItem { id: deleteActionItem onTriggered: { multiSelectDeleteDialog.show() } attachedObjects: [ SystemDialog { id: multiSelectDeleteDialog title: qsTr("Delete Clients") + Retranslate.onLocaleOrLanguageChanged body: qsTr("Are you sure you want to delete these clients?") + Retranslate.onLocaleOrLanguageChanged onFinished: { if (result == 3) { console.log("Cancelled") } else { console.log("Deleted") var selectionList = listView1.selectionList() console.log("selected list: " + selectionList) var selectedItem = dataModel.data(selectionList); console.log("selected item: " + selectedItem); for (var i = 0; i < selectionList.length; ++ i) { _sql.deleteClient(dataModel.data(selectionList[i]).clientID) dataSource.loadData() } } } } ] } ] }
With the help of Roger Leblanc, it works now
multiSelectHandler { status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged actions: [ DeleteActionItem { property variant selectionList property variant selectedItem id: deleteActionItem onTriggered: { deleteActionItem.selectionList = listView1.selectionList() deleteActionItem.selectedItem = dataModel.data(selectionList); multiSelectDeleteDialog.show() } attachedObjects: [ SystemDialog { id: multiSelectDeleteDialog title: qsTr("Delete Clients") + Retranslate.onLocaleOrLanguageChanged body: qsTr("Are you sure you want to delete these clients?") + Retranslate.onLocaleOrLanguageChanged onFinished: { if (result == 3) { console.log("Cancelled") } else { console.log("Deleted") for (var i = 0; i < deleteActionItem.selectionList.length; ++ i) { _sql.deleteClient(dataModel.data(deleteActionItem.selectionList[i]).clientID) dataSource.loadData() } } } } ] } ] }
-
ListView onTriggered event to push a new page
Currently, I started to learn and develop applications for bb10. I saw troubled when wants to push a new page when click the item in the listview.
ListView { dataModel: XmlDataModel { source: "model.xml" } listItemComponents: [ ListItemComponent { type: "listItem" StandardListItem { title: ListItemData.title description: ListItemData.subtitle status: ListItemData.status } } ] onTriggered: { var new_page = nextpage.createObject(); navigationPane.push(new_page); } attachedObjects: [ ComponentDefinition { id: nextpage source: "newqml.qml" } ] }
The code that I use, I expect to get to the newqml.qml, then click on any point on the listview however is not doing. How can I change the code to obtain the result.
and if I want it open different page each item in listview how does?
Thanks in advance.
Hello
I'm new on this, but I have a tip that could help: create a new project, select stunts, then on the models page, select ListView.
This will automatically create a default list that automatically connects your article to an ItemPage.qml of a second!
-
dynamic action on the selected value shuttle
Hello
Can anyone help me in this.
I guess a requirement
There is a shuttle Apex and multiple selection is allowed
and there are values such as:-others, first, second
but when we choose other no other value should be able to select
in what other is selected in the shuttle a textbox is displayed by dynamic action
example on https://apex.oracle.com/pls/apex/f?p=76604:3:4326822625865:
workspace:-REEMATEST
username:-test
password:-test
76604 application
page 3
ReemaPuri wrote:
can you give me a link for the dynamic creation of checkbox
FOR EXAMPLE BASED ON CREATED LOV SHARE COMPONENT
Select the column name as the name of column d, r
the name of the table
Boxes are just another way to make a LOV. For a dynamic set of checkboxes, the standard pair of value/label LOV SQL projection is required in the definition:
select initcap(dname) l, to_char(deptno, 'tm9') v from dept order by v asc
If additional values are required, they can be included in the query using unions:
select initcap(dname) l, to_char(deptno, 'tm9') v from dept union all select 'Other', 'OTHER' from dual order by 2 asc
Checkbox events can be handled by dynamic actions as indicated on page 586 of your test App. Note that I prefer to enable and disable the controls on form rather than hiding and showing them that there is less confusion for the user. It is simple to change the disable/Enable dynamic actions to hide and show if necessary.
-
Multiple selection with binding variable error
Hello world
I tried to put in place an array of adf multiple selection with another table, by following the tutorial (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/75-multi-parent-row-detail-views-328078.pdf), page 3.
I created all things and first of all I had an exception error, which I fixed, but now, whenever I try to select multiple lines, it won't update the table of the adf.
In this example, I choose a service line and it shows the emplooyes, but every time I try to choose another line by ctrl clicking on it, the employees table be updated.
Since I tryied to follow the tutorial, I'll put the code for the bean, I created for this purpose (it's a little different than the code given by the tutorial, but only because I had to get rid of the exception error)
I use jdeveloper Studio Edition Version 12.1.2.0.0.
Here is my code for the bean.java:
Select listen port defined for the departments table. The selected line keys are read in the reference table.
For each line, the Department ID value is read and added to a string buffer that generates a comma-delimited
List of the departmentIds. In the end, this string is passed as an argument to the link of action ExecuteWithParams
{} public void onDepartmentTableSelect (SelectionEvent selectionEvent)
variable to hold the string containing the selected set value line departmentId
StringBuffer departmentIds = new StringBuffer();
Go to the main table to read selected line keys
RicheTableau rt = selectionEvent.getSource ((richeTableau));
RKS RowKeySet = rt.getSelectedRowKeys ();
Iterator selectedRowsIterator = rks.iterator ();
memorize the current line to place it back in the end key
CurrentRowKey () rt.getRowKey = (list);
for each selected master line, determine the departmentId
int size = 0;
{while (selectedRowsIterator.hasNext ())}
size ++;
The rowKey () selectedRowsIterator.next = (list);
each value is terminated by a comma
If (departmentIds.length () > 0) {}
departmentIds.append(",");
}
take the current line
rt.setRowKey (rowKey);
JUCtrlHierNodeBinding wrappedRow = rt.getRowData ((JUCtrlHierNodeBinding));
Line rw = wrappedRow.getRow ();
/*
Number departmentId = (number) rw.getAttribute ("DepartmentId");
*/
int departmentIdInt = rw.getAttribute ("DepartmentId") (Integer);
oracle.jbo.domain.Number departmentId = new oracle.jbo.domain.Number (departmentIdInt);
departmentIds.append (departmentId.stringValue ());
}
back the foreign currency on the line
rt.setRowKey (currentRowKey);
Run the query on the detail table
BindingContext bctx = BindingContext.getCurrent ();
BindingContainer links = bctx.getCurrentBindingsEntry ();
OperationBinding executeWithParams = bindings.getOperationBinding("ExecuteWithParams");
executeWithParams.getParamsMap () .put ("departmentIds", departmentIds.toString ());
executeWithParams.execute ();
refresh the detail table
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance ();
adfFacesContext.addPartialTarget (employeeTable);
}
}
If someone has an idea of why it isn't updated table, please answer. Any idea can help.
Thanks in advance.
Greetings,
Frederico Barracha.
Finally, I found the problem...
The problem was that I had to remove a line in the properties of my table, the property services: selectedrowkeys, because he only spent the last selected row.
Yet, I apreciate the help and I had to replace a code in the bean.java, in reason of the exception error and you had to do. Maybe I did a configuration in the wrong way and he would not.
Thanks for the help.
Kind regards
Frederico.
-
Model of multiple selection for ComboBox
Javadoc stats
"As in the ListView, it is possible to change the SelectionModel which is used, although this is likely to be rarely changed. The default SelectionModel used in ComboBox is a SingleSelectionModel, but that can be sorted on by developers to instead allow multiple selection occur, or to change the behavior of the various methods provided in these APIs. "
Yet when I try to set the selection model as I would to a listview using the following
I am informed that setSelectionModel is not available.comboBox.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
How to enable you multiple selection in a ComboBox?The javadoc you cite above is in fact wrong and comes from an era where the selectionModel property of type «SelectionModel» ComboBox Since then, it has evolved to be "SingleSelectionModel. Which means, of course, you can put some instance of model selection in the ComboBox, but only choice will be always supported. We did it as multiple selection has no real meaning without drastic changes to the UI and UX, and we thought that a separate control could be developed in the future to better support this use case.
Thanks to notice the incorrect documentation - I'll fix it shortly.
-Jonathan
-
Help with POST data if multiple selections are chosen
I created a form with a menu (list) which includes all 50 States. I used the MESSAGE option, as well as PHP, to treat form data, which will be sent to me. The list menu looks like this: http://askdave.info/help/states_menu.gif and I have "Allow multiple selections" checked in the property inspector.
If the user chooses several States, I want EACH of these States to be included in the email that I receive. Right now, if I check several States, I get only the latest state selected. For example, here is the email that I get after I check 5 different States. http://askdave.info/help/FormData.gif
Problem-> in this email, only one State is indicated (Hawaii), even if I selected 5 different States. How can I get the data from the form to list all THE States that are checked?
Here's what I have:
< form name = "form1" method = "post" action = "process.php" >
< input type = "hidden" name = "required" value = "name, phone, email, States, capital" / >
And then for the menu that lists the States, I have:
< label >
< select name = 'States' size = '7' several id = 'States' >
all States < option > < / option >
Alabama < option > < / option >
Alaska < option > < / option >
Arizona < option > < / option >
Arkansas < option > < / option >
and so on...
What Miss me? How can I get the PHP script to send multiple values, if multiple values are selected? (I'm new to PHP, so go easy on me.) I can post my code, if necessary.) Is this a PHP problem, or do I have to add something to the HTML form?Hello
>>
I think that DynaForm is synonymous with dynamic form
>>This makes some sense ;-) I was wondering just because there is a pre-made script called DynaForm here, but it has a different 'Logistics' than yours.
However, both "DynaForm" versions are pretty basic, because they deal only with non-multiple values - fields as a single line, texareas and select´s non-multiple of form input fields. Your script for example just loops through all the existing form fields using the method "foreach":
Out of form fields and values.
foreach ($this-> post as $field-online $value) {/ / loop through all form fields}
If ($field == "required") continue;
$this-> _addLine ($field, $value); Here´s where the field´s name/value consolidation happens
}.. .and simply includes a 'value' with his 'name' associated field´s. The problem is: this method works, simply to have only 1 value - but any 'multiple value' form fields (for example your 'States' select or check box groups who spend several values as well) require a separate "foreach" in the script treatment, fields and this hasn´t been incorporated here.
That said, I would suggest using another solution pre-made as PHP Form Mail script that s capable of managing your multiple values - scenario naturally.
-
Settlement data based on multiple selection ListBox reference need help
Hello again,
The question that I have is selecting from a listbox with multiple selection to fill the tables with the selected data. My code is as follows:
Void loadData_EventClick (ByRef This)
Dim j
Dim k
k = 0
If ListBox.MultiSelection.Count = 0 Then Exit Sub
For j = 1 To ListBox.Items.Count
If ListBox.MultiSelection (j). Count = True Then
k = k + 1
End If
Next
TextBox.Text = k
End Sub
The code works perfectly up to the second if statement. My current channel group list contains 16 channels and with the second if statement guided the textbox output is equal to 16 (i.e. k = 16), which is what I expected. Im just using the k = k + 1 for the test. Eventually will be replaced by operating code specific to what I need to do.
So the question that I have is to get the code to recognize what values are selected and referring to the index for the selections in a table. Im not sure on how to do it.
Any help is very appreciated.
Thank you
~ Nathan
Attached JPEG shows the current user interface and the output of k with the second if statement commented
Hey Nathan--
ListBox.MultiSelection () is a function that returns an array of [multiple] selected items in ListBox.
ListBox.MultiSelection.Count is a property that returns the number of items in the table above.
Therefore, the logic in your second IF statement that says if ListBox.MultiSelection (j). Count = True really makes no sense because:
- The array returned by the multiple selection (using (j) indexing now refers to a single selected item in the list (which has not its own 'Count' property)
- If you don't the array index, assuming that you had selected 4 items in your list, your statement would still be actually as said if 4 = True which is not what you get.
Make sense?
Here is a modified version of your code that I hope makes it a little more obvious how these elements relate to one another. Give it a run; of course, 75% of the code is extranneous to you working end to account, so make sure that you subsequently delete what you won't need.
Sub loadData_EventClick (ByRef This) ' creates the event handler
Dim j
If ListBox.MultiSelection.Count = 0 Then Exit Sub
TextBox.Text = "Total ListBox items:" & ListBox.Items.Count & + "" \n "".
TextBox.Text = TextBox.Text & "Total selected items:" & ListBox.MultiSelection.Count & + "" \n "".
TextBox.Text = TextBox.Text & "Selected Items:" & + "\n"
For j = 1 to ListBox.MultiSelection.Count
TextBox.Text is TextBox.Text & ListBox.MultiSelection (j). Text & ", index" & ListBox.MultiSelection (j). Index & + "\n"
Next
End SubYou are making great progress; It will get quickly easily faster and we are here to help – do not hesitate.
-
Multiple selection in string tree
I make a tree with line 15, I set the selection to 1 or more. now, I want to make a multiple selection of tree to appear in control of the chain, how can I do this?
Thank you
Use the Value property:
The order in "response" will be the order that items have been selected.
-
How can I do a multiple selection in Enum control or control of the ring or control Combo box
How can I do a multiple selection in Enum control or control of the ring or control Combo box
You can not.
You can use a listbox control.
An alternative solution is to write the code and each selection, the user gives an enum, for example, can be send to a table and invite the user to continue to select...
-
How to get the content of the list item selected ListView using CPP?
Hello
I do a simple application, get the content of the list item selected ListView using CPP, in the main.qml file, I created a listview using XMLDataModel and I got the selected listview using dataModel.data (row) .attributeNameInXmlfile in qml. content as in the same way the ListView using cpp.please help me I want to get the content of the listitem selected.
Here is my code
hand. QML
import bb.cascades 1.0 Page { content: Container { id: mainContainer objectName: "container" // property alias selectedText: selectedTextField.text //property alias deselectedText: deselectedTextField.text ListView { objectName: "listView" dataModel: XmlDataModel { source: "models/items.xml" id: model } listItemComponents: [ ListItemComponent { type: "item" StandardListItem { title: ListItemData.title } } ] } TextField { id: selectedTextField objectName: "selectedTextField" text: "" } TextField { id: deselectedTextField objectName: "deselectedTextField" text: "" } } }
App.cpp
#include "app.hpp" #include
#include #include #include #include #include using namespace std; using namespace bb::cascades; QObject *textFieldSelected ; QObject *textFieldNotSelected; QObject *list; App::App() { QmlDocument *qml = QmlDocument::create("main.qml"); AbstractPane *root = qml->createRootNode (); list = root->findChild ("listView"); textFieldNotSelected = root->findChild ("deselectedTextField"); textFieldSelected = root->findChild ("selectedTextField"); QObject::connect(list,SIGNAL(selectionChanged (QVariantList, bool)),this,SLOT(changeText(QVariantList, bool))); Application::setScene(root); } void App::changeText(QVariantList indexPath,bool selected) { } App.HPP
#ifndef APP_H #define APP_H #include
#include #include /*! * @brief Application GUI object */ class App : public QObject { Q_OBJECT public: App(); public slots: void changeText(QVariantList ,bool ); }; #endif // ifndef APP_H Try this.
void App::changeText(QVariantList indexPath,bool selected) { XmlDataModel *model = (XmlDataModel *)list->dataModel(); QVariantMap map = model->data(indexPath).toMap(); // map is your data in QVariant qDebug() << map["title"].toString(); }
-
Need to field multiple select the option without having previously selected deleted
Hi all
Request Express 4.1.1.00.23
Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
I have a requirement of adding a field of multiple selection to a single screen, and I added the list to multiple selection, without a second thought. Of course, the question is when a user tries to edit a record, click on (with the CTRL key) two options in the selection list multiple, but not clicked on those previously selected, then we lost them. Then I thought to create checkboxes and thus those already selected will be always checked when try to update.
But I want to do with the multiple selection field. So I was wondering if there is a way?
Thank you!
Sam82 wrote:
Request Express 4.1.1.00.23
Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
I have a requirement of adding a field of multiple selection to a single screen, and I added the list to multiple selection, without a second thought. Of course, the question is when a user tries to edit a record, click on (with the CTRL key) two options in the selection list multiple, but not clicked on those previously selected, then we lost them. Then I thought to create checkboxes and thus those already selected will be always checked when try to update.
But I want to do with the multiple selection field. So I was wondering if there is a way?
This is the behavior expected multiple-selection list. It can be changed using a point hidden shadow and JavaScript, but there is no way out of the box to achieve what you propose.
Selections several lists are usually a bad idea:
- Users do not know how they work
- They are confused and source of errors, except if all options are visible (which generally wastes space UI)
- The resulting values of treatment is problematic
- They are often the cause of a model of incorrect data or result
Checkboxes or a shuttle are much better options and controls for multiple choice options.
-
Add the data in a field of multiple selection?
Just got got off the phone with the support of Eloqua ask about the possibility of adding data in a field of multiple selection over time. Apparently, it's possible through mailings of form, but no list will be mailed. Wouldn't be great if during a download list, you had the ability to add data from a field in your file .csv for existing values in this area in Eloqua. Here's a use case for this scenario... in our society of industry can be part of multiple market segments. Depending on the event, a person can feel they are part of the market segment 'Radar', but another event specializing in Sonar... they indicate that they are part of the market segment "Sonar", both being true. There is currently no easy way to enter these data in Eloqua over time as part of the downloads from the list. Based on the scenario above, the existing value is 'Radar', but if "Sonar" is the value of the field for the next download it replaces the value of 'Radar '. Ideally, we would be able to capture the two values.
I said that if there is enough interest in this idea, Eloqua would consider developing a new option for downloads from the list add vs crush. I hope others can find a use case for this idea.
Hi Tina,
I know it's a bit old but I had a simular problem on adding values to a multi select. Here's how I approached it.
1. Add a text based contact field Eloqua to transfer your csv values. Let's call it "MultiSelect download Value" for this example.
2. Add Eloqua add values to a multiselect contact field. What we'll call "MultiSelect Final.
3. create a program that will add the download list.
4. in the program, create a step to update Contact data
. in the update rule, update "Definitive MultiSelect' field, Append the value in the field value, value will be hardcoded, check use a delimiter": ", marks the conditional rule the field" value to download MultiSelect "equals the value hard coded or one that you would like the field to be.
b. create all update settings you need for your data.
I approached this way because our downloads from the list should be add the data over time. The field ' value to download MultiSelect ' allows it to be overwritten on each download.
Let me know if you want more details.
Thank you
Blake
-
Limit of characters in multiple-selection list
Hi people,
Throw this out there to see if anyone has had this problem, and how they may have gotten around him.
It seems that the Multi Select lists have a limit of 1000 characters, i.e. If you select so many items in the list and its over 1000 characters, you cannot save the file.
I would like to say that ok we will have to just a few lists rather than a big workaround, but the customer fixed the list up in this way, and now that we create the hypersite to allow them to select items in this list, it's possible they could try on the hypersite select all. Clearly, it seems that we will have to have validation on the website to ensure that they do not select more than 1000 characters of a value of items in the list, but it would be useful if there was a way Eloqua to enable this.
The one you have any ideas/advice?
Something is very appreciated.
Thank you
Andrew Mc.
I think the challenge is that the multiple-selection list is already built and already used in other functions.
Andrew - you're right that to resolve this problem, you would have to update the list in Eloqua (again, just the option values, not the option names) and also the list in SFDC - you are on right track here.
I hope this helps!
Maybe you are looking for
-
On Boolean text wrapping buttons on front panel
I have an example that shows the actually text wrapping a Boolean button on a façade. How do you get the text to be sent back? I'm trying to shriink the width of the box to force it to wrap, but it snaps right back. Even, I went the properties and
-
Display of the observation historical string metrics
Hi, I have an agent custom simple observation of string metric collection. I have problem when I want to create a dashboard showing the historical value for a specific host. I want to draw a table like this: collecting the metric temporal metrics 201
-
Approval of issue of Volume of Windows 7
I have all the 25 computers purchased with their own versions of OEM Windows 7 Pro. Because of my corporate security environment, I need a master image and have this image scanned for security vulnerabilities. Once the image is scanned and blessed
-
Hi, Im from the India. I bought my HP Pavilion dv6-6115tx Entertainment Notebook PC in 2012. I have windows 7 Professional. I want to upgrade to windows 8.1. I have the Radeon graphics card. Can I update or my laptop displays compatibility errors?
-
Error at startup message"could not open program, MSVCR80.dll is missing.
Original title: Error Message When I log in, I get a message saying: could not open program, MSVCR80.dll is missing. try reinstalling the program. What is c?