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
Regular Contributor
zumwaltwood
Posts: 81
Registered: ‎01-14-2011
My Device: Curve 8530

how do i.. busy working?

How do I place a 50% transparent window over the full screen with the built in "working" graphic, so basically when I kick off an event to load or save data, it takes a few seconds to do the work, between 1 second and 10 seconds, while it is working, I want the user to see some sort of "working" graphic that covers the screen.

BlackBerry Java JDK 6.0.0.30
BlackBerry Java Plug-in 1.3.0.201101051005-15
BlackBerry JRE 6.0.0
Eclipse: Helios

Please use plain text.
Developer
indusBULL
Posts: 207
Registered: ‎09-10-2010
My Device: Not Specified

Re: how do i.. busy working?

have you looked at this excellent tutorial:

 

Sample "Please Wait" screen

Please use plain text.
Regular Contributor
zumwaltwood
Posts: 81
Registered: ‎01-14-2011
My Device: Curve 8530

Re: how do i.. busy working?

Thanks for the link, looking through it, will know in the next day if it helps.

 

BlackBerry Java JDK 6.0.0.30
BlackBerry Java Plug-in 1.3.0.201101051005-15
BlackBerry JRE 6.0.0
Eclipse: Helios

Please use plain text.
Developer
ahsanshaikh
Posts: 63
Registered: ‎10-25-2010
My Device: 9630

Re: how do i.. busy working?

Hi ,

 

 

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

public final class ConnectingScreen
{
   
   private DialogFieldManager manager;
   private PopupScreen popup;     
   LabelField lblFld;
   HorizontalFieldManager hh ;
   String showStr=null;
   public ConnectingScreen()
   {         
       
   }


   public void addProgressBar(String showStr)
   { 
        try
        {        this.showStr = " " +showStr;
                 manager = new DialogFieldManager(Manager.USE_ALL_WIDTH);
                 hh =  new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);
                 lblFld = new LabelField("  "+showStr);                
                
                 hh.add(lblFld);
                 manager.addCustomField(hh);

                 popup = new PopupScreen(manager)
                 {
                 };
                      synchronized (UiApplication.getUiApplication().getEventLock()) 
                        {
                             UiApplication.getUiApplication().pushScreen(popup); 
                        }   
                 
          }catch(Exception e){}              
     
   } 
   public void closeProgressBar(){
      
           synchronized ( UiApplication.getUiApplication().getEventLock()) 
           {
                    
              UiApplication.getUiApplication().popScreen(popup);   
              UiApplication.getUiApplication().relayout();
           }
                        
    }
  
}                            

 

 

 

ConnectingScreen connecting = new ConnectingScreen();
connecting.addProgressBar("Connecting");

connecting.closeProgressBar();



 

 

 

Please use plain text.
Regular Contributor
zumwaltwood
Posts: 81
Registered: ‎01-14-2011
My Device: Curve 8530

Re: how do i.. busy working?

Do popup screens just not work on the 9800 simulator?

BlackBerry Java JDK 6.0.0.30
BlackBerry Java Plug-in 1.3.0.201101051005-15
BlackBerry JRE 6.0.0
Eclipse: Helios

Please use plain text.
Regular Contributor
zumwaltwood
Posts: 81
Registered: ‎01-14-2011
My Device: Curve 8530

Re: how do i.. busy working?

[ Edited ]

Guess I will have to keep beating on this until I have some sort of working solution, I can't get his example to work nor can I get a working example of the tutorial to work with the animated gif, in neither case does the working screen show up on top of the existing form.

 

With his code, I tried:

String searchValue = efSearch.getText().trim();
ConnectingScreen connecting = new ConnectingScreen();
connecting.addProgressBar("Pulling Search Results");
String results = service.FetchAccount(searchValue,"ServiceTest");
connecting.closeProgressBar();

 No luck, e point that pauses in my program that I want to have the popup is on the fetch.. so then I tried a different route and created a runnable class based on that 3 step tutorial, again, nothing, even pushed them out to my Curve, everything "works" but no popped screen.. *scratches head* guess I will go with a backup plan and replace the "Search" button with an animated gif, then when the search is done, switch that back for the button.. not sure yet.. still playing with it

 

 

BlackBerry Java JDK 6.0.0.30
BlackBerry Java Plug-in 1.3.0.201101051005-15
BlackBerry JRE 6.0.0
Eclipse: Helios

Please use plain text.