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

Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Pass parameters to another page failed

As an example you can get the latest from the samples directory from the bbUI repo and modify the following


index.htm - add the following code to the ondomready function


if (params) { 
alert('foo = ' + params.foo);


js/dataOnTheFly.js - Modify the dataOnTheFly_addListItem() function to look like the code below


function dataOnTheFly_addListItem() {
	var listItem, container, dataList = document.getElementById('dataList'),
		data = {'foo': 'bar'};
	// Create our list item
	listItem = document.createElement('div');
	listItem.data = data;
	listItem.setAttribute('data-bb-type', 'item');
	listItem.setAttribute('data-bb-img', 'images/icons/icon11.png');
	listItem.setAttribute('data-bb-title', 'Title ');
	listItem.innerHTML = 'My description';
	listItem.onclick = function() {
		bb.pushScreen('grid.htm', 'grid', listItem.data);
	// Append the item


Now when you open this page (shown on the main menu as "Load Data After Showing") in the sample app and click on one of the generated list items it will open the grid list screen and the ondomready function will do an alert with the text "foo = bar"


I just tested it out and it works


Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Trusted Contributor
Posts: 100
Registered: ‎03-31-2012
My Device: Blackberry 9780
My Carrier: Telkomsel

Re: Pass parameters to another page failed

It's works........Smiley Happy

Thanks for your help...I really appreciate it....