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
Trusted Contributor
bertho_joris
Posts: 100
Registered: ‎03-31-2012
My Device: Blackberry 9780
My Carrier: Telkomsel
Accepted Solution

[Help] Image Can't be Load

I got a problem in my application using bbUI is not able to get images on my server.
All the data I want to show I've got but only images that do not appear, but in my ripple emulator runs fine. But after I install it on my blackberry OS6 did not work as I want.


Please see pictures below (Ripple Emulator) :
http://s8.postimage.org/v4swuoo5h/success.png
 

Please see pictures below (Real Device OS6) :
http://s15.postimage.org/v8xpqr3vv/fail.png

 
For my code retrieve data from the server, I use jsonp library like this :
http://pastebin.com/wWBFCG6K

 

 

And my code :

function NowPlaying_initialLoad(element) {
	setTimeout(NP_loadAfterTimeout,15000);
}

function NP_loadAfterTimeout() {
	document.getElementById('waiting').style.display = 'none';
	NowPlayingProses_initialLoad()
}

function NowPlayingProses_initialLoad() {
	
	var url = "http://berthojoris.com/developer/services21/DataReadNP.php";
	JSONP.get(url, {}, function(response){
		var listItem, container, dataList = document.getElementById("dataList"), 
		str = "", 
		str2 = "",
		str3 = "",
		str4 = "",
		str5 = "";
			for ( var i = 0; i < response.length; ++i ) {
			str = response[i].judul;
			str2 = response[i].fetch_date;
			str3 = response[i].id;
			str4 = response[i].img;
			str5 = response[i].desk;
					
			var re = new RegExp("^(http[s]?://|ftp://)?(www\.)?[a-zA-Z0-9-\.]+\.(com|org|net|mil|edu|ca|co.uk|com.au|gov)$","g");
					str4.replace(re, "");


			listItem = document.createElement('div');
			listItem.setAttribute('data-bb-type', 'item');
			listItem.setAttribute('data-bb-img', str4);
			listItem.setAttribute('data-bb-title', str);
			listItem.innerHTML = str5;
			container = document.createElement('div');
					container.appendChild(listItem);
					bb.imageList.apply([container]);
					dataList.appendChild(container.firstChild);  
					if (bb.scroller) {
						bb.scroller.refresh();
					} 
				}	
	
	});
}

 Are there any that should be added to my code?

Regards,
Bertho
Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: [Help] Image Can't be Load

Could you paste your config.xml? 

 

You will probably want to start by making sure you have the access param setup like this:

 

<access uri="*" subdomains="true" />

 

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Trusted Contributor
bertho_joris
Posts: 100
Registered: ‎03-31-2012
My Device: Blackberry 9780
My Carrier: Telkomsel

Re: [Help] Image Can't be Load

Yes ... I have done

Regards,
Bertho
Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: [Help] Image Can't be Load

Do you have any simulators installed (os7 or higher) that you could install the app on?  If you use Remote Web Inspector I have a feeling this could be rather easily solved.  It'll give you the ability to debug it on either a live device, or simulator.

 

You can watch the Network traffic, see if it's getting a good response, and even inspect the actual list elements, to see what the source of your images are being set as.  

 

https://developer.blackberry.com/html5/documentation/web_inspector_overview_1553586_11.html

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Trusted Contributor
bertho_joris
Posts: 100
Registered: ‎03-31-2012
My Device: Blackberry 9780
My Carrier: Telkomsel

Re: [Help] Image Can't be Load

[ Edited ]

The case is Solved...:Cowboy:

After I checked it turns out the problem is the connection to my server problems. And I have to fix it.

Regards,
Bertho
Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 614
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: [Help] Image Can't be Load

Good to know.  Thanks for the update.

 

 

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.