SmartGWT Pro: 11.1p_2017-12-07
GWT 2.7
Chrome 63.0.3239.108 (Official Build) (64-bit)
Found a problem when upgrading from SmartGWT 4.1 to 6.1 with a component that uses the ButtonClickHandler and ButtonClickEvent of Dialog
Standalone test case reproducing the problem
Click on the Dialog button results in the following JS exception if you attempt to get the title from the button returned from the event.
I ended up changing the application code to use the individual ClickHandler on Button to achieve my desired result, instead of using the generic Dialog ButtonClickHandler, but from this test case, is there an issue with the Button returned from ButtonClickEvent if getTitle() isn't supported when the code is compiled?
GWT 2.7
Chrome 63.0.3239.108 (Official Build) (64-bit)
Found a problem when upgrading from SmartGWT 4.1 to 6.1 with a component that uses the ButtonClickHandler and ButtonClickEvent of Dialog
Standalone test case reproducing the problem
Code:
import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Button; import com.smartgwt.client.widgets.Dialog; import com.smartgwt.client.widgets.events.ButtonClickEvent; import com.smartgwt.client.widgets.events.ButtonClickHandler; public class Test implements EntryPoint { /** * {@inheritDoc} */ @Override public void onModuleLoad() { SC.showConsole(); final Dialog dialog = new Dialog(); dialog.setMessage( "Test" ); dialog.setIcon("[SKIN]/ask.png"); Button button = new Button( "Break" ); dialog.setButtons( button ); dialog.addButtonClickHandler( new ButtonClickHandler() { @Override public void onButtonClick( ButtonClickEvent event ) { Button source = event.getButton(); SC.say( source.getTitle() ); // Throws a JS exception when compiled } }); dialog.show(); } }
Code:
16:04:23.942:MUP0:WARN:Log:com.google.gwt.core.client.JavaScriptException: (TypeError) : source.getTitle is not a function at dispatch(test-0.js) at $doFire(test-0.js) at $fireEvent(test-0.js) at $fireEvent_0(test-0.js) at fireEvent_0(test-0.js) at <anonymous>(test-0.js) at apply_0(test-0.js) at entry0(test-0.js) at buttonClick(test-0.js) at click(http://localhost:58080/test/test/sc/modules/ISC_Containers.js?isc_version=11.1p_2017-12-07.js)
Comment