Add cotainers inside a listview
Nice day
I want to add container as items in listview, how? an example would be very useful
Thank you!
Hello
This page is an example of use of the containers within the ListItemComponent in the ListView:
http://developer.BlackBerry.com/Cascades/documentation/UI/lists/list_view.html
Tags: BlackBerry Developers
Similar Questions
-
Dynamically add custom headers in ListView
I'm working with a ListView which is based on a api, that I have no control.
I dynamically add some custom headers subject see the following as to what I am referring to (A, B)
http://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__listview.html
How can I dynamically add these? For example, I want to add a conflict between the first element of the list and the second
Section A
Header
Item B
Point C
Hi Philippe,.
To do this, you must use a custom list item component.
Heres how I could do that
Moreover, in the custom "Header" just create a structure as follows:IF/ELSE ON A FLAG
if(someflag == "header"){ //use header style }else{ // show normal list style }
My Code
ListView{ dataModel: ArrayDataModel{ id: myDataModel } listItemComponents: ListItemComponent { Container{ layout: StackLayout{ orientation: LayoutOrientation.TopToBottom } Label{ text: ListItemData // complete data string } Label{ text: ListItemData.split("~")[0] } Label{ text: ListItemData.split("~")[1] } Label{ text: ListItemData.split("~")[2] } }//end Container }//end ListItemComponent onCreationCompleted: { //The data inside append is one item. //let's append a bunch of data for(var i=0;i<30;i++){ //append 30 list items myDataModel.append("Header~Some data whatever~Status"); } } }
- In my example I am adding data to the model.
ListItemData - the full string
ListItemData.split("~") [0] - first part etc.
- I shared parts of the data with a single symbol. In my case the «~»
- To get the data I want to that I just throw a ListItemData.split("~"). It breaks the string into 3 parts.
- I will be able to access somewhere I want using the notation ListItemData.split("~") [index]
- You can include paths to images, or whatever the text you
AS IF THIS HELPED YOU!
-
Access to a component (ImageView) inside the ListView
I have a ListView in which there is an ImageView. When any item is typed, I manage onTriggered Signal. At this signal, I want access the ImageView the ListItem that is typed. How to do this?
I think that the best workaround is using your own object as a data model to the image property. Then you can change it in onTriggered signal just like that ListItemData.imageSource = newImageSource
for example:
// If you are using JSON add a new property which is a imageSource model.append({"name": "bla bla", "imageSource": "bla bla"})
or write a derivered of QObject class as in this example
https://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__GroupDataModel.html
but hope that you use GroupDataModel
Another solution is to write your own function and use instead onTriggered
for example (I like examples of the )
ListView{ function myOwnFunction(indexPath, imageView){ var item = dataModel.data(indexPath); if (item){ // set new image } } } // And access it from ListItemComponent ListItemComponent { type: "" Container { id: root onTouch{ root.ListItem.view.myOwnFunction(root.ListItem.indexPath, imageView) } }
-
Need a simple example how to create a simple DataModel and add it to a ListView
Hi, I have a problem with the dataModel and ListView.
I want to have the following, a DataModel that contains just strings and a ListView to display.
Also a button, whenever I click on it, he must add a string to the DataModel.
How to do this only in QML?
The projects are in the ScrollableLists project.
-
How to add subitems inside the xml file
Hello
This is the result I get in EM. Now, I want to add all three IncidentID and want to store in a variable. I used concat option, but it's not adding all the incidentID. How can I do?
< HolxSrEventData >
< incidentId > 2445030 < / incidentId >
< > 55730 Parisby < / Parisby >
< creationDate > 2013-01-22T 03: 46:23.000 - 05:00 < / creationDate >
< processedFlag > Y < / processedFlag >
< dateProcessed xsi: Nil = "true" / >
< errorRemark > new entry < / errorRemark >
< holxSrEventDataCollection / >
< / HolxSrEventData >
< HolxSrEventData >
< incidentId > 2445030 < / incidentId >
< > 55730 Parisby < / Parisby >
< creationDate > 2013-01-22T 03: 46:23.000 - 05:00 < / creationDate >
< processedFlag > Y < / processedFlag >
< dateProcessed xsi: Nil = "true" / >
< errorRemark > new entry < / errorRemark >
< holxSrEventDataCollection / >
< / HolxSrEventData >
< HolxSrEventData >
< incidentId > 2445030 < / incidentId >
< > 55730 Parisby < / Parisby >
< creationDate > 2013-01-22T 03: 46:23.000 - 05:00 < / creationDate >
< processedFlag > Y < / processedFlag >
< dateProcessed xsi: Nil = "true" / >
< errorRemark > new entry < / errorRemark >
< holxSrEventDataCollection / >
< / HolxSrEventData >
< / HolxSrEventDataCollection >
Thank youHello
string-join is a standard xpath function... Oracle implements the function, but is not in the Mapper/wizards... It should be used in a transformation XSLT or BPEL 2.0...
http://www.w3schools.com/XPath/xpath_functions.asp#stringThis transfer XSLT works, but you will lose the design view...
I hope this helps...
See you soon,.
Vlad -
I have a script to automate printing.
I have a box on the top of each page that will be checked if the page should be printed.
Then a loop puts each page number in a table that is then run through a printing process.
The part shown here prompts the user the number of pages to print through the length of array property.
for (pa var = 0; pa < = 3; pa ++) {}
If (this.getField ('PRINT' '. + pa + '.)) CKB') .value! = 'Off') {}
printarr [printarr. Length] = pa;
}
}
App.Alert ("your file contains" + printarr.length + "pages.", 4, 0,"printing");
Now, I need to add '2' to this number, because more than two pages will accompany this feature.
For example, if the user filled with 8 pages, I need to tell him that 10 pages will be printed.
App.Alert ("your file contains" + (printarr.length + 2) + "Pages.", 4, 0, 'printing');
-
Help creating a button and add text inside
Hi guys...
I am trying to create a button (or an MC, the same) using only of the code, but it must be what I need, inside...
var ins_btn:?
ins var: String = "how to play / Como jugar;
ins_btn.x = 202,75;
ins_btn.y = 316;
ins_btn. Width = 533,30;
ins_btn. Height = 59.35;
ins_btn. Ins = text;
addChild (ins_btn);
I tried this way, do ins_btn a MC, but it does not work (it does not appear in my screen) and I do that, so, when someone clicks on it, it goes to the two framework:
ins_btn.addEventListener (MouseEvent.CLICK, instructionF);
function instructionF(event:MouseEvent):void {}
ins_btn. RemoveEventListener (MouseEvent.CLICK, instructionF);
gotoAndStop (2);
}
Then... What should I do to make this button or movieclip appears in the scene, with the words how to play / Como jugar inside?
Thank you very much!
For a button work, he needs something to click on as a key area. If you need a basic button without making any design, you can use one of the preset buttons (window-> common libraries-> buttons) or just use the component button (window-> components-> UI-> button).
For example, this one, open the components Panel (window-> components), driving User Interface open, drag the Button component in your library.
In the code you can use it as simply as this:
Import fl.controls.Button;
import flash.events.MouseEvent;
var: button = new Button();
Button.label = "how to play / Como jugar;
button.setSize (150,20);
addChild (button);
button.addEventListener (MouseEvent.CLICK, instructionF);
function instructionF(event:MouseEvent):void
{
button.removeEventListener (MouseEvent.CLICK, instructionF);
gotoAndStop (2);
}
If you want to draw your own button, use the graphics class of any display object and draw a background for your button has something to capture the click. You also need a TextField inside the key. For example a blue rounded rectangle button Sprite:
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
import flash.text.AntiAliasType;
var ins_btn:Sprite = new Sprite();
addChild (ins_btn);
background
ins_btn. Graphics.beginFill(0x6666CC,1);
ins_btn. Graphics.drawRoundRect (10,10,150,20,10,10);
ins_btn. Graphics.endFill ();
text
var tf:TextField = new TextField();
ins_btn. AddChild (TF);
TF. Width = 10;
tf.autoSize = TextFieldAutoSize.LEFT;
tf.antiAliasType = AntiAliasType.ADVANCED;
TF. Selectable = false;
TF. Text = "how to play / Como jugar;
tf.setTextFormat (new TextFormat("Arial",11,0xFFFFFF));
TF.x = 22;
TF.y = 10;
has hit
ins_btn.addEventListener (MouseEvent.CLICK, instructionF);
function instructionF(event:MouseEvent):void
{
ins_btn. RemoveEventListener (MouseEvent.CLICK, instructionF);
gotoAndStop (2);
}
-
Label visible only when listView is empty
Hello
I want to have a label presented in a box that disappears when an element is added to the listView. I found this example but it does not work:
http://pysnippet.blogspot.de/2013/01/informative-list-views-in-Cascades-BB10.html
First I discovered that I have to put the "onItemAdded", etc. within the dataModel, not inside the ListView.
But when I use the tag code is always displayed when I add a list item.
Can someone help me out here. Or another way to display a label when listView is empty?
your datamodel is missing in the custom property 'empty '.
the code of the link uses this Boolean property to trigger the visibility.
real estate in qml announce their changes automatically. -
SL500 and I want to add more RAM
Howdy.
I have a new Thinkpad SL500, such as here: http://www.hemini.com/products/product_details.aspx?prodid=425737&cp=1&sc=1&sct=
It has an Intel Core 2 Duo (T6670) 2.2 GHz processor and 2048 MB of RAM.
I want to add more RAM to make it even more effective that I use a lot of programs, sometimes at the same time.
I wish it have 4 GB, and what I understand is the maximum that it is supposed to be able to handle.
Then what should I do? I buy a 4 GB of RAM and remove the 2 GB that I have now and install the 4 GB one?
Or should I leave the 2 GB RAM inside and just buy a 2 GB of RAM and add together inside?
In addition, the brand has a role? Wouldn't be brand of Lenovo? What other groups are good for RAM?
They are all the other things I have to consider buying RAM. ?
Thank you very much.
If you use 32 bit os I works perfectly with 4 GB but system uses 3 GB. Add the next module that means you probably have 2 GB module inserted. You can simply put another beside it mounted origin. Check with everest, aida, cpu - z or any other things how many modules is placed on your motherboard and you have free banks.
-
I can access a C++ object using the QmlDocument function-> setContextProperty() in JavaScript inside most of the QML elements (such as containers, ImageButton, control etc.) happened, but can't access it from the JavaScript inside ListView. I get "ReferenceError: can't find variable: app. Why is this?
Why is it a "problem"? It's probably just the way things work and should work. ListItemComponents are not really part of the scene graph/context since they exist only to be used during execution. Wait so the scope of the listItemcomponent unlike the rest of the document.
The way around it, as described in the thread linked above is to create a function inside your listview that refers to the context property that you want to use. Then, your listitemcomponent has access to this feature of the listview.
-
What do you see when you run that this basic example ListView QML?
I read through the examples of ListView found here:
http://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__ListView.html
I'm at the part that speaks of "'How to create a list in QML and access a variable inside the ListView". " When I run the example, I see a ListView display the data I entered model.xml. But must I also see "Example text" added on each entry in ListView? I don't see "Example text" displayed anywhere.
The property type must match the xml in the template tag, for example:
Using this model in xml format:
With this qml code works perfectly:
import bb.cascades 1.3 Page { ListView { property string myText: "is a City" dataModel: XmlDataModel { source: "model.xml" } listItemComponents: [ ListItemComponent { type: "item" CustomListItem { id: itemRoot dividerVisible: true highlightAppearance: HighlightAppearance.Full Container { Label { text: ListItemData.title + " " + itemRoot.ListItem.view.myText } } } } ] } }
-
How to navigate all the Checkbox State in a ListView
I have a ListView with box on each line. I want to make a feature to remember the State of the check box so users checked someone.
I tried to use a signal when the box is checked to notify a function in a CPC to remember the current state of the check box, but when I want to do with the context property object registed in the PRC, it always say this object cannot be found.
Do you know how to make this kind of functionality? Or how to navigate all the checkbox in the ListView? Thank you very much.
listItemComponents: [ ListItemComponent { type: "textItem" TextItem { id: textitem onItemcheck: { _app.setCheckboxStatus(checkBoxId); //ReferenceError Can not find variable _app } } } ] mainApp.cpp: qml->setContextProperty("_app", this); TextItem.qml: signal itemcheck(string checkBoxId) CheckBox { onCheckedChanged: { if (checked) itemcheck(ListItemData.id); } }
to solve the referance error pls follow these steps
listItemComponents: [ ListItemComponent { type: "textItem" TextItem { id: textitem onItemcheck: { textitem.ListItem.view.setCheckboxStatus(checkBoxId); } } } ] function setCheckboxStatus(checkBoxId) { _app.setCheckboxStatus(checkBoxId); }
Add setCheckboxStatus function in ListView
-
Access CPP of the ListView in QML function
ListView { id: listView dataModel: dataModel listItemComponents: [ ListItemComponent { type: "item" StandardListItem { title: ListItemData.title description: app.formatDate(ListItemData.pubDate); } } ] }
and in the PRC
QString ApplicationUI::formatDate(QString date) { return "bla"; }
Function call leave outer ListView works well, but I cannot access any function defined outside ListView!
In this case, I get asset:///blabla.qml:16: ReferenceError: can't find variable: app
How can I call it?
For some strange reason the listItemComponents are outside the normal code flow. But you can bypass. Give your listItemComponent a name/id. You can reference it trough the parent ListView. Something like this should work:
StandardListItem { id: mscurli title: ListItemData.OriginalTitle; description: ListItemData.TheatreAndAuditorium status: mscurli.ListItem.view.getShowTime(ListItemData.dttmShowStart); }
I used a set inside my ListView simple helper function to get the C++ code:
function getShowTime(str) { return _myapp.formatTime(str); }
-
Change the State of all the Image inside the list view toggle button when a list is tap
Hi, please help, is there a way to change the State of a toggle button to image inside the listview where in when you type a list, the toggle button in the list state change and the other toggle button will be set to their default image? the list has a defined Image toggle button to check both...
ListView { layout: GridListLayout { cellAspectRatio: 1.4 } id: denominationList dataModel: _model.denominationModel listItemComponents: [ ListItemComponent { id: component type: "item" CustomListItem { id: itemRoot dividerVisible: false highlightAppearance: HighlightAppearance.None Container { id: fieldContainer topPadding: 5 leftPadding: 10 rightPadding: 10 bottomPadding: 5 //maxWidth: 270 layout: DockLayout {} Container { id: amountContainer //topPadding: layout: DockLayout {} background: Color.create("#ffffff") horizontalAlignment: HorizontalAlignment.Center verticalAlignment: VerticalAlignment.Center ImageView { id: amountBorder preferredWidth: 400 imageSource: "asset:///images/flux/amount-border-other.png" } Container { horizontalAlignment: HorizontalAlignment.Center verticalAlignment: VerticalAlignment.Center layout: StackLayout { orientation: (!(ListItemData.name > 4) ? LayoutOrientation.TopToBottom : LayoutOrientation.LeftToRight) } Container { horizontalAlignment: HorizontalAlignment.Center verticalAlignment: VerticalAlignment.Top visible: (ListItemData.name.length > 4) preferredHeight: 60 Label { id: loadPromoName textFit.mode: LabelTextFitMode.FitToBounds //multiline: true visible: (ListItemData.name.length > 4) textStyle{ fontSize: FontSize.Medium fontWeight: FontWeight.W300 color: Color.create("#b9babe") textAlign: TextAlign.Center } text: ListItemData.name } } Container { verticalAlignment: VerticalAlignment.Center topPadding: 8 rightPadding: 0 ImageView { visible: (ListItemData.name.length <= 4) preferredHeight: 40 imageSource: "asset:///images/flux/pesosign-amount.png" } } Container { verticalAlignment: ((ListItemData.name.length > 4) ? VerticalAlignment.Center : VerticalAlignment.Bottom) horizontalAlignment: HorizontalAlignment.Center leftPadding: 0 Label { id: amountLabel textFit.mode: LabelTextFitMode.FitToBounds textStyle{ fontSize: FontSize.XLarge fontWeight: FontWeight.W300 color: Color.create("#b9babe") textAlign: TextAlign.Center } text: ListItemData.amount } } } } } } } ] onTriggered: { var selectedItem = dataModel.data(indexPath); } } }
link the button to a property of an element, and then change all the elements in the datamodel. ListView reflects these changes.
-
Cisco ASA 5505 - capable to connect to VPN - access forbidden inside
Hello
I tried to set up a virtual private network for weeks, I can connect to the public IP address of the ASA, but I can't reach anything behind Cisco.
I give you my config:
ASA Version 8.2 (5)
!
host name asa
sarg domain name * .net
activate the encrypted password of Z4K16OvBr0J5Dj/2
2KFQnbNIdI.2KYOU encrypted passwd
names of
!
interface Ethernet0/0
switchport access vlan 2
!
interface Ethernet0/1
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
!
interface Vlan1
nameif inside
security-level 100
IP 192.168.1.1 255.255.255.0
!
interface Vlan2
nameif outside
security-level 0
IP address dhcp setroute
!
passive FTP mode
DNS server-group DefaultDNS
domain sargicisco.net
inside_nat0_outbound to access ip 192.168.1.0 scope list allow 255.255.255.0 192.168.1.0 255.255.255.0
inside_nat0_outbound to access ip 192.168.1.0 scope list allow 255.255.255.0 192.168.254.0 255.255.255.240
Remote_Sargi_splitTunnelAcl list standard access allowed 192.168.1.0 255.255.255.0
sheep - in extended access-list permit ip 192.168.1.0 255.255.255.0 192.168.254.0 255.255.255.0
pager lines 24
asdm of logging of information
Outside 1500 MTU
Within 1500 MTU
mask 192.168.254.1 - 192.168.254.10 255.255.255.0 IP local pool SAVPN_Pool
ICMP unreachable rate-limit 1 burst-size 1
don't allow no asdm history
ARP timeout 14400
Global 1 interface (outside)
NAT (inside) 0-list of access inside_nat0_outbound
NAT (inside) 1 0.0.0.0 0.0.0.0
Timeout xlate 03:00
Timeout conn 01:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
Sunrpc timeout 0:10:00 h323 0:05:00 h225 mgcp from 01:00 0:05:00 mgcp-pat 0:05:00
Sip timeout 0:30:00 sip_media 0:02:00 prompt Protocol sip-0: 03:00 sip - disconnect 0:02:00
Timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
Floating conn timeout 0:00:00
dynamic-access-policy-registration DfltAccessPolicy
Enable http server
http 192.168.1.0 255.255.255.0 inside
No snmp server location
No snmp Server contact
Server enable SNMP traps snmp authentication linkup, linkdown cold start
Crypto ipsec transform-set esp-SHA-ESP-3DES-3des esp-sha-hmac
Crypto ipsec transform-set ESP-3DES-MD5-esp-3des esp-md5-hmac
Crypto ipsec transform-set ESP-DES-MD5 esp - esp-md5-hmac
Crypto ipsec transform-set ESP-AES-128-SHA aes - esp esp-sha-hmac
Crypto ipsec transform-set ESP-AES-192-SHA esp-aes-192 esp-sha-hmac
Crypto ipsec transform-set ESP-AES-128-MD5-esp - aes esp-md5-hmac
Crypto ipsec transform-set ESP-AES-192-MD5 esp-aes-192 esp-md5-hmac
Crypto ipsec transform-set ESP-AES-256-SHA 256 - aes - esp esp-sha-hmac
Crypto ipsec transform-set ESP-AES-256-MD5 esp-aes-256 esp-md5-hmac
Crypto ipsec transform-set ESP-DES-SHA esp - esp-sha-hmac
life crypto ipsec security association seconds 28800
Crypto ipsec kilobytes of life - safety 4608000 association
crypto dynamic-map SYSTEM_DEFAULT_CRYPTO_MAP 65535 pfs Group1 set
Crypto dynamic-map SYSTEM_DEFAULT_CRYPTO_MAP 65535 value transform-set ESP-AES-128-SHA ESP-AES-128-MD5 ESP-AES-192-SHA ESP-AES-192-MD5 ESP-AES-256-SHA ESP-AES-256-MD5 ESP-3DES-SHA MD5-ESP-3DES ESP-DES-SHA ESP-DES-MD5
outside_map card crypto 65535-isakmp dynamic ipsec SYSTEM_DEFAULT_CRYPTO_MAP
outside_map interface card crypto outside
inside_map card crypto 65535-isakmp dynamic ipsec SYSTEM_DEFAULT_CRYPTO_MAP
inside crypto map inside_map interface
crypto ISAKMP allow outside
crypto ISAKMP allow inside
crypto ISAKMP policy 10
preshared authentication
3des encryption
sha hash
Group 2
life 86400
VPN-addr-assign local reuse / time 5
Telnet timeout 5
SSH timeout 5
Console timeout 0
management-access inside
dhcpd outside auto_config
!
dhcpd address 192.168.1.5 - 192.168.1.36 inside
Wis field dhcpd * .net interface inside
dhcpd allow inside
!a basic threat threat detection
Statistics-list of access threat detection
no statistical threat detection tcp-interception
WebVPN
allow outside
allow inside
SVC disk0:/anyconnect-win-2.5.2014-k9.pkg 1 image
enable SVC
tunnel-group-list activate
attributes of Group Policy DfltGrpPolicy
Protocol-tunnel-VPN IPSec l2tp ipsec svc webvpn
internal Remote_Sargi group strategy
attributes of Group Policy Remote_Sargi
Protocol-tunnel-VPN IPSec
Split-tunnel-policy tunnelspecified
value of Split-tunnel-network-list Remote_Sargi_splitTunnelAcl
sargicisco.NET value by default-field
username kevin mz6JxJib/sQqvsw9 password encrypted privilege 0
username kevin attributes
VPN-group-policy DfltGrpPolicy
type tunnel-group SAVPN remote access
attributes global-tunnel-group SAVPN
address pool SAVPN_Pool
tunnel-group SAVPN webvpn-attributes
enable SAVPN group-alias
allow group-url https://82.228.XXX.XXX/SAVPN
type tunnel-group Remote_Sargi remote access
attributes global-tunnel-group Remote_Sargi
address pool SAVPN_Pool
Group Policy - by default-Remote_Sargi
IPSec-attributes tunnel-group Remote_Sargi
pre-shared key *.
!
class-map inspection_default
match default-inspection-traffic
!
!
type of policy-card inspect dns preset_dns_map
parameters
maximum message length automatic of customer
message-length maximum 512
Policy-map global_policy
class inspection_default
inspect the preset_dns_map dns
inspect the ftp
inspect h323 h225
inspect the h323 ras
inspect the rsh
inspect the rtsp
inspect esmtp
inspect sqlnet
inspect the skinny
inspect sunrpc
inspect xdmcp
inspect the sip
inspect the netbios
inspect the tftp
Review the ip options
!
global service-policy global_policy
context of prompt hostname
no remote anonymous reporting call
Cryptochecksum:387a6e260247a545f4df0d3f28ba58c5
: endThank you
Hello
Could you remove this statement and add the last:
no nat (inside) 0-list of access inside_nat0_outbound
ADD: nat (inside) 0 access-list sheep - in
Kind regards
Aditya
Please evaluate the useful messages and mark the correct answers.
Maybe you are looking for
-
Hello HP 6700 there the possibility to scan to an email without a computer such as the HP 8600 Pro? Thank you. David
-
Error 80070020 update failed.
Update security for Windows Vista for x 64-based systems (KB967723) Don't download says the error message when I try to install it and the link that says "get help for this error" does not provide all the answers What can I do?
-
Fingerprint sensor test diagnostic doesn' work (Z5 Compact)
Hello. I have problem with diagnostic test of the sensor of fingerprint (menu-settings-all diagnosis-phone-imprint-test sensor). It says it must vibrate when it detecs the finger on the sensor in the test. But nothing happnes. But fingerprint sensor
-
Utube on the blackberry 9800 torch blackBerry Smartphones
I am unable to find the utube app in "blackberry world; I am looking in the right place or with the right name? - I tried 'utube' & 'youtube '.
-
How can I make my printer (HP LaserJet 1012 Laser Printer) compatible to Windows 7
I want to use a (HPLaserJet 1012) printer with Windows 7. How can I do this?