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
Developer
Posts: 332
Registered: ‎04-04-2012
My Device: BlackBerry Z30/Z10/Z10LE/Q10/PlayBook

bbUI.js - Master Detail Example

[ Edited ]

  I have a question about the bbUI.js (0.9.3) Master Detail example.

 

  In the masterDetail.htm  and masterDetail.js files, where are the masterDetail_initialLoad, masterDetail_onResize, masterDetail_getHeight, and masterDetail_onUnload functions called? Are they implied in the bbui-0.9.3.js by the pushScreen function? 

 

  I looked for documentation, but since this is new, I couldn't find it?

 


Developer
Posts: 314
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha

Re: bbUI.js - Master Detail Example

[ Edited ]

Hi Bluenoser

 

The masterDetail_initialLoad function is called in the index.html file

 

onscreenready: function(element, id) {
	if (id == 'dataOnLoad') {
		dataOnLoad_initialLoad(element);
	} else if (id == 'masterDetail') {
		masterDetail_initialLoad(element);
	}

That will call the others functions.

The unload i'm not so sure.

The script line in the masterdetails html file is

 

<script id="masterDetailJS" src="js/masterDetail.js" onunload=""></script>

I'm not sure if it automatically detects the unload function or if someone forgot to put it there :smileyhappy:

Tim Neil is the person to answer this.

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

Re: bbUI.js - Master Detail Example

My bad... the onunload of the <script> tag is supposed to be assigned to this function.  I logged a bug for this and will fix it this morning

 

https://github.com/blackberry/bbUI.js/issues/226

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter