Screen Popup problem

Hello

I need to display a popup with a message and two buttons and based on the selection of button I want to do an action.

I am able to display the popup screen with buttons. But the buttons do not update.

Please find the code below. Can someone tell me where I was wrong.

Thanks in advance.

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;

class RegPopup extends Screen {

private final static int _CUSTOM_SIZE = 150;
private final static int _ALPHA = 0xBF; // 75% alpha
private final static int _X = ( Display.getWidth() - _CUSTOM_SIZE ) >> 1;
private final static int _Y = ( Display.getHeight() - _CUSTOM_SIZE ) >> 1; 

private LabelField wait = null;
private LabelField status = null;
VerticalFieldManager vm = null;
ButtonField try_button = null;
ButtonField exit_button = null;

RegPopup() { 

super( new VerticalFieldManager(VerticalFieldManager.VERTICAL _SCROLL | VerticalFieldManager.VERTICAL_SCROLLBAR));
init();
}

private void init(){
wait = new LabelField( "Please wait ..." );
this.add(wait);
//this.setFocus();
}
public void setMessage(String message){
if(message != null){
status = new LabelField(message);
this.add(status);
this.add(new RichTextField(Field.NON_FOCUSABLE));
addButton();
changeMessage();
}
}

private void addButton(){
vm = (VerticalFieldManager)this.getDelegate();
//vm.setVerticalScroll(0);
//vm.setFocus();
HorizontalFieldManager midManager = new HorizontalFieldManager(HorizontalFieldManager.FIEL D_HCENTER | HorizontalFieldManager.HORIZONTAL_SCROLL);
try_button = new ButtonField("Try Again");
exit_button = new ButtonField("Exit");
// try_button.setFocus();

try_button.setChangeListener(new FieldChangeListener(){
public void fieldChanged(Field field, int context) {
ButtonField buttonField = (ButtonField) field;

closePopup();

}
});
exit_button .setChangeListener(new FieldChangeListener(){
public void fieldChanged(Field field, int context) {
ButtonField buttonField = (ButtonField) field;

//System.exit(0);

}
});

// midManager.setFocus();
midManager.add(try_button);
midManager.add(exit_button);

vm.add(midManager);

//this.add(vm);

}
private void closePopup(){
this.close();
}
/**
* This method repaints the screen with new Message
* Added by Koka Phani
*/
private void changeMessage(){

final Screen scr = this.getScreen();
if(scr!= null){
UiApplication.getUiApplication().invokeLater (new Runnable() {

public void run(){
try{ 

scr.invalidate();

}catch(Exception e){}
}
});
} 

}
protected void sublayout( int width, int height ) {
setExtent( _CUSTOM_SIZE, _CUSTOM_SIZE );
setPosition( _X, _Y );
layoutDelegate( _CUSTOM_SIZE, _CUSTOM_SIZE );
}

protected void paintBackground( Graphics g ) {
XYRect myExtent = getExtent();
int color = g.getColor();
int alpha = g.getGlobalAlpha();
g.setGlobalAlpha( _ALPHA );
g.setColor( Color.BLACK );
g.fillRect( 0, 0, myExtent.width, myExtent.height );
g.setColor( Color.WHITE);
g.setGlobalAlpha( alpha );
}

public boolean onClose(){
return false;
}
}

Hi all

Thanks for your time. I found the problem. Stupid mistake not having not try catch blocks to debug.

The problem is that I update the screen with calling the call later.

Once again thank you for your time.

Concerning

Koka

Tags: BlackBerry Developers

