How to show my listview QML this JSON webservice
Hi all
IM new developer for blackberry 10
It's my first project of construction of a PSA
I want to ask
1. This is my JSON www.rws.rajaspot.com/rs_promoclient.php
2. I want to do a listview in my QML using this JSON
y at - it a code for this example, I tried to make the market http://stackoverflow.com/questions/18598886/how-to-use-json-webservice-in-blackberry-cascades and http://stackoverflow.com/questions/18638067/how-to-create-listview-for-json-parsing-in-blackberry-ca... but still get error
Please help, thanks
Did you add this line to your .pro file...
LIBS +=-lbbdata
Tags: BlackBerry Developers
Similar Questions
-
How to show the busy cursor when calling webservice using as?
I want to call the Web service using script, but I don't know how to show me busy cursor.please helpsDisplay the busy cursor:
>>>
CursorManager.setBusyCursor ();
and hide:
>>>
CursorManager.removeBusyCursor ();
Don't forget to capture all the events of the web-service safely remove the busy cursor. In particular, you want to handle 'received results' events and the logic of the results 'defects appeared.
-
Mesh Hangman plugin works with in Illustrator gradient mesh!
HUGE CLAIM to show the mechanism of this plugin loading in Illustrator CS5!
I did not...
Who knows the loading mechanism on the illustrator of the AIP files?
Get directions how to proceed.
Download the CS5 version
Unzip
Stop Adobe Illustrator
MeshTormentor.aip to
C:\Program Files (x 86) \Adobe\Adobe Illustrator CS5\Plug-ins\Extensions
Start Adobe Illustrator window > MeshTormentor
User Guide
Mesh executioner Adobe Illustrator plugin - complete Guide - Freebies - Vectorboom
-
Changing variables of C++ QML UI (json source and sorting keys)
Hello
I have a tabbed two tabbed pane. I want to fill each tab with a dfifferent JSON (list (not XML). I managed to fill the first tab with the first json file... following the example of application stampcollector. All the UI is QML but JSON loading and groupdatamodel of adjustment is done in C++.
1. now I want to fill the tab page of the 2nd with another JSON list. How can I go about it? Create a new class or can I change the JSON source when the 2nd tab fires?
2 just like in the application of stampcollecctor, I use sort keys. I have a few elements of the action in QML, that when you press on, I want that sort of change lists. So let's say that the first action to sort A - Z, the second action Z - A, the third of the population, action action 4th by area. How to access and change the sort key?
3. is there in any case to sort alphabetically in reverse order, from Z - A?
Code I have so far is below... just no idea where to start...
hand. QML
import bb.cascades 1.0 TabbedPane { id: mainTabPage showTabsOnActionBar: true // Country Tab Tab { title: "Countries" NavigationPane { id: countryTabNav property variant _countryView; Page { Container { ListView { id: countryList objectName: "countryList" listItemComponents: [ ListItemComponent { type: "listItem" StandardListItem { title: ListItemData.country status: ListItemData.population description: ListItemData.capital } } ] onTriggered: { var chosenItem = dataModel.data(indexPath); _countryView = chosenItem; countryTabNav.deprecatedPushQmlByString("countryDetail.qml"); } } //-- define tab content here layout: StackLayout { } } } } } }
App.cpp
#include "app.hpp" #include
#include #include #include #include #include #include #include #include using namespace bb::cascades; using namespace bb::data; App::App() { QmlDocument *qml = QmlDocument::create("main.qml"); //-- setContextProperty expose C++ object in QML as an variable //-- uncomment next line to introduce 'this' object to QML name space as an 'app' variable //qml->setContextProperty("app", this); AbstractPane *root = qml->createRootNode (); // ListView Model ListView *countryList = root->findChild ("countryList"); setupCountryListModel(countryList); Application::setScene(root); } void App::setupCountryListModel(ListView *countryList) { JsonDataAccess jda; QVariantList mainList = jda.load("app/native/assets/countries.json").value (); if (jda.hasError()) { bb::data::DataAccessError error = jda.error(); qDebug() << "JSON loading error: " << error.errorType() << ": " << error.errorMessage(); return; } GroupDataModel *countryModel = new GroupDataModel(QStringList() << "country"); countryModel->setParent(this); countryModel->insertList(mainList); countryModel->setGrouping(ItemGrouping::ByFullValue); countryList->setDataModel(countryModel); } App.HPP
#ifndef APP_H #define APP_H #include
#include using namespace bb::cascades; namespace bb { namespace cascades { class ListView; } } /*! * @brief Application GUI object */ class App : public QObject { Q_OBJECT public: App(); private: void setupCountryListModel(ListView *countryList); }; #endif // ifndef APP_H 1. you will need to duplicate what you did for the other tab. Check out weatherguesser which has a bunch of tabs and datamodels.
2. order groupdata model page
https://developer.BlackBerry.com/Cascades/reference/bb__cascades__groupdatamodel.html#setsortingkeys
Try:
countryModel->setSortingKeys())
3.
countryModel-> setsortedascending (false)
-
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(); }
-
How to replace the string "\" on json webservice?
Hello
I have problem with this json
"{\"search_result\":[{\"name\":\"Mall Summarecon\",\"category\":\"BusinessEntity\",\"id\":\"1\"},{\"name\":\"Bamboo Dim Sum\",\"category\":\"BusinessEntity\",\"id\":\"2\"},{\"name\":\"Dimsum Ceker\",\"category\":\"Item\",\"id\":\"1\"}]}"
I want to replace the string "\".
the json are already working on my app via .cpp file
I already add json.replace on my qml
function simpleSearch(response){ indicator.stop() model.clear() console.log("Response: "+response) var json = JSON.parse(response) json = json.replace('\\', ' ') // this is how the way i replace if (json == "[]") notFound.visible = true else model.append(json.search_result) }
but still does not work
is there a different way to replace it?
Thank you
Change your simpleSearchFinished as follows
....simpleSearchFinished() { QNetworkReply *reply = qobject_cast
(sender()); if (!reply->error()){ QByteArray response = reply->readAll(); response.replace("\\", ""); if (response.startsWith("\"")){ response.remove(0, 1); } if (response.endsWith("\"")){ response.remove(response.length()-1, 1); } emit simpleSearchDone(response); }else{ const int httpCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); qDebug() << "ErrorCode" << httpCode << endl << \ "ErrorString" << reply->errorString(); emit error(httpCode, reply->errorString()); } reply->deleteLater(); manager->deleteLater(); } and QML
function simpleSearch(response){ indicator.stop() model.clear() var json = JSON.parse(response) if (json){ // is VALID/PARSED model.append(json.search_result) } }
As I wrote, it is not a good workaround solution. The best is to send VALID JSON string directly from your server. But it works
-
How to make a page QML figurentsur only the first launch
How to make a qml page appears only on the first time the application is started?
I need to create a tabbed pane and the number of tabs depends on n the input from the user to whom it provides the first launch. How to make this happen?
You can use QSettings to store parameters.
Create two main qmls (mainHasInput.qml and mainHasNoInput.qml). When the user runs your application for the first time, load mainHasNoInput.qml. If the user enters the input values correct, who writes in your QSettings. The next time that the launch of the app, you check if a setting has been stored in your QSettings. If not, show your mainHasNoInput.qml, if yes, see the mainHasInput.qml (which is your main 'normal' screen)
for an example how to use QSettings, see https://developer.blackberry.com/native/sampleapps/ -> 'persistent objects '.
-
When I access the net with firefox, a new tab opens on a specific page. How can I block access to this site or stop firefox from loading? Here is the site in question:
http://AdultFriendFinder.com/go/g1110961-PMO
not once have I ever accessed this site and it doesn't show up in the browser historyThis has happened
A few times a week
is since I started using firefox
Make a check of malware with a few programs to scan for malware.
You must use all of the programs, because each detect different malware.
Make sure that you update each program to get the latest version of the database.http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
http://www.superantispyware.com/ - SuperAntispyware
http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
..........
See also 'Spyware on Windows': http://kb.mozillazine.org/Popups_not_blocked -
I tried to install since 11/12/09 important update KB976098 and continue to get error code 8E5E03FB unknown error. I tried to find the error code, but can't find it. How can I download and install this update?
Quote your full version of Windows (for example, WinXP SP3;) Vista SP1; Vista 64 - bit SP2; Win7; Win7 64 bit) when you post in a forum or a newsgroup. Please do it in your next reply.
Short story: If you do NOT live in one of the zones listed in http://support.microsoft.com/kb/976098, you really need not to install this security update not any way so you can hide it just ("don't show me this update"). ~ 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
-
Remember - this is a public forum so never post private information such as numbers of mail or telephone!
Ideas: I get the 0x80073AFC error code when I try to use the system restore then, how can I find and replace this file missing MUI?
I am running Windows 7 for packs SP 1 or SP 2 does NOT solve my problem since neither one works with Windows 7. Is there a way to search for this MUI (Multiple User Interface) missing file? The every thing must have himself installed in the first place. I took my mom (she died in June) and my brother on this PC as users so even if they do not use this PC supports multiple users. Maybe if I deleted as a reboot and additional users it will solve my problems. My updates install OK but I can't run at all system restore. It creates a restoration point OK but when I try to sr back to a restore point before I get the error 0x80073AFC topic of the missing MUI file. Then, when I spear SR it is said that he could not and no files have been changed because of the error 0x8000FFFF error, unspecified catastrophic failure and could not retrieve the file several times when system restore is attempted.
I'm running Windows 7 on a HP Pavilion with browser Firefox 3.6.8 browser Opera 10.60, IE8 and Google Chrome 5.0.375.125 browser browser.
Can you tell me what I try next? Thnks a lot and sayonara for now the guy-Jack McElwee / keimanzero the Scion of the Anime in Brookhaven PA - USA
OK I tried everything and nothing works! Only added beginners are updated browser Opera 10.63; IE9 (Beta); Firefox 3.6.12 and Google Chrome 7.0.517.41 and Java 22. Of course like everyone else in the world, I had to uninstall/enable and disable/download again and reinstall new Adobe Flash 10 and 11 of the shock wave and they keep crashing too! Hello 4 keep screwing browsers and now I get connection network problems. I run Comcast doctor and did everything it said to do, but nothing works. Oh and I added 7-Zip and WinZip also. Likewise, they will not work! Help! Thanks - K & K
keimanzero,
Comcast of Norton Security Suite version is installed? If Yes, who and perhaps malware is most likely to cause questions you have published, in particular the failure of the restoration of the system.
First, configure the system to boot - How to solve a problem by performing a boot in Windows Vista or in Windows 7
NOTE: Start-up mode minimum state all the 3rd party firewalls will be disabled. Open Control Panel > Windows Firewall to make sure that the native firewall of Windows 7 is now on.Download and Save the update system (or CheckSUR) tool. You will need to download the specific Version of CheckSUR corresponding to the architecture of the system to Windows 7. If you do not know the architecture of the system, and then click the link that says "Click here to show or hide the instructions step by step with images" under method 2: download the update directly system preparation tool from Microsoft Download Center .
Description of the preparation tool system update for Windows Vista for Windows Server 2008, for Windows 7 and for Windows Server 2008 R2Once the download is complete, close all open programs and browsers. Now, run CheckSUR with the system connected to the internet because it will download the .cab for system files. Reboot once CheckSUR is complete.
Secondly, I suggest that you run the File Checker system while in the same clean boot state.
To run the System File Checker tool, follow these steps:- Click Start and type cmd in the field search programs and files .
- Right click on cmd.exe in the programs of list, and then choose 'run as administrator '.If you are prompted for an administrator password or a confirmation, type your password or click on continue.
- At the command prompt, enter the following line exactly as written including the space between thec and the/and then press ENTER:sfc/scannow
When the analysis is complete, test to see if the problems facing the system have been resolved.
If they are not, you will need to contact Norton support for the version of Norton Internet Security Comcast to get help, or just uninstall NIS, run the Norton removal tool (right click Norton_Removal_Tool.exe, choose "Run as Administrator"), reboot and then check to see if the problems are still occurring.
Expert MowGreen Windows IT Pro - consumer safety
-
How can error 10, I solve this problem
I've upgraded to windows 7. started having a few problems. returned to windows vista. now, the driver does not start. shows error 10. need help
Hello
Visit this link to solve problems:
Description of errors related to the 10 Code that generates the Device Manager in Windows on the computers http://support.microsoft.com/kb/943104/
==================================
This is my generic how updates of appropriate driver:
This utility, it is easy see which versions are loaded:
-Free - DriverView utility displays the list of all device drivers currently loaded on your system.
For each driver in the list, additional useful information is displayed: load address of the driver,
Description, version, product name, company that created the driver and more.
http://www.NirSoft.NET/utils/DriverView.htmlFor drivers, visit manufacturer of emergency system and of the manufacturer of the device that are the most common.
Control Panel - device - Graphics Manager - note the brand and complete model
your video card - double - tab of the driver - write version information. Now, click on update
Driver (this can do nothing as MS is far behind the certification of drivers) - then right-click.
Uninstall - REBOOT it will refresh the driver stack.Repeat this for network - card (NIC), Wifi network, sound, mouse, and keyboard if 3rd party
with their own software and drivers and all other main drivers that you have.Now in the system manufacturer (Dell, HP, Toshiba as examples) site (in a restaurant), peripheral
Site of the manufacturer (Realtek, Intel, Nvidia, ATI, for example) and get their latest versions. (Look for
BIOS, Chipset and software updates on the site of the manufacturer of the system here.)Download - SAVE - go to where you put them - right click - RUN AD ADMIN - REBOOT after
each installation.Always check in the Device Manager - drivers tab to be sure the version you actually install
presents itself. This is because some restore drivers before the most recent is installed (sound card drivers
in particular that) so to install a driver - reboot - check that it is installed and repeat as
necessary.Repeat to the manufacturers - BTW in the DO NOT RUN THEIR SCANNER device - check
manually by model. Search manually on the sites of the manufacturer drivers - and the manufacturer of the device
sites.
http://pcsupport.about.com/od/driverssupport/HT/driverdlmfgr.htmHow to install a device driver in Vista Device Manager
http://www.Vistax64.com/tutorials/193584-Device-Manager-install-driver.htmlIf you update the drivers manually, then it's a good idea to disable the facilities of driver under Windows
Updates, that leaves about Windows updates but it will not install the drivers that will be generally
older and cause problems. If updates offers a new driver and then HIDE it (right click on it), then
get new manually if you wish.How to disable automatic driver Installation in Windows Vista - drivers
http://www.AddictiveTips.com/Windows-Tips/how-to-disable-automatic-driver-installation-in-Windows-Vista/
http://TechNet.Microsoft.com/en-us/library/cc730606 (WS.10) .aspxHope these helps.
Rob - bicycle - Mark Twain said it is good.
-
When I open my browser last viewed page always reappears. How can I get to stop this?
When I open my browser last viewed page always reappears. How can I get to stop this?
Hi DawnZahradka,
1. what web browser is installed on the computer?
2. don't you make changes to the computer before the show?If you use Internet Explorer, I suggest you try the steps from the following link:
How to optimize Internet Explorer
http://support.Microsoft.com/kb/936213/roNote: Reset the Internet Explorer settings can reset security settings or privacy settings that you have added to the list of Trusted Sites. Reset the Internet Explorer settings can also reset parental control settings. We recommend that you note these sites before you use the reset Internet Explorer settings.
-
How to show the ink levels on the computer for Officejet 6600
How to show the ink levels on the computer for Officejet 6600
What is the full product name or product number?
This is the Manual of your printer the following image was derived.
You can use the printer's built-in web server to get the status of the printer information from a browser.
-
How to use json webservice in blackberry waterfalls
1. how to use json WebService in the cascades of blackberry.
2.i need to get data from url link in the qml page. give suggession with examples if possible.
my link of web service contains the type of array
for example: {'address': ['zone': 'RCS', 'city': 'ght']}
Description:
JSON link--> http://192.168.1.251:410/Mobile/Service1.svc/english/Category?CountryID=1
using link above please ask how to recover data from json webservice cascading... I need answer to the method of waterfalls...
Finally, I am me anser for service web json
Response---> http://stackoverflow.com/questions/18598886/how-to-use-json-webservice-in-blackberry-cascades/186230...
-
How to show the main screen (home screen of blackberry)
Hi guys,.
I need to know how to show the main screen (home screen of the blackberry), even if it's in any screen (like saying "Calculator" etc)...
This must be done by programming... is there a solution for this?
Thanks in advance,
I also had. This is to disconnect incoming call and display the main screen (home screen of the blackberry).
EventInjector.invokeEvent (new EventInjector.KeyCodeEvent (EventInjector.KeyCodeEvent.KEY_DOWN, (char) Keypad.KEY_END, 0, 100));
EventInjector.invokeEvent (new EventInjector.KeyCodeEvent (EventInjector.KeyCodeEvent.KEY_UP, (char) Keypad.KEY_END, 0, 100));
Maybe you are looking for
-
I tried all the steps detailed here: https://support.Mozilla.org/en-us/questions/963461?FPA=1 However this page: https://www.Mozilla.org/en-us/pluginCheck/ Does not plug-ins. It's just a page of information (even after reset firefox profile)
-
Is it possible to open display 'signet' in a new window or a new tab instead of a sidebar?
"When you click on the ' view your bookmarks" button on the menu bar, it opens a sidebar. I would try a new window or a new tab instead of the sidebar. I have the Tab Mix Plus add-on installed but I can't find this option.Thank you.
-
Question about the installation of Win XP on Satellite Pro P200
Hello I have a lot of problems with Vista. First it took me a week to install my printer WiFi. (sollution: install local lpt1 as the printer, change port properties en gives a location network (computer/printername).)Last problem: vista give no right
-
Re: Satellite Pro A100 PSAA3E: after XP installation does not work
Hello I recently bought a psaa3e Satellite Pro A100.I formatted and installed Win XP. Everything works except the sound.In Device Manager its shows a PCI device problem. I think I need the pci to install before my sound card is recognized.I could be
-
Windows 7 laptop does not start
Pavilion G62 has default ID UBX1AX-5L073W-XD0141 - ST 60, 03 in hard drive Test