finish by updating the user interface...

IM create screen with pagination... Load button to add more data, it is normal on os 6 and 7 os... but in the os 5 process completed... I haved create to update the user interface of the thread to invoke later...
This is my code to call later:

UiApplication.getUiApplication().invokeLater(
                                new Runnable() {
                                    public void run() {
                                        // delete(hfmLoad);
                                        for (int i = 0; i < comp.length(); i++) {
                                            lowerScreen.add(list[i]);
                                            HorizontalFieldManager hfmBut = new HorizontalFieldManager(
                                                    Field.FIELD_RIGHT);
                                            hfmBut.setMargin(0, 5, 0, 0);

                                            hfmBut.add(but1[i]);
                                            lowerScreen.add(hfmBut);

                                            spasi = new SeparatorField() {
                                                protected void paint(Graphics g) {
                                                    g.setColor(Color.GRAY);
                                                    int currentStipple = g
                                                            .getStipple();

                                                    try {
                                                        g
                                                                .setStipple(0xAAAAAAAA); // Dotted

                                                        super.paint(g);

                                                    } finally {

                                                        g
                                                                .setStipple(currentStipple);
                                                    }
                                                }
                                            };
                                            spasi.setMargin(0, 5, 5, 5);
                                            lowerScreen.add(spasi);
                                            invalidate();
                                            //lowerScreen.add(new LabelField("Semangat",Field.FOCUSABLE));
                                        }

                                        hfmLoad
                                        .replace(_ourAnimation2, loadBut);
                                        invalidate();

                                    }

any solution?

None of the invalidate() method calls are needed in this code.

For efficiency rather than to add the field individually, I recommend that you use the addAll method.  In your loop, create an array of fields to add, and then use addAll to add table.

If you do these two things I think that your problem will be solved.

But if not, can you please tell us exactly what are the messages you see when the process is complete.

Tags: BlackBerry Developers

Similar Questions

  • How can I update the user interface controls in the UI thread

    Hi all

    I want to do a custom image to display this URL source support.

    I start a thread to ask the image of the network data, and then update the display of the image with the data, but I get the error:

    ApplicationPrivate::resourceManager: ERROR called from the thread of user QThread (0x81eeb8c) interface
    ApplicationPrivate::resourceManager: A user interface thread named method

    It's my code segment:

    class URLImageView: public CustomControl, public QThread
    {
    public:
        URLImageView();
    private:
        void run();
    
        ImageView* mImageView;
        Container* mRootContainer;
    };
    
    URLImageView::URLImageView()
    {
        mRootContainer = Container::create().background(Color::Gray).preferredSize(100,100);
        mImageView = ImageView::create().image(QUrl("asset:///button.png"));
    
        mRootContainer->add(mImageView);
        setRoot(mRootContainer);
        start();
    }
    
    void URLImageView::run()
    {
        //get data from network
        //...
        //...
                //create image from binary data        Image* image = new Image(pixelBuffer);
        mImageView->setImage(image);
    }
    

    I know that in the old BB OS (Java Platform), I can get the lock of event request like this UI:

    synchronized (Application.getEventLock())
    {
            // I can update UI control here
    }
    

    Is it same way to Cascades BB10 or what is the right way, if I want to update the user interface in the UI thread?

    Thank you

    This looks like what signals are useful for, when it is connected with the option QueuedConnection. I don't have a link for you, but I'm sure that you can get with this description.

  • need the location and update the user interface in each a second

    you will need to update the user interface by every second so that my application will not hold?

    What is the best way to implement?

    (in the PPH), it should look like this:
    void locationUpdate (long latitude, longitude long);

  • Need help with this code to update the user interface example

    I'm triying to understand the differences between the three methods to manage UI interactions.
    I'm really confused with these three terms when triying them figure out in a real case.
    Basically, I know that I should use invokeLater, invokeAndWat, or getEventLock() to avoid
    This exception: java.lang.illegalStateException: engine access UI without holding the lock on the event

    The code below illustrates the function of the invokeAndWait method, but if I replace it with
    invokeLater or getEventLock() the program will work exactly the same way.
    Could you please change the code to show the differences between the three
    methods of updating the user interface?

    / public final class HelloWorldMainScreen extends form {}

    private LabelField labelField;
    public HelloWorldMainScreen() {}
    labelField = new LabelField ("Hello World");
    Add (labelField);
    Thread MainScreenUpdaterThread = new MainScreenUpdaterThread (this);
    thread. Start();
    }

    {} public void appendLabelText (String text)
    labelField.setText(labelField.getText()+"\n"+text);
    }

    }

    SerializableAttribute public class MainScreenUpdaterThread extends Thread {}
    HelloWorldMainScreen screen;

    public MainScreenUpdaterThread (screen HelloWorldMainScreen) {}
    this.mainScreen = screen;
    }

    public void run() {}
    for (int i = 0; i)< 10;="" i++)="">
    try {}
    Thread.Sleep (5000);
    } catch (InterruptedException ex) {};
    UiApplication.getUiApplication () .invokeAndWait (new Runnable() {}
    public void run() {}
    mainScreen.appendLabelText ("Update");
    }
    });

    }
    }
    }

    These three concepts are very confusing for a lot from people so all explanatory source code
    describing their functions will be highly useful for everyone, I think.

    Thanks in advance!

    With respect to the effect, there is no difference between methods.  The difference is the way in which the result is achieved.  So we can't change the code to show you the difference.

    As we are unable to demonstrate the difference, you have to do with an explanation.  To understand the explanation, you'll need to understand the thread of events, so if you have not already, please consider this:

    http://supportforums.BlackBerry.com/T5/Java-development/what-is-the-event-thread/Ta-p/446865

    If the three options are differentiated by the processing order:

    (a) invokeLater executes the update on the thread of events.  The transformation takes place at a later stage and the code which is in order after the invokeLater will actually run before the code within the invokeLater.

    (b) invokeAndWait also manages the update on the thread of events, which means that all other events that await on the thread of events will be run before this code.  But any code after the invokeAndWait will not be executed.

    (c) the synchronized option, like invokeAndWait, runs the update of the UI before moving on to the following code.  The difference is that the code to run on the event Thread is not executed before code in the synchronized block.

    If this is meaningless, so that probably does not matter too much.  in general, you should use invokeLater, except if you need to update the user interface occur in the order with your background processing.  If so, use invokeAndWait. It has synced are very few occasions where you must use the block, and it should be very small updates to the user interface and you should understand the implications this could have on the wire events.

  • Try to update the user interface with another thread

    Hello

    Start a class JavaFX from another application, and then I want to change the UI of it components. I tried to use Platform.runLater to do.

    But the GUI crashes at the start (does not display anything) for the first 5 seconds (sleep time) changes and shows.

    I want to display the GUI at first, and then after 5 seconds the GUI should be updated with the message, but with the code it hangs just first and screens below everything after 5 seconds.

    Here sampleGUI is a an application javafx with inside text fields.

    + / public class StartGame extends Application {+
    +@Override+
    + public void start (steps) riser Exception {+
    final sampleGUI gui = new sampeGUI();
    GUI. Start (training);

    + Platform.runLater (new Runnable() {+)
    +@Override+
    + public void run() {+
    + try {+
    System.out.println ("sleep now...");
    Thread.Sleep (5000);
    System.out.println ("sleep above!");
    gui.updateText ("new message");
    +} catch (InterruptedException ex) {+
    System.out.println ("exception" ex); +
    +}+
    +}+
    +});+
    +}+
    +}+
    Platform.runLater(new Runnable() {
      @Override
      public void run() {
       // ...
      }
    });
    

    causes the run method of the executable to run on the Thread of the FX Application. Since you put Thread.sleep (5000) inside the run method of your executable, sleep occurs on the Thread of the FX Application.

    The call to runLater (...) can be called from any thread, including the Thread of Application FX.

    So, if you are not in the FX Application thread, you want to:

    // any long-running task, for example
    System.out.println("Sleeping now");
    Thread.sleep(5000);
    System.out.println("Sleep over");
    Platform.runLater(new Runnable() {
      @Override
      public void run() {
        // update UI:
        gui.updateText("New Message");
      }
    });
    

    If you are on the thread of the Application of FX, which is the case in your Application.start (...) method, you must create a new thread to run your code of long duration. You can do this "manually", creating a Thread and a workable for it to run, but it is probably best to use the simultaneity of JavaFX API, which has many hooks useful for updating the user interface on the Thread of the FX Application.

    In this case, the code would look like this:

    public class StartGame extends Application {
      @Override
      public void start(Stage stage) throws Exception {
        final SampleGUI gui = new SampleGUI();
        gui.start();
        final Task waitingTask = new Task() {
          @Override
          public String call() throws Exception {
            System.out.println("Sleeping");
            Thread.sleep(5000);
            System.out.println("Sleep over!");
            return "New Message" ;
          }
        };
    
        waitingTask.setOnSucceeded(new EventHandler() {
          @Override
          public void handle(WorkerStateEvent event) {
            gui.updateMessage(waitingTask.getValue());
          }
        });
    
        ExecutorService executor = Executors.newSingleThreadExecutor();
        executor.submit(waitingTask);
      }
    }
    

    There are (probably of dozens of) other ways to use a task to do. See the API documentation [url http://docs.oracle.com/javafx/2/api/javafx/concurrent/Task.html] for the task for more information.

  • Update the user interface problems

    I have an application that has three buttons at the top of the other, but is never visible at a time.  On the initial configuration of the application, the user interface is correct, but once one of the clicked button events fire several buttons appear at the same time.  All buttons are dynamicslly created and stored in a table to access.

    A few snippits of code:

    The buttons are created like that and then added to a canvas:


    browseButton.label = "Browse";
    browseButton.id = trackNumber.toString ();
    browseButton.width = 92;
    browseButton.height = 30;
    browseButton.setStyle ("right", 0);
    browseButton.addEventListener (MouseEvent.CLICK, fileRef_browseHandler);


    removeButton.label = 'delete ';
    removeButton.id = trackNumber.toString ();
    removeButton.width = 92;
    removeButton.height = 30;
    removeButton.setStyle ("right", 0);
    removeButton.addEventListener (MouseEvent.CLICK, removeButton_clickHandler);


    clearButton.label = "clear";
    clearButton.id = trackNumber.toString ();
    clearButton.width = 92;
    clearButton.height = 30;
    clearButton.setStyle ("right", 0);
    clearButton.addEventListener (MouseEvent.CLICK, clearButton_clickHandler);

    canvasButtons.addChild (removeButton);
    canvasButtons.addChild (browseButton);
    canvasButtons.addChild (clearButton);
    canvasButtons.horizontalScrollPolicy = 'off ';

    Pretty easy.  Where the problem occurs is removeButton_clickHandler.  It passes through and hides all buttons and makes the Browse button active thus active / disable another image.  Turns on and off the visibility making:

    public void HideFileButton(currentButton:Button):void {}
    currentButton.setVisible (false);
    } / / HideFileButton (Button)

    public void ShowFileButton(currentButton:Button):void {}
    currentButton.setVisible (true);
    } / / ShowFileButton (Button)

    I see that the visible property is changing, but the UI is not hide the buttons that are no longer visible.  I got around this origin by setting the alpha to 0, but it seems I'm missing something simple.

    Can anyone shed light on what I'm missing?

    In general, you define the button visible = false immediately except the one you want to be visible.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Inflation does not update the user interface information; always playing 'thin '.

    Don't know what else to do. Here you can see a thin provisioned disk:

    ScreenHunter_25 Jun. 10 13.49.jpg

    Which is confirmed by the client as well

    ScreenHunter_25 Jun. 10 13.50.jpg

    Now I inflate the vmdk (makes no difference, PowerCLI or browser data store)

    ScreenHunter_25 Jun. 10 13.51.jpg

    Once completed, the disc should show 'Thick' - or "Willing to scratch thick" when you use the client.

    ScreenHunter_26 Jun. 10 13.51.jpg

    However, it still shows thin, PowerCLI and vSphere Client. When you try to inflate again, he confirmed that the disc is not thinner

    ScreenHunter_27 Jun. 10 13.51.jpg

    The only solution seems to be to unregister the virtual machine or at least just the VMDK and re - register. This will update the information.

    Only reference I've found so far is 1037619 KB, but it simply indicates that this error means that the disc is not thin-provisioned.

    Another reference, I found online is:

    http://virtual-stones.stonemountains.nl/2013/04/sphere-client-shows-wrong-disk.html

    However, this indicates that the information changes once the virtual machine is running. What I can not confirm, it always shows 'End' until I have de-register / register VM or disc.

    Is there information somewhere on how to update the information of the UI once the disc is being inflated?

    The same effect that restore a virtual machine can be achieved with a reloading-VM as this operation:

    On the shell via SSH or DCUI ESXi:

    Get the id of the virtual computer with:

    # vim - cmd vmsvc/getallvms | grep-i [VM - name]

    Perform a reload:

    # vim - cmd vmsvc/reload [VM - ID]

    Through the PowerCLI:

    (Get - VM [VM name] |) Get - View). Reload()

    Check if this updates information properly.

    So again, it does not check if a restart of the host management agents work.

  • How to upgrade to the user interface of a screen that is extracted from the stack?

    Hello

    I am currently having a problem in the UI update.

    I have two screens called 'OverviewScreen' & 'DetailScreen' and in the upper part of the two screens, I have three buttons

    (i) back

    (II) next

    (III) charging

    In the entry of the app normally I posted the 'OverviewScreen' and in this screen, back, next buttons are inactive positions (just to have two sets of images, one active and one for idle) and if the user clicks on an item that is displayed in the cell, then I'll navigate the user to the "DetailScreen".

    Now the stack should have two screens,

    at the bottom - "OverviewScreen".

    at the top - "DetailScreen".

    and in the "DetailScreen" - I showed the image is active for the "back" button (because the screen is lower in the stack) and for the next inactive button image.

    Now if the user clicks the back button I navigates to the "OverviewScreen" which is called the UiApplication.getUiApplication (.getActiveScreen) (m:System.NET.Sockets.Socket.close ()); in the case of touch

    Now the "OverviewScreen" located in the bottom of the stack to the front UI (basically when I built it for the first time, it contains inactive images next and back) - what I want here is I need to show the following active image therefore needs to update the user interface of the screen that displays battery

    Because,

    OverviewScreen (back, next inactive images)--> DetailScreen (back - active, next - inactive)--> new OverviewScreen (should show the back - off, next - active)

    For this, I tried with what follows, but none works,

    If (event.getEvent () == TouchEvent.CLICK) {}
    UiApplication.getUiApplication () .getActiveScreen () .getScreenBelow () .updateDisplay ();
    UiApplication.getUiApplication () .getActiveScreen () m:System.NET.Sockets.Socket.close ();
    Returns true;
    }

    I even tried with invalidate() and dopaint() but none works

    However, I realized the functionality if I press the off button in the "OverviewScreen" he navigated me to the "DetailScreen", juice wants to show the icon active next button?

    What should I do to repaint or update the user interface of the screen here?

    Thanks in advance,

    Kitty.

    Found a solution

    Override the method which is found in the net.rim.device.api.ui.container.MainScreen and in this method, I have changed the image for the button and this method is called in the current active screen using getActiveScreen () .getScreenBelow)

  • Impressive transformation slow due to the updating of the user interface

    Hello

    I feel a huge slow down in my test as engine

    I update the display after each test. It consists of a rather

    "simple table" with a subtle change of color and bold

    to indicate the failure or success of the test:

    I have also tried several things to determine what routine was

    make the program almost crawling like a snail, here's my

    results:

    No UI refresh: 0m48s (same as Teststand with no updates of the user interface)

    The discount but no page table switch: 1m06s

    Bay of refreshment and switch page: 1m26s

    There are 314 tests, up to 314 redraw and possibly

    switch page 314 to reposition the view. Which gives the

    following user interface refresh costs:

    Update of the table: 18 years/314 = 57ms (replacing just a single line, Center to top)

    Switch to page: 20 s/314 = 64ms (bottom right corner)

    Is this really the case? Is there a way to make the refresh of the user interface

    faster? Create two separate loops/threads, one to make

    the test, one for updating the UI asynchronously?

    I understood for an overall picture about different

    widgets, but here I'm 'just' display of channels...

    David Koch

    Well, multi-listbox control is a problem if your change causes access to the muliple property node. For each property node LabVIEW normally does a refresh of the user interface which is very quickly. Fortunately, there is a fairly easy way to fix this.

    Use a node of property for the current VI (just drop a property node and change its class type VI Server-> VI reference) to get the reference of the Panel. Then use another property node connected to your reference of the Panel and select update from the Panel to postpone. Set this value to true before your Listbox (and any other updated user interface) and set the value to false then.

  • Passage of thanks VM SATA drives? (update: a bug in the user interface web host)

    I use ESXi 6.0 for private home use and am currently building a NAS with him (on top of ESXi OpenMediaVault). However, as I am using only material quality consumer, my SATA controller does normally not for raw device mapping. I added the raw device manually in accordance with VMware KB: Raw Device Mapping for the local storage but when I try to join the top device (via the file on the local data store) a virtual machine, the user interface gives me an error message indicating that the capacity is too large for the given data store (of course, the system disk is much smaller than the data disks).

    Is there a way I can still add raw devices to virtual machines?

    Another update: upgrading the client to the web user interface host to 3731936 seems to fix this problem. I can now add virtual disks as RDMs in the web client.

  • Offset of the user interface after update of El Capitan

    Hello. Since I upgraded my Macbook Pro late 2013 to El Capitan retina, I've known GAL of the user in function, mainly opening animation of safari and switching between desktop computers. These issues are only to make my user base, I created a test user and concluded that the test user was not the offset of the user interface. I have reinstalled the operating system, as well as talked to apple. Apple had me reset the Pram so that delete files, including:

    / Library/LaunchAgents

    ~/Library/LibraryAgents

    / Library/LaunchDaemons

    / Library/Caches

    ~/Library/caches

    and many other files like these.

    None of that helped, my UI lag is still there and fine. Also, I'm not sure if this is relevant; However, my recovery HD (available from start by pressing the alt/option key) is not an option. I'm not sure if the files I deleted with apple support caused it or reinstalling the operating system has done this. IM thinking delete files because I reinstalled the operating system using the HD recovery.

    Does anyone know how to fix the lag in the UI? I know other people have this problem, google search and this forum but no clear answer has not developed.

    Thank you

    Caulin Bloom

    Please launch the Console application in one of the following ways:

    ☞ Enter the first letters of his name in a Spotlight search. Select from the results (it should be at the top).

    ☞ In the Finder, select go utilities ▹ of menu bar or press the combination of keys shift-command-U. The application is in the folder that opens.

    ☞ Open LaunchPad and start typing the name.

    The title of the Console window should be all Messages. If it isn't, select

    SYSTEM LOG QUERIES ▹ all Messages

    in the list of logs on the left. If you don't see this list, select

    List of newspapers seen ▹ display

    in the menu at the top of the screen bar.

    Click on the clear view icon in the toolbar. Then take an action that does not work the way you expect. Select all of the lines that appear in the Console window. Copy to the Clipboard by pressing Control-C key combination. Paste into a reply to this message by pressing command + V.

    The journal contains a large amount of information, almost everything that is not relevant to solve a particular problem. When you post a journal excerpt, be selective. A few dozen lines are almost always more than enough.

    Please don't dump blindly thousands of lines in the journal in this discussion.

    Please do not post screenshots of log messages - text poster.

    Some private information, such as your name or e-mail address, can appear in the log. Anonymize before posting.

    When you post the journal excerpt, an error message may appear on the web page: "you include content in your post that is not allowed", or "the message contains invalid characters." It's a bug in the forum software. Thanks for posting the text on Pastebin, then post here a link to the page you created.

    If you have an account on Pastebin, please do not select private in exposure menu to paste on the page, because no one else that you will be able to see it.

  • Why me disables the user interface click on another button, while it performs a scan?

    Hello

    When I run the user interface and click on a button that is sweeping the voltage for a period of time, I can't press any other button that sits on my Panel, lets say the Abort button that would prevent the action.

    So when I take the data and I realize that I should stop him before he finishes the scan, I can't and it's a really bad drawback.

    How can I improve this problem?

    Thank you

    Hi m.s.taba,

    It seems to me that your code runs the function leave but does not exit the loop you are, then the program stops at the end of the loop.

    To avoid this, you can:

    • use a global variable to the time your long recall and the recall of quit smoking
    • Call ProcessSytemEvents in the loop
    • reminder for the button leave defines the global variable
    • inside the loop, immediately after ProcessSystemEvents, you should test the value of the variable, and if the value you must break out of the loop
    • only after the exit of the loop, you can complete your program

  • The best way to separate the user interface in the model LV 2012 queued Message Handler?

    If you create a new "queued Message Handler" new model 2012 LV, you will see a blue box in the case of "Update view" that says the following:

    Code Recommended - If you wish to decouple the Message Handling Loop from your user interface, consider creating User Events (like the "Stop" event in this VI) to message the Event Handling Loop whenever the user interface needs updating.
    

    I would like to give a suggestion, but I am struggling to find the best way to do this and still keep code modular.  The template creates a user - Stop.lvlib "event with a create/Destroy/fire Subvi.  I would like to create a library of "User event - Update UI.lvlib" similar with similar Create/Destroy/fire Subvi keep this new modular and separate user event.  The problem, I am struck, is that there may be only two hydrants in case Structure dynamic event so, how I modularlize creating user events in separate SubVIs and always maintain this dynamic event terminals?

    As a follow-up on the issue, it would be preferable to have a library of user by indicator events that must be updated or that a single UI update of the user and then event pass a cluster as the message that contains the name of the control for the update (to use with a structure of matter), then the data to go with it?

    Thank you!

    Instead of having the events to record in the 'create' methods, you could be part outside your 'create' SubVIs and then simply bundle them. Then, you create your individual event of the user management. See excerpt where I created a vi 'Create user event - Update' in front of the stop.

  • Speech recognition does not match the language of the User Interface in Windows 8.1

    How can I update my speech reconition language that matches my user interface language? Thank you

    Hello

    Thanks for posting your question on the Microsoft Community.

    I apologize for the inconvenience caused to you.

    I understand that the problem with speech recognition does not correspond with the user interface in Windows 8.1

    This issue would have occurred due to some damaged system registry entries.

    Please provide me with the following information to better understand the issue.

    1. What language is speech recognition uses in the system?

    2. What is the base language that is installed in the system?

    Note: Speech recognition is available in the following languages: English (United States & United Kingdom), French, German, Japanese, Mandarin (Chinese simplified and Chinese traditional) and Spanish.

    You can also check out the link below.

    How to use speech recognition

    http://Windows.Microsoft.com/en-us/Windows-8/using-speech-recognition

    Please provide the information above to help you best.

    Thank you.

  • OS6 Guides development of the user interface

    Is there a that guides all OS6 out UI development still?  I wrote some background apps start on my "BOLD" 9000 OS4.6 into development, but now I want to try my luck at the user interface.  I just got the Torch 9800 and I want to connect it to one of my web applications and retrieve/display information, update etc.  Specifically, I'm looking to connect to our own ticket, tracking system, so I can access ticket information, update tickets, view attachments (blackberry types supported in any case), the old tickets (executed on the server) search and display the results.  I have already addressed most of the back-end things (http, xml, persistence, file system, gps, connections message, discussions, etc.).

    Thank you

    Song

    http://goo.GL/t4TJ

    http://goo.GL/fECh

Maybe you are looking for