Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Developer
rjkirton
Posts: 7
Registered: ‎01-22-2012
My Device: Torch 9800
My Carrier: bmobile
Accepted Solution

JSON data not displaying on Blackberry simulator or device but displays in ripple

Hello,

I'm using Ripple to develop an application that makes jQuery/Ajax calls to a webservice that returns jSON. The returned data shows fine in ripple but not on the emulator nor the device. I'm using the torch 9800 simulator, php to create the jSON and jQuery.

Please use plain text.
Trusted Contributor
chicoxml
Posts: 227
Registered: ‎09-03-2010
My Device: Not Specified

Re: JSON data not displaying on Blackberry simulator or device but displays in ripple

please publish your config.xml

Please use plain text.
New Developer
rjkirton
Posts: 7
Registered: ‎01-22-2012
My Device: Torch 9800
My Carrier: bmobile

Re: JSON data not displaying on Blackberry simulator or device but displays in ripple

<?xml version="1.0" encoding="utf-8"?>
<widget xmlns=" http://www.w3.org/ns/widgets"
        xmlns:rim="http://www.blackberry.com/ns/widgets"
        version="2.0"
        rim:header="RIM-Widget: rim/widget">

  <author href="http://www.kirtontt.com/" rim:copyright="Copyright 2011 Kirton Communcations Group Ltd">Kirton Communications Group Limited</author>
  <rim:navigation mode="focus" />
  <name>digiDex.mobi</name>

  <description>
    Create and share social, intelligent business cards on the fly from your mobile.
  </description>

  <rim:loadingScreen backgroundImage="background.png"
                     foregroundImage="foreground.png"
                     onLocalPageLoad="false">
        <rim:transitionEffect type="zoomIn" />
  </rim:loadingScreen>
 
  <rim:smileysurprised:rientation mode="portrait" />
 
  <icon src="images/app_icon.png"/>
  <icon src="images/app_icon_hover.png" rim:hover="true"/>

        <rim:cache maxCacheSizeTotal="2048" maxCacheSizeItem ="256" />

  <content src="index.htm" >
    <!--<rim:background src="listener.html" runOnStartup="true" />-->
  </content>

  <feature id="blackberry.ui.dialog"/>
  <access uri="http://www.digidex.mobi/bbm/" subdomains="false">
    <feature id="blackberry.invoke" />
    <feature id="blackberry.invoke.BrowserArguments" />
    <feature id="blackberry.invoke.MemoArguments"/>
  </access>

  <rim:smileytongue:ermissions>
    <rim:smileytongue:ermit>access_shared</rim:smileytongue:ermit>
    <rim:smileytongue:ermit>read_geolocation</rim:smileytongue:ermit>
    <rim:smileytongue:ermit>use_camera</rim:smileytongue:ermit>
  </rim:smileytongue:ermissions>

  <rim:connection timeout="25000">
    <id>TCP_WIFI</id>
    <id>MDS</id>
    <id>BIS-B</id>
    <id>TCP_CELLULAR</id>
    <id>WAP2</id>
    <id>WAP</id>
  </rim:connection>

  <license>
    Copyright (c) 2011 Kirton Communications Group limited.
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
    BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
    ACTION OF CONTRACT, INSULT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.
  </license>
 
</widget>

Please use plain text.
Trusted Contributor
chicoxml
Posts: 227
Registered: ‎09-03-2010
My Device: Not Specified

Re: JSON data not displaying on Blackberry simulator or device but displays in ripple

The web services are in http://www.digidex.mobi/bbm/

Please use plain text.
New Developer
rjkirton
Posts: 7
Registered: ‎01-22-2012
My Device: Torch 9800
My Carrier: bmobile

Re: JSON data not displaying on Blackberry simulator or device but displays in ripple

Yes, they are. When the user logs in, the service returns a JSON string similar to this:
{"cards":[{"id":"17","name":"Roger J. Kirton","title":"CTO","company":"Kirton Communications Group","wphone":"868-779-4524","wphone2":"","mphone":"","email":"rjkirton@kirtontt.com","website":"www.kirtontt.com","address":" ","city":"","zip":"","country":"TTO","cardlabel":"KCG Card","cardid":"c1319694247","template":"1","cardlogo":"kcg_invoice_logo_500.png","cardphoto":"IMG-20110701-00439.jpg","showlogo":"Y","showphoto":"Y","uid":"ROKI1319694114","status":"1"},{"id":"49","name":"Roger Kirton","title":"CEO","company":"","wphone":"309-5585","wphone2":"","mphone":"","email":"rjkirton@caricontact.com","website":"","address":"","city":"","zip":"","country":"0","cardlabel":"Caricontact Card","cardid":"c1326937414","template":"1","cardlogo":"","cardphoto":"","showlogo":"Y","showphoto":"Y","uid":"ROKI1319694114","status":"1"}]}
Please use plain text.
New Developer
rjkirton
Posts: 7
Registered: ‎01-22-2012
My Device: Torch 9800
My Carrier: bmobile

Re: JSON data not displaying on Blackberry simulator or device but displays in ripple

This is the jQuery code I'm using on the page I need the content to load:

function showCard(response){
if ( response.msg == "no cards" ) {
$('#mycards').hide();
$('#newcard').show();
} else {
var items = [];
$.each(response.cards, function(i,val){
//$('#card_name').html(response.cards[i].name);
items.push(
'<div id="'+response.cards[i].cardid+'" class="card"><table width="100%" border="0" cellspacing="0" cellpadding="5"><tr><td width="78%" valign="top">'
+ ' <span class="logo"><img src="http://www.digidex.mobi/mycards/logos/'+response.cards[i].cardlogo+'"/></span>'
+ ' <br/><span class="card_name">'+response.cards[i].name+'</span><br/>'
+ ' <span class="position">'+response.cards[i].title+'</span>'
+ ' <span class="company">'+response.cards[i].company+'</span>'
+' <br/><br/><span class="work_phone">'+response.cards[i].wphone+'</span>'
+ ' <span class="work_phone2"> / '+response.cards[i].wphone2+'</span>'
+ ' <span class="cell_phone"> / '+response.cards[i].mphone+'</span>'
+ ' <br/><span class="email">'+response.cards[i].email+'</span>'
+ '</td><td valign="top">'
+ ' <span class="photo"></span><img src="http://www.digidex.mobi/mycards/photos/'+response.cards[i].cardphoto+'"/>'
+ ' </td></tr></table></div>'
);
});
$('#mycards').html(items.join(''));
$('.card').click(function() {
// alert ($(this).attr('id'));
return false;
}) ;


}
}
Please use plain text.
Trusted Contributor
chicoxml
Posts: 227
Registered: ‎09-03-2010
My Device: Not Specified

Re: JSON data not displaying on Blackberry simulator or device but displays in ripple

try to navigate to the url from the browser of the device

Please use plain text.
New Developer
rjkirton
Posts: 7
Registered: ‎01-22-2012
My Device: Torch 9800
My Carrier: bmobile

Re: JSON data not displaying on Blackberry simulator or device but displays in ripple

[ Edited ]

Works fine using the browser on the device. Only thing is I need to make sure to use http://www.digidex.mobi/bbm and not http://digidex.mobi/bbm. I was able to view all the JSON data etc. without any issues.

Please use plain text.
BlackBerry Development Advisor (Retired)
jeffheifetz
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: JSON data not displaying on Blackberry simulator or device but displays in ripple

Hi rjkirton,

 

Sorry for being a tad slow here but I'm not sure I understand the problem? What do you mean the data does not display? Do you mean that you are not getting correct data?



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Please use plain text.
New Developer
rjkirton
Posts: 7
Registered: ‎01-22-2012
My Device: Torch 9800
My Carrier: bmobile

Re: JSON data not displaying on Blackberry simulator or device but displays in ripple

[ Edited ]

Issue was resolved. I realized an error (a real rookie mistake) earlier in the code. I left out 'http://www.mydomain.com' when I made the ajax call to my php page. Everything works now. Thanks to everyone for trying to assist with this.

Please use plain text.