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

Java Development

Reply
Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified
Accepted Solution

How to Lock/Disable fields while screen is loading?

Hello,

 

I am looking to "lock" or "disable" everything on the screen everytime that I call setStatus(). The concept behind this is that I want to use setStatus() to tell the user when the screen is loading. While it is loading, I don't want the user to be able to do anything. Is there a specific way to do this?

 

Thanks!

Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to Lock/Disable fields while screen is loading?

several ideas:

- replace all fields with non-editable versions (lots of effort)

- use cutstom fields that have methods for this

- disable navigation-methods and keychar etc while loading

- show a modal screen that cannot be dismissed

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: How to Lock/Disable fields while screen is loading?

Hi Simon,

 

I have created a new loading screen to appear anytime that I do not want the user to be able to do anything. I am interested in implementing one of the following:

 

- disable navigation-methods and keychar etc while loading

- show a modal screen that cannot be dismissed

 

My loading screen extends MainScreen. When I open the loading screen with pushModalScreen(), it seems that I am still able to close out of it by hitting the escape key or by hitting Menu > close.

 

I tried to disable the navigation/keychar() methods with:

 

 

public boolean keyChar(char key, int status, int time) {
	return false;
}

protected boolean navigationClick(int status, int time) {
	return false;
}

 But this does not seem to work, either. I can still exit from the escape and menu keys. Can you offer any further suggestions?

 

Thanks!

 

Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to Lock/Disable fields while screen is loading?

overwrite onClose to return true, this will disable closing the screen. no need for the navigationclick or keychar then.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: How to Lock/Disable fields while screen is loading?

That works for me, thank you!

Trusted Contributor
Posts: 114
Registered: ‎10-21-2010
My Device: Bold 9650
My Carrier: Develper

Re: How to Lock/Disable fields while screen is loading?

Hi, If I want to lock Menu, what must i do? Thanks !

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to Lock/Disable fields while screen is loading?

As this is a different question, I suggest you post this on a new Thread. 

Trusted Contributor
Posts: 114
Registered: ‎10-21-2010
My Device: Bold 9650
My Carrier: Develper

Re: How to Lock/Disable fields while screen is loading?

Thanks peter_strange, but i have found other way to resolve my problem