Using:
GWT 2.5.0
SmartGWT 3.1p-2012-11-23
SmartClient Version: v8.3p_2012-11-23/LGPL Development Only (built 2012-11-23)
FF 19, IE 9, Chrome 26
Problem:
Call layout.setBackgroundColor ("red"); // turns background color to red as expected
Call layout.getBackgroundColor (); // returns "red" as expected
Call layout.setBackgroundColor (null); // turns background color to white as expected
Call layout.getBackgroundColor (); // returns "red", but should return null
In this sample, click Red then click Null, and I see:
Sample code:
GWT 2.5.0
SmartGWT 3.1p-2012-11-23
SmartClient Version: v8.3p_2012-11-23/LGPL Development Only (built 2012-11-23)
FF 19, IE 9, Chrome 26
Problem:
Call layout.setBackgroundColor ("red"); // turns background color to red as expected
Call layout.getBackgroundColor (); // returns "red" as expected
Call layout.setBackgroundColor (null); // turns background color to white as expected
Call layout.getBackgroundColor (); // returns "red", but should return null
In this sample, click Red then click Null, and I see:
Code:
00:02:24.207 [INFO] setBackgroundColor (). color: red, layoutBackgroundColorBefore: null, layoutBackgroundColorAfter: red 00:02:27.072 [INFO] setBackgroundColor (). color: null, layoutBackgroundColorBefore: red, layoutBackgroundColorAfter: red
Code:
public class SetBackgroundColor implements EntryPoint {
// my attributes
private final VLayout layout = new VLayout ();
/**
* The EntryPoint interface
* http://forums.smartclient.com/showthread.php?p=94385
*/
public void onModuleLoad() {
// add a button that makes the background red
final IButton buttonRed = new IButton ();
buttonRed.setTitle ("Red");
buttonRed.addClickHandler (new ClickHandler () {
public void onClick (final ClickEvent clickEvent) {
setBackgroundColor ("red");
}
});
// add a button that shows a dialog with a canvas with no opaticy set
final IButton buttonNull = new IButton ();
buttonNull.setTitle ("Null");
buttonNull.addClickHandler (new ClickHandler () {
public void onClick (final ClickEvent clickEvent) {
setBackgroundColor (null);
}
});
// add
layout.addMember (buttonRed);
layout.addMember (buttonNull);
layout.draw ();
}
/**
* Uniformly sets the background color and logs debug data
* @param color
*/
private void setBackgroundColor (final String color) {
final String layoutBackgroundColorBefore = layout.getBackgroundColor ();
layout.setBackgroundColor (color);
final String layoutBackgroundColorAfter = layout.getBackgroundColor ();
GWT.log (
"setBackgroundColor (). color: " + color + ", " +
"layoutBackgroundColorBefore: " + layoutBackgroundColorBefore + ", " +
"layoutBackgroundColorAfter: " + layoutBackgroundColorAfter);
}
}
Comment