Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Progress wheel during process - Only displays a progress wheel that shows the current progress in the XdevProgressBar.

    Code Block
    languagejava
    themeConfluence
    private void button_buttonClick(Button.ClickEvent event) {
    	Window popup = PopupWindow.For(new ProgressView()).closable(false).draggable(false).resizable(false).modal(true).show();
    
    	UI.getCurrent().push();
    
    	// Start your process here
    
    	popup.close();
    }

    Select XdevProgressBar > Properties > Indeterminate in the ProgressView.

  • Dynamically update XdevProgressBar - Shows the current progress in the XdevProgressBar. The entire process must run in a separate thread. Since the thread runs on the server and the XdevProgressBar in the browser is not connected to does not get any information about it, a server push must be executed for every update of the XdevProgressBar through the invoking of getUI().access(()→progressBar.setValue(value)); method.

    Code Block
    languagejava
    themeConfluence
    private void progressBar_attach(ClientConnector.AttachEvent event) {	
     
            // Find out the lenght of your process in total. The value is 1.0.
     
    		// Starts a new thread on the serverside
    		Runnable task = ()->{			 
    	
    			// Start your process. Find out the current progress and store it in 'value'. Value must be between 0.1 and 1.0.			
    				
    				// Server Push to update in the ProgressBar in the Browser 
    				getUI().access(()->progressBar.setValue(value));			
    			
    		};
    		new Thread(new RunnableAccessWrapper(task)).start();	
    }


...