Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

TitleBars bb-back and bb-action doesn't work on BB10 #734

Closed
igorcosta opened this Issue · 8 comments

2 participants

@igorcosta

I'm using lastest BB10 1.0.4.11 OS and lastest BBUIjs 0.9.4

https://github.com/blackberry/bbUI.js/wiki/Title-Bars

onactionclick

According to docs, I could use the event onactionclick


$("#myDiv").onactionclick = function(){
bb.pushScreen('nextScreen.html', 'nextScreen');
}

Actually doesn't fire any events and doesn't work

Other thing is the

Back Button

Every time I use the data-bb-back, to return to previous screen, my App closes.

Any known issue around theses behaviors?

@tneil
Owner

You're using 0.9.4??? The latest is v0.9.6.x

Have you tried using it?

@igorcosta

Ok

Updated to bbUI VERSION: 0.9.6.67

But still same thing.

@tneil
Owner

Where are you running your code.... Before the DOM is loaded (onscreenready) or after the DOM is loaded (ondomready) ?

@igorcosta

Update to lastest one 0.9.6.67 and back event works.

Only relays on problem onactionclick Still buggy.

Tneil, is a better approach to do such this for titleBars?

div data-bb-type="titlebar data-bb-caption="Title goes here"
div data-bb-type="title-actions"
div data-bb-type="button" data-bb-back="true" onClick=handler();" /div
div data-bb-type="button" data-bb-action="true|false" onClick="handler2();" /div
/div

As my understand Title screen are containers.

@tneil
Owner

I think the issue might be related to the way you are setting the event... Not sure what object jQuery is returning for you and where it is assigning the events. Have you tried it with a getElementById('myDiv') instead of the jQuery code?

@igorcosta

Ok, got working. Problem was with the bbuijs file.

Line : 4752

button.onclick = function() {
if (this.titleBar.onactionclick) {
this.titleBar.onactionclick();
}
};

Changed to :

button.onclick = function() {
if (!this.titleBar.onactionclick) {
this.titleBar.onactionclick();
}
};

And worked.

@tneil
Owner

hmm.. that's strange. The question is with the existing code, why it isn't evaluating to true, considering the next line of code can call the function.

@igorcosta

I do really have no idea, but worked for me, maybe something related to my code. the eval was not working on current code base.

@tneil tneil closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.