Similar Questions

  • Satellite C70 - A - 16 L - screen resolution problem

    Hello

    I recently had a screen resolution problem with my laptop (C70 - A - 16 L).
    The max screen resolution which is imparted to me is 1366 x 768, whereas before I think he used 1600 x 900.

    I tried the latest drivers, Bios, etc. and have also restored the operating system to a previous backup, as well as a new installation.
    I also tried to roll back to Windows 7 (with proper drivers). They all offer the same problem.

    This new maximum resolution display correctly - as if the LCD does not deal with the timings of 1366 x 768.
    I believe that the Panel is OK and the problem he reports the EDID information properly - to force windows to use the new resolution.

    Is there a download monitor.inf file that can be used to bypass the EDID reported by the Panel?

    Kind regards

    Antwist.

    If the right to display drver is usually installed everything should be OK.
    Have you installed Intel driver Toshiba download page 9.17.10.3062 version?

  • Screen touch problems when you use the converter

    We just bought an Envy 27 tilt to our Caravan for all the good characteristics that HP has and TV

    Cause sometimes will want to run the HP converter 12v 400 watt true sine wave.

    We tried this to find a problem, the computer functioned well but the touchscreen ran a muck and did not work as usual.

    So after much googling and some reading I'd like here to answer fo HP.

    As I can't believe, I'd be the first to come on this problem and want to put it all in one in a motor home.

    What I read, it could be a matter of dirty power of the inveter, but we thought we have purchase the best brand true sine wave, we could leave our guys of battery here in Australia.

    Any advice would be received with gratitude.

    Thanks Lou, first of all for your time and on the other hand for your thoughts and advice.

    We have it finally working outside a performance of the inverter with number.

    But I have to say without any worthy of official telephone hotline support of HP.

    Lou, I'm working through several of your suggestions, pending the official response to my survey on what brand or type of UPS or UPS I should use with my desire to tilt.

    Well, it is very sad that a massive company like HP with what you would think would be a very large R & D service, cannot answer a simple question, like what type of UPS or UPS if they recommend to work with the touchscreen of the tilt.

    The poor people, I was talking to, had no idea what I was talking about, or what I was trying to do. How a computer call center peason knows not what a UPS, I can understand on an inverter, but the tech people, these are things really very similar in the different boxes.

    OK, if you have this problem with your inverter and touch screen, first of all not all inverters are equal even in the same brand that I discovered. I want to thank my provider inverter & battery for their time and for allowing me to put in place the HP Envy of tilt on the back of their store and try different UPSs, inverters and batteries.

    I'll talk about brands here, not rat on the brand, but as it may be useful to someone else in Australia in the future. It seems that my "Epower DCAC 400w 12v true sine inverter" wasn't at the height when it came to clean AC power required to operate the touch screen without problem.

    In the end, we tried a "Epower DCAC 1000w true Sine Wave 12v', really just to give it a go, thinking it would be a better to be the same brand as the unit of 400w, well it worked quite OK

    This unit of true sine wave Epower 12 v 1000w, fixed our problem with touchscreen and ran HP Envy tilt as if it is running on AC power.

    If anyone is interested for camper here, I found this configuration to draw between 4 and 5 amperes of batteries of 12v and about 41 Watts @ runing 240 volts a you tube clip.

    Well it is my experiences and the final result, I hope this helps someone else in the future, I'm sure that HP will not be able to.

    Thank you all.

  • blue screen "possible problem with SPCMDCON. SYS

    all about office went< only="" program="" available="" and="" showing="" is="" mcafee=""> bed blue screen "possible problem with SPCMDCON. SYS '.  Hard drive reads accurately but very little available. Get pop up of the AV PROTECTION ONLINE DECLARING PAY 59.95 AND we will solve the problem. also the problem States is due KEYLOGGER ZEUS, please help

    Hello

    1. are you able to boot to the desktop?

    If you are able to boot to the desktop, run the antivirus scan and then run the System File Checker.

    Step 1: First we will analyze the system for infections using the Microsoft Security Scanner which can be downloaded from the link below:
    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Step 2: Use the (SFC.exe) System File Checker tool to determine which file is causing the problem and then replace the file. To do this, follow these steps:

    (a) open an elevated command prompt. To do this, click Start, click programs, accessories principally made, right-click Guest, and then click Run as administrator. If you are prompted for an administrator password or a confirmation, type the password, or click on allow.

    (b) type the following command and press ENTER:
    sfc/scannow
    The sfc/scannow command. analysis of all protected system files and replaces incorrect versions with appropriate Microsoft versions

    If you are not able to boot to the desktop, please start the system in safe mode and follow the steps mentioned above.

  • Screen resolution problem. Cannot set above 680 x 480.

    Screen resolution problem

    I have a dell latitude d630 2.5 GHz computer laptop under XP Professional 64-bit operating system.  The screen resolution will not be set above 680 x 480, and when I try to increase the computer stops with a black screen message that don't stay long enough onscreen to read.  Dell advised that they don't or support this machine with the XP operating system and that they have no drivers or other fixes for the problem.  I hope that you will be able to help and thank you.

    Hi dduck11,

    ·         What is the default screen of the laptop resolution?

    You need to update the graphics (video) drivers for the laptop. I see that there are Windows XP drivers available for the same thing. Download and install the updated drivers to see if it helps.

    Drivers & downloads for Latitude D630

  • Earpiece screen Popup

    Hello

    I was wondering if it was possible to

    (1) catch the event where focus is lost from the screen when pop-up screen is pushed

    (2) catch the event when focus returned to the screen when screen popup is closed.

    I looked to be implemented

    FocusChangeListener

    setFocusListener (this);

    ' Public Sub focusChanged (field field, int eventType)

    However, I understand that it snaps focus changed events from various fields in screen & focusChanged for is not triggered when the pop-up screen is pushed to the stack.

    Is this correct?

    I'm relatively new to BB JDE and I would be grateful for any help.

    Kind regards

    Bob.

    In fact, the OnFocusNotify method is probably the function you want to watch.

    -Donald

  • screen reader problems

    When you open the Yahoo home page, we get a distorted display. At the top it says problems screen reader, with line click on "disable auto updated pages" I click on it and most of the time that it takes me to a good Yahoo home page screen. Problem though is that I have to do it every time. I have lost the ability to get a good Yahoo homepage screen and forced to work to do every time I open Yahoo.

    I'm not sharing my information or be shared I know.

    How can I fix this please?

    Yahoo questions, ask Yahoo Tech Support.

    Here: http://help.yahoo.com/l/us/yahoo/search/

    http://en.Wikipedia.org/wiki/Screen_reader

    A simple search help and Support produced this one.

    Internet Explorer features, such as multimedia or page transitions, can cause screen readers to give confusing or incorrect information. Follow the steps below to disable the features that might interfere with screen readers.

    To make Internet Explorer work better with screen readers

    1. Click to open Internet Explorer.

    2. Click Tools and then click Internet Options.

    3. Click the Advanced tab.

    4. Make one or more of the following changes:

      • Place the cursor to follow the development of the screen

        If you want your screen reader or your magnifying glass to use the cursor (also referred to as theinsertion point or system caret) to determine whether to read or expand, follow these steps:

        Under accessibility, select move the slider system according to focus/selection box.

      • The text to display in place of the images

        Under accessibility, select him always expand Alt text for images of the box. UnderMultimedia, clear the show picture check box.

      • Stop page transitions causing erratic behavior in your player screen or voice recognition

        Under browsing, clear the Enable page transitions you use smooth scrolling check boxes.

        Under multimedia, clear the show picture and game animations in the checkboxes of the Web pages.

      • Help prevent the sounds of the Web page to interfere with your screen reader.

        Under multimedia, clear sounds in webpages box.

    5. Click OK.

    HTH

    If I brought you joy, vote! If I answered your question, click, propose as answer! > WT

  • Screen resolution problems (Windows 10)

    I downloaded the latest trial 9 Captivate for Windows 10 and screen resolution problems. Basically, making the software unusable. A lot of screens and dialog boxes seems larger than the current window, they are in, making the right and downstairs parts invisible window (usually, this is where the 'OK' and 'Cancel' buttons for example).

    I'm Captivate on a laptop running 64-bit Windows 10 (Sony Vaio with an NVidia GT 640 M map graphic with the latest drivers)

    Does anyone know how to fix this? Here are some examples:

    captivate1.PNG

    captivate2.PNG

    captivate4.PNG

    No retina.

    What is the size of the police on? Win10, it is often larger than 100%, which is not really necessary for your resolution, but that's a retina display. I am using Captivate on Win10, but Surface Pro and laptop have a retina display.

  • Position screen Popup (positioning)

    Hello!

    I work with the 8820 model. and the last time I tried to created screen as he takes care of not any physical display, but

    only a part of it; such as indicators (level of the dough, the GSM signal strength, clock, etc.) are still visible on the top of the screen. An example is a standard alarm application, which comes with all devices.

    However, I couldn't do - main screens still occupy all discplay. and they advised me to use instead the pop-up screens.

    I use pop-up screen, but my problem is that she is always all display. Even if I replace sublayot and try to reposition, reposition it, but the background remains white. as if I inserted a screen empty and then inserted my popup. I don't understand why.

    I need popup screen with the display as a main screen list of my application. and at the same time, I wish that it be small, such as

    the user can see clock, indicators, etc., exactly as the standard alarm application

    could you help me please?

    Thank you

    Sandrine

    Thank you all for your answers. It seems that I must make my own header like Bika suggested.

    Basically, I want to do exactly same thing as Bika described.

    but I wanted to let the system header and avoid attracting the custom header. However, it seems that if I use HeaderBar, the end result is the same.

    I tried to use
    Ui.getUiEngine () .pushGlobalScreen (new PopupScreen (vertManager), 1, UiEngine.GLOBAL_QUEUE);

    I'm not using USE_ALL_WIDTH. However, it is always appears as a small window on the big white screen which occupies
    Physics show all.

    I'll try to use HeaderBar, as it seems the only way.

    in any case, thank you all for your help.  This forum is the most useful that I've ever seen. I hope that my experience grows,
    I will pay back to the community.

    I'm marking this thread as fixed.

  • PowerBook G4 aluminum screen rendering problems

    Hello. I use an old PowerBook G4 aluminum 15 " only for some older programs that I still have, the specs are 1.33 GHz, 1 GB DDR SDRAM, an A1095 model (I think). It is currently running OS 10.4.11 Tiger.

    I am having some problems with the rendering of images, windows and icons on the screen. Sometimes, say if there is a background image, there will be pixels of a pure purple and light green color and other parts of these colors in pants plates, which will fade in-and-out in intensity. There will be a purple halo around the icons on the desktop, windows will have their underlined by violet title bar and the window itself will be celebrating also in purple. When I move these icons and windows, the outline of color moves with him - even for images with these pants patches. If I try to take a screenshot, it looks like it has taken to this effect, but when the screen goes back to normal, the images do not show fading.

    There is also a kind of shear horizontal wind that comes and goes, like a Photoshop effect, which seems to affect the whole screen - but it was did not so lately, moreso just the pants colors. The effect of shear wind or rosacea are affected by the position of the screen.

    These are intermittent problems that come and go, sometimes they may not arrive for a few hours or a few days, and sometimes they keep coming back and to stay - they also vary in intensity, sometimes just annoying, other times made the screen so bad that I have to do a hard shutdown with the power button.

    I have connected this laptop to a LED TV (via a HDMI DVI cable) when I had these patches scrambled on the computer laptop screen - and the TV screen shows very well, without tasks.

    After asking some Apple technicians, they thought it could be anything from:

    -l' screen is gone - but why would move fading when I move the images/icons/windows?

    -a bad laptop screen cable

    -video card - but she restores the fine screen image when connected to a TV?

    -memory on the logic board

    -poorly seated RAM (which I've deleted and reinstalled several times with the same results)

    Or a combination of these. They say this isn't a problem with HD.

    I understand that it is an old computer and an old technology, but I would still go back to normal, as everything else works fine. I know a guy who can replace the screen and the cable, as it seems a little tricky for me to do would not touch the video card. I'm wary about this fact, because it may be other things that causes this problem.

    In addition, the graphics card is an ATI Mobility Radeon 9700, model: ATY, RV360M11 - if it helps.

    Any ideas - thanks. (Please keep it relatively simple, if possible)

    As the connected HDTV does not have this effect, the problem is likely related to the PowerBook's display hardware.  If the problem was related to the graphics card (and 'upstream' material) or due to a software problem, waiting for HDTV to show the same effect at a time when the PowerBook display is the effect.

    You can try to do a reset PMU (power management)

    Resetting PowerBook and iBook Power Management Unit (PMU) - Apple Support

    and that he may as well do a LANDAU ('NVRAM') reset too (although less likely to cause described problem)

    How to reset the NVRAM on your Mac - Apple Support

  • Flickering screen-SERIOUS problem!

    iMAC 2007 ElCapitan 10.11.6. Trouble with the dreaded color wheel. Clean uninstalled my Mac. Don't seem to be able to start Apple Hardware Test. Make a backup last night. Now the screen continuously flickering/reload. Help please!

    Please post a report of EtreCheckof your system. We then look for obvious problems. Please click on the link, download the application and run the report. Once you have the report, please copy and paste into your response to this post.

    If you would like more information on what is EtreCheck, just click on the link and you will find a description of the application.

  • iPhone 6 s screen Passcode problem

    I just upgraded to a 6 s iPhone and the phone is really nice, a lot of improvements over my 5s.

    The only problem that I see is after I lock the phone (switch top right) and then later hit the HOME button, the screen access code flashes by briefly and I find myself at the level of the 'office' with my app icons.

    What happened to the password screen?

    Is there a parameter with a 6s phone I have to configure?  I have indeed a setup password on this phone, but the phone open again by bypassing it.

    I have experienced of her 'wake up' the phone using the lock button on the side, and it lets you slide to unlock and show the password in the screen, so it works. But hit the HOME button to wake up the phone and bypasses the security password screen.

    The phone OS is also updated.

    Any help or suggestion?

    Thank you!

    You press the HOME button with a finger that is registered with Touch ID, that opens the phone. Try pressing it with a pencil eraser.

  • Black screen / display problems

    I have a MBPR13"(early 2015) which I think has integrated graphics intel 6100.

    I've been running windows via bootcamp on the mac since I bought it, first with win8.1 and for a year or two, win10. A couple of weeks, however, windows crashed and wouldn't start. I can boot into safe mode after 3 failed attempts at normal mode, but I couldn't diagnose the problem. I took the opportunity to carry out a complete new installation of OSX and Windows 10.

    However, while OSX continues to work very well, Windows 10 still will not work. It installs successfully, and then gets to the point where the wizard Bootcamp installs all the drivers - it seems to be ok until that display then goes off - I guess that's the point where the display drivers are installed. Windows is still underway, but all I get is a white screen.

    After much mucking to plug and unplug the screens I can sometimes get an image on an external monitor or on the built-in screen. The computer screen does not fill the screen (bottom 25% of the screen remains empty) and windows cannot detect both screens at the same time. In any case, in a few seconds to lift an image on the screen, windows crashes and restarts.

    I suspect that it is a driver problem, probably related to a recent windows update - note my new installation is based on the current windows (as of today ' hui) 10 ISO download available from microsoft, so I guess this includes all applicable updates and I have no way to drive to a previous version.

    Can someone from apple what comments can you do on this point, hopefully identify that it's just a driver problem and update the bootcamp windows software support for my MBP so I can get Windows successfully facing up and running? Otherwise, any other suggestions on a fix?

    Thanks in advance

    Mike

    Updated - uninstall the display driver Intel 6100 temporarily solves the problem (of a point - the works of laptop display once again, but of course without hardware acceleration or connectivity external monitor), although 10 windows automatically reinstalls the drivers a few seconds later, resulting in the return of the issue.

    I was able to continue to use the laptop only by disabling the graphics card. However this clearly is not a solution, but simply points to the fact that the display driver is the issue.

    Everything apple comments? Surely, this affects a lot of users and not just me? Is an update to the driver on the way?

  • Qosmio F750 screen replacement problems

    Hi all

    I hope you can help me,

    I just replaced the display on my Qosmio F750 which unfortunately took out of warranty two weeks ago so I do not qualify for support.

    When I replaced the screen I followed all standard procedure to replace any screen,

    But for some reason, now, the screen didn't come on come (everything works when plugged into HDMI).

    There is no backlight or image on the screen, I tried mounting the old screen and that also does not work.

    Any help at all would be much appreciated.

    Thank you all,

    Gavin

    Hello

    Are you sure that the new screen is OK and compatible?
    The screen is connected correctly?

    I guess there is nothing wrong with the motherboard or the graphics chip because the external monitor seems to be OK.
    That's why I think that it s to display either a connection problem, or maybe you used wrong or defective.

  • Page of Yahoo mail that says 'there a screen resolution problem". A in case of problems with all stakeholders, even all the browsers. The question is Firefox!

    I have the latest version of Yahoo mail. When I click on the link "mail" of my Yahoo homepage, he directs me to a page that reads, "There is a problem of screen resolution". In the body of this page, it explains how to fix the problem. BUT, I don't have a problem with the resolution - the screen resolution should be 1024 x 600 or greater and IT IS! This only happens with YOUR browser. I have Chrome and IE, neither of which is a problem. I worked with a representative of the yahoo mail support and he explains that it IS a problem with Firefox and for raise you awareness and fix the problem - I use a Vista operating system on a computer and Windows 7 on my other computer, which has the same problem, so we KNOW for sure, it's a Firefox issue.

    I don't think that the effects of this question all those who use Firefox because I'm able to visit Yahoo Mail without any problems. I would say that to reset the zoom of the page on the page, this issue occurs on. You can do these steps go to view > Zoom > reset or press (Ctrl + 0 (zero).

Maybe you are looking for

  • 30 Firefox unresponsive

    Firefox seems to have stop at intervals and at random times. The only way to fix it is to stop the process in Windows Task Manager, and then restart Firefox. When I do Windows (XP) gives me a crash report that has no container Firefox plugin. Any ide

  • Help to export my contacts from my laptop IPad2

    I have a new IPad2 and want my contacts exported from my laptop Help!

  • BlackBerry smartphone charging by induction

    No facilities exist for charging the battery of dtek50 induction

  • Why is this anchor on the side?

    Hi all!I hope someone could help me solve this problem of anchor point in adobe illustrator CC because it is very difficult align objects with this anchor on the left side (see arrow pointing towards the anchor point). Is it possible to reset back to

  • stop the music, if another music starts

    Hello, sorry if my bad EnglishHow can I do-Click the button 1, another stop of music and music 1 start-Click the button 2, another stop of music and music 2 start-Stop all button clicks, all stop music