How to refresh uicomponents in the background thread?

12.1.3 Jdev

Hello, how do I update a component in the background thread?

I have a utils that refresh method

{} public void listener (ActionEvent event)

refreshComp ('pb1');

} / / This is the refresh

{} public void listener (ActionEvent event)

R runnable = new Runnable() {}

@Override

public void run() {}

refreshComp ('pb1'); nullpointer

}

};

Test thread = new Thread (r);

test. Start();

} / / not a refresh

Method to utils:

FacesContext.getCur... addPartialTarget (JSFUtils.findInRoot (id))

No, there is not.

This is the web application, so there are significant differences comparing to desktop applications and things must be implemented in a different way.

Dario

Tags: Java

Similar Questions

  • How to check that my application is in the context of the background thread

    I'm listening to push into the background thread, but I want to receive the push only when the application is in the background, and then how to check that the app is in the background

    check if it is listed in http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/ApplicationManager.html...

  • complete execution while the background thread runs

    After the passage of TestStand 4.1 in 2012, I see an interesting problem.

    I start a MainSequence via the SinglePass execution entry point using the parallel model. In ProcessSetup (in the execution of N), I start a background thread that performs certain tasks for viewing. Then the model passes by "Initialize TestSockets" and starts my MainSequence (in year N + 1).

    While the MainSequence is running, run N hangs in ParallelModel.seq > Single Pass, step "Wait for TestSockets", as it should. Usually, when the MainSequence is over, puts an end to execution and execution N goes to the next step "Check to terminate" and some time later, it passes through ProcessCleanup - where I'd send my background thread notification to stop.

    It works as long as I do not start the background thread. But when this thread is running, the execution of N + 1 never leaves the MainSequence. I arrive at a breakpoint at the end of MainSequence, ahead, and then all executions are happily showing a green light and continue to operate on. So running N never leaves "Waiting for TestSockets" and never reaches ProcessCleanup, so my son does not receive the signal of endpoint etc.

    But I distinctly remember that it worked in TestStand 4.1, and anyway, I don't understand this. Why, a background, started in the execution of N, thread prevents the execution of N + 1 to terminate?

    Concerning

    Peter

    "When execution starts a sequence in a new thread (not waiting for the thread to finish at the end of the sequence), should take care at the end of his MainSequence wire in order to put an end to herself in order for execution to terminate?"

    What do you mean by terminate? Process templates are not normally completed executions. Do you mean, "all discussions in an execution must complete before the end of the execution?"? If so, then the answer is Yes.

    I'm not completely your explanations above. I'm not sure what you mean by signs, but I think you're misunderstanding what terminate means in TestStand. Termination occurs only when a user explicitly requests a run to finish (e.g. finish all) or your sequence has an action to complete or by program initiates a terminate. Without endpoint explicit that past, executions normally end when all threads are finished executing. If you are spawning runs and new threads, you must come up with a mechanism to let them know when they have to leave. I do NOT recommend relying on or using termination for this. Termination is as abandoned (but with a cleaning), it is not intended to be something that happens in the normal flow of execution. There are several ways to tell your worker when all discussions. Perhaps this posting you are referring to is a way. You can also use a notification teststand step, or a Boolean value in reference parameter.

    Hope this helps to clear things up,

    -Doug

  • The background thread alert does not work

    Hello

    I have read the article http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/... and followed the instructions to display the background thread alert. However, the alert is not displayed and IU locks (freezes). Specifically, the event of click/touch does not work, but the background thread continues to run.

    Structure of my program. The main class (with the main function) extends UiApplication. I create in the function main instance of the class that extends the Application. This class starts backgorund wire. I am missing something or making the wrong way?

    Sorry I have expired, I was going to write a long response to this.

    But in short, remember that your automatic boot process and your user interface process, both through main with different parameters and are the BlackBerry is concerned, different applications.  So it may be an Application, the other can be a UiApplication, and both can enterTheDispatcher.

    No two instances of the same Application, they are two different Applications.  They can be of different instances of the same Application class, but it is a special case.  It depends on what you create in the main routine.

    You can play a merry dance with such things.  For example, having a UiApplication be started by the automatic boot process, and then the boot gui process can find it and just put in the foreground, rather than creating a new UiApplication.

    Generally however people create a request and a UiApplication.  The problem with the use of these different applications, is that things like static are not shared.  Therefore, use something like RuntimeStore to share data.  It is a pain and something that if I can avoid.

    It is perfectly possible to have a UiApplication, which starts when the device starts, runs Background Threads that are working in a network and is bought in the foreground by clicking on an icon.  Code is more complicated, but not much.  And you must have complicated the code when you run the network Threads background to deal with the unit off power and then power anyway.

    Hope that clarifies somethings.

  • Tracing a png - how to get rid of the background

    I imported a png image of a simple drawing of a man in black (as you can see on a bathroom door) with a transparent background and tried to trace it to a vector, but I can't get rid of the white background. I tried it in jpeg format to see if the route command would generate two thicknesses for the main drawing and one for the background that I could remove, but he di awaters. I tried to adjust the fuction just Trace expose but does nto work no more.

    Can someone tell me how to get rid of the background by drawing a simple image or to break the object to get the shape of the background?

    Kevin

    Use Expand in the menu object and then use the direct Selection tool to select the white and remove. You will need the transparency grid show be enabled in the view menu to see it.

  • Problem chart/getting updated when you press on the background thread notification dialog box

    I have a user who is graphical reports strange behviour after our request and only under the following condiitions alarms:

    1 sets of users clock back to trigger the alarm

    2 user locked the BB

    3. the user receives alarm 1 minute later

    4. the user unlocks the BB

    The strange behavior is that the background seems to resemble a back buffer bland with a rectangular hole where the notification dialog box should be.  The user clicks then the graphics and where the button should be back to normal.

    The question is not if the user does not lock the BB first - it's only under the condition of deadlock that the problem occurs.  The user statement also sometimes see a dialog "Please wait" when running our application after unlocking, but never when our application is stopped.

    Model is 8310 with 4.5 and approximately 3 MB of free space depending on the situation-> filefree.

    The dialog box is to be generated and added to the queue by a background thread using the following method:

        private void notifyUser(String msg) {
            UiEngine ui = Ui.getUiEngine();
            EncodedImage icon = Theme.getIcon(false, true);
            Bitmap bm = null;
            if (icon != null) {
                bm = icon.getBitmap();
            } else {
                bm = Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION);
            }
            synchronized (Application.getEventLock()) {
                Screen screen = new Dialog(Dialog.D_OK, msg, Dialog.OK, bm, Manager.VERTICAL_SCROLL);
                ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_SHOW_LOWER);
            }
        }
    

    I checked the problem does not occur on the "BOLD", Pearl Flip, or 8100 with real hardware.  The problem never happens in simulators (tried about 6 models).

    Any thoughts?  Is there something wrong with the code above or spark a dialogue for a non-event like this thread?

    Thanks in advance...

    The workaround for the "locked" State is to implement MemoryCleanerListener in your main application class. This listener is notified when the device is locked. We define a property here "deviceWasLocked", then query this property of our custom popup dialog to determine if we arrive on a locked screen.

    Then we switch our application in the foreground (requestForeground) that clears up this particular issue, and any event goes well.

    The problem of 'missed calls' is a little more complicated, unfortunately, but you're not complaining that one!

    Having said all this, I'd love to see other ideas on how to solve this problem. We strugggled for several weeks with this problem when the 4.3 is released.

  • ControlledAccessException while audio playback in the background thread

    I have a system module which is a background thread, who plays one of the ringtones pre-installed on the device. It works great in the Simulator, but on my real device (8320, 4.5.0.81, Tmobile), a ControlledAccessException is thrown and of course, plays the audio.

    The application is signed code, I tried to set all the permissions of the application to 'Allow' and nothing has worked.

    The following code fragment, that's where the exception seems to be happening:

    Player p = javax.microedition.media.Manager.createPlayer("file:///store/samples/ringtones/Alarm_EarlyRiser.mp3);
    p.realize();
    p.prefetch();
    p.start();
    

    I was hoping that among the people of the RIM (or someone else) could point me in the right direction regarding, why this is happening and how to fix this.

    Thank you

    Okay... got official word from [email protected]:

    "It is not possible programmatically to other applications pre-installed media files read, because they are encrypted DRM"

    So that answers that.

  • How to run VI in the background and save system resources

    Hello

    I want to develop an application (pc, windows 7) that checks the line port DSR series every 100 MS basically, I know how to create a VI that works with serial ports using VISA drivers. My request or my VI must be invisible to the user, and a variable DSR everytime level incrementing counter is high.

    What is the best way to create a VI that runs in the background (invisible to the user, not even shown minimized in the taskbar). Given that the application needs to run most of the time, when the pc is running, I don't want to use too much computer resources (cpu, memory on an average desktop pc). The user should be able to work with other applications like ms office, during execution of the VI in the background.

    LabVIEW is appropriate create a background VI which periodically checks the serial port and consumes system resources minimum or are languages like c ++ much better suited to save system resources? What is the best way to create an invisible VI that is running in the background?

    Thank you very much for your help!

    Tom

    On any modern hardware, the difference in the use of resources among a LabVIEW application and written in C++ for a simple task like this will be minimal. Anyway that you use a fraction of the time CPU available if the application is written correctly.

    To run an invisible VI in the background, see user-defined execution of a LabVIEW Application as Windows Service.

  • How to prgrammatically to change the background color of a 'number' inside a cluster control

    Hello

    using a property node, it is possible to change the background color of a control number.

    But how to do this, if this number control is inside a cluster? I would not have found the property to the background color (see attached vi).

    Thank you very much and best regads.

    Michael

    P.S.: I use a reference, because the color change must run inside a Subvi.

    Hi Michael,

    Insert a function "to the more specific" and connect the digital constant refnum. I modified a bit your vi.

    See attachment.

    Mike

  • push the two overall display of the background thread

    Hello

    I am pushing GLOBAL SCREEN of my background thread using synchronized (Application.getEventLock ()).

    Now, I want to push another SCREEN on this GLOBAL SCREEN.

    But the new SCREEN is not visible on the GLOBAL SCREEN.

    Please help me

    When you push your overall screen make sure that you also provide a priority:

    pushGlobalScreen (aScreen, PRIO_as_INT, UiEngine.GLOBAL_SHOW_LOWER);

    where 0 is the most high prio (always on top)... I use it to mix screens above the other... Screens with the same priirity will display above the other - the last pushed to win...

  • Image of drawing to the screen in the background thread?

    I have image data that comes out of a background thread, and I want to be able to write in a ForeignWindow (or some other window QT I guess... I don't know QT very well). What would be the best way to do this? Is there a good sample somewhere?

    Nevermind, just found the HelloForeignWindow example:

    https://github.com/BlackBerry/Cascades-samples/tree/master/helloforeignwindow

  • Application with the background thread

    IDE: Blackberry JDE Version 4.5.0.7

    Simulator: About us - Smartphone BlackBerry 2.9.0.52 Simulator

    Model: BlackBerry Curve 8310 smartphone

    Hi all

    I have an application that, after installation on the BlackBerry must be selected in the application menu only once and will run continuously until it is uninstalled from the device. Code looks like this: -.

    public final class app_name extends Application {   private BackGroundThread _thread;
    
       public static void main(String[] args) {        app_name app = new app_name();        app.enterEventDispatcher();    }
    
        public app_name() {        _thread = new BackGroundThread();         _thread.start();    }
    
        private class BackGroundThread extends Thread {
    
             public BackGroundThread() {            /***initialize parameters in constructor*****/        } 
    
             public void run() {             while(true) {             /*****do stuff using parameters*****/             sleep(10000);           }         }     }}
    

    This code works well. Now, I have to add a user interface that allows the user to change some of the parameters that are used in the thread.

    (1) as a first step, I have to change application to UiApplication to allow pushScreen to use. Since it's a subclass, I would have no problem with this law?

    (2) to get the UI goes, my plan was to declare another class (extends screen) within app_name. What is the right way to go?

    (3) parameters must be manipulated such that there is no risk of conflict of data didn't pack the thread class and the class screen try to access settings at the same time. So using the semaphore will be a good strategy?

    (4) any other questions I may be brought to face or is it better to do this quite differently? I wonder if the instance of the thread class will actually be run side-by-side in the user interface and if the user interface to stop smoking will actually affect the Backgorund thread anyway. It might be better to create a completely separate application for the bit of UI that can access this application settings, but I don't know how to do this.

    My apologies for the long post. Any help will be greatly appreciated.

    Hello

    PersistentObject is synchronized, so that it will not conflict data. You can search for "BlackBerry_Application_Developer_Guide_Volume_2" which has the details of the store persistent in the section "persistent data storage.

    Thank you.

  • Multiple instances of Application when you use the background thread

    Hi all

    I recently added a background thread in an application that is launched from an other point of entry. This background thread will constantly (every X seconds) carry out checks of RMS and compares the timestamps. When recalcitrant, he sends a notification to the user who launches the application when clicked. The problem is...

    When the user clicks on the notification, it will open the application normally (with the icon and everything), but it also opens a second instance that does not have an icon. I have concluded that the code that actually launches the request isn't the culprit (because if I take out, it nevertheless opens the second instance). This makes me think that it has something to do with the ApplicationDescriptor.

    My notification Manager has this line:

    ApplicationDescriptor appDescriptor = new ApplicationDescriptor (ApplicationDescriptor.currentApplicationDescriptor (), application name, new String [] {});

    If I change this to only return the currentApplicationDescriptor() or add the arguments in the array of strings, notifications do not work.

    Can anyone think of a reason why this is happening?

    I solved the problem I had.

    In the end, I ended up changing this code:

    final ApplicationDescriptor mainDescription = ApplicationDescriptor.currentApplicationDescriptor ();
    final ApplicationDescriptor appDescriptor = new ApplicationDescriptor (mainDescription, application_name, new String [] {});

    TO:

    moduleHandle int = CodeModuleManager.getModuleHandle (APPLICATION_NAME);
    ApplicationDescriptor mainDescriptor;

    If (moduleHandle! = 0)
    {
    ApplicationDescriptor apDes [] = CodeModuleManager.getApplicationDescriptors (moduleHandle);
    apDes = mainDescriptor [0];

    ApplicationMessageFolderRegistry folderReg = ApplicationMessageFolderRegistry.getInstance ();

    If (folderReg.getApplicationFolder (NotificationManager.INBOX_FOLDER_ID) == null) {}
    notificationManager.init (folderReg, mainDescriptor);
    }
    }

    Instead of using the currentApplicationDescriptor(), I was referencing the module of the application itself using the CoreModuleManager. My init method takes in the ApplicationDescriptor and use it for everything.

    Thanks to all who have any time to read my post!

  • How to fix so that the background makes the text color?

    I'm creating a logo for a friend. And I need to get the color of the background in the color of the text. But I have no idea on how to do it. Someone at - it ideas?

    So basically, I need to take the forms but keep the color in the text.

    help1.png

    Simon,

    You can keep the direct Type (no need to present the text), and then simply select all (no need to group together the underlying objects), then object > clipping mask > make (Ctrl/Cmd + 7).

    If you want to have the strokes on the letters, deselect, then click anywhere on the guy with the direct Selection tool and apply to the race.

  • To access the aggregate Interface customized with KAppBoss in the background Thread

    My aggregate of IID_ABCIINTERFACE custom KAppBoss Interface.

    When I do this

    IApplication* iApplication = GetExecutionContextSession-> ()QueryApplication();

    IQPSAssetCacheManager InterfacePtr<IQPPDPAssetCacheManager> (iApplication, UseDefaultIID());

    AbcInterface InterfacePtr < ABCInterface > (iApplication, UseDefaultIID());

    abcInterface-> xyz();

    hand thread without problem but even of the background gives thread point abcInterface to Null & crash.

    Background threads have a separate session which provides that model interfaces.

    Move this cache to a model plugin Manager.

    Make sure you also it can co-exist with multiple instances of itself - there is one per session.

    Edit: I just realized that you were talking about kAppBoss.

    Most interfaces on kAppBoss are UI anyway, so I guess (without knowing for sure) he is stripped in the same way.

Maybe you are looking for

  • UltraBay HD missing in wake up with Windows 10, T530

    Hello Since I changed to Windows 10 (new installation), sometimes the HARD drive in the Ultrabay slot gets detached after wake up from sleep. First of all, I can hear it lights, then it turns off and a notice told me that the HARD drive has been remo

  • HP ProBook 6550 portable PC b: Re: RAM laptop HP ProBook 6550 b Upgrade issues.

    Info on my ProBook 6550 b HP PC: Intel Celeron P4600 @ 2.00GHz CPU 2.00 GHz 2 x 1 GB RAM (1.86 GB usable) System type: 64 - bit operating system. Windows Pro 10. Query: I bought 2 x 4 GB RAM DDR3 1333 MHz 204-pin SODIMM Unbuffered of CCL Computers Lt

  • How to write and format for excel

    I am currently using labview 2010 and I try to write my timestamp data to Excel.  I have my time stamp formatted as a string and my data is in a table or a type of dynamic data. Writing custom vi does not work with my data for some reason any and I w

  • Max amount of memory

    I was wondering what is the maximum amount of memory, you can add to windows xp. I get the "WARNING os paged pool memory low" so I need to upgrade, but I do not know the max that I can put in. I have 4 GB and I would get 8Gb

  • Filmmaker maintains close and when she does not jams while that coding... WHY?

    Hello... I had nothing else problems with movie maker. My clips download a lot of my camcorder. I edit... No problem. I add credits without problem, but when I publish all the jams up after 10 minutes.  I tried to reduce the amount of clips, etc.  Al