Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problem with disable() and enable() on button

    Hi,

    I facing very strange behavior.
    I'm using disable() to disable button after user click on it and enable() to enable it after service call has ended.
    It is used like that so user wont click on button many times while waiting for service to complete call.
    If someone knows better solution, let me know :)

    My problem is that enable() work in Development mode but does not work in compiled version.The button just wont get enabled.
    And in Firefox it doesn't even get disabled.

    Code (dsiControl is my button):
    Code:
    public void onClick(ClickEvent event) {
    		
    		if(!isRunning) {
    			
    			dsiControl.disable();
    			
    			service.startDSI(name, new AsyncCallback<String>() {
    
    				@Override
    				public void onFailure(Throwable caught) {
    					SC.warn("Unable to start dsi ["+name+"]: " + caught.getMessage());
    				}
    
    				@Override
    				public void onSuccess(String result) {
    					
    					if(result.equals(null)) {
    						SC.warn("Error during startup of dsi ["+name+"]");
    					}
    					else {
    						SC.say("DSI ["+name+"] started !");
    						
    						isRunning = true;
    						
    						dsiStatus.setContents(TEXT_STATUS_STARTED + result);
    						dsiStatus.setBackgroundColor(COLOR_STARTED);
    						
    						dsiControl.setTitle(TEXT_CONTROL_STOP);
    						dsiControl.enable();
    					}
    				}
    			});
    		}
    }
    Im using
    GWT 2.1
    SmartGWT 2.4
    Tomcat 7.11
    Internet Explorer 6.0
    Mozilla Firefox 3.6
    Windows XP (same behavior on Win2003 and Win2008)

    Thanks

    Zbynek

    #2
    We have no similar reports, and obviously we can't run the code you've provided. Try isolating the problem further, also, remove any CSS in the application that didn't come with SmartGWT and see if that fixes it.

    Comment


      #3
      Maybe it is related after calling operations like fetch or export will stop other Js,
      like with described problem with ie 8 icon thread

      Comment

      Working...
      X