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

Native Development

Reply
Highlighted
Developer
Posts: 134
Registered: ‎04-12-2013
My Device: BB Z10
My Carrier: Telenor

Display a page on top of another

Hi,

In my app, there is a login page for the user to get authenticated. When the user is in a page and trying to access some data by pressing a button, a login page should be shown to the user if he is not logged in. This pogin page should be displayed as a overlay on top of the current page. How is it possible ?

Please like this if you are answered.
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Display a page on top of another

Developer
Posts: 134
Registered: ‎04-12-2013
My Device: BB Z10
My Carrier: Telenor

Re: Display a page on top of another

Thanks,. that works.. !!! but, is there any way to show the login page as smaller in size that the background page ? like, jus to show that this page is on top of the previous page?

Please like this if you are answered.
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Display a page on top of another

Developer
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: Display a page on top of another

I second using a Custom dialog, or possibly look into using a Prompt. There is one set up for login credentials: https://developer.blackberry.com/cascades/documentation/ui/dialogs_toasts/prompts.html

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Developer
Posts: 134
Registered: ‎04-12-2013
My Device: BB Z10
My Carrier: Telenor

Re: Display a page on top of another

[ Edited ]

I used a custom dialog. I have a container with max and min height and width and I use that as the over lay prompt. But  it doesnt look good. I mean, since it doesnt have the shadow under the borders, the look n feel of this dialog is bad.. 

 

Now, how to skip this prompt? If the user doesnt want to enter the credentials and want to skip the login page, how does he go back? clicking on outside the prompt should dismiss the page. but how do we do that? 

Please like this if you are answered.
Developer
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: Display a page on top of another

You have to code in the shadow yourself... so  if you make the Dialog the full size of the screen with a background something like:

background: Color.create(0.0, 0.0, 0.0, 0.5)

And you can have your "box" on top of that. Illustrated in my screenshot posted in this article: http://bbcascadescode.tumblr.com/post/46623882388/dissecting-the-app-visual-connection

 

Then to have an "exit" button you can handle that multiple ways:

1. Have a Button with onClicked: yourDialogName.close(); the dialog

2. If you want to have it if the click anywhere outside of your "box", apply an onTapped gesture to that area that fires yourDialogName.close();

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan