Hi,
I am using
a) SmartClient Version: v9.1p_2014-05-15/Pro Deployment (built 2014-05-15)
b) Testing using IE 11.0.9600.17126
I have a button with just an image. If I click on it and in the that button's click handler I disable it, the style does not switch to buttonDisabled. As a result the appropriate icon is not displayed. However the button itself is disabled.
Below you will find code that demonstrates this. There are simply 3 buttons - one that enables, another that disables the button with the back icon. Those work fine. If you click on the button with the back icon you will see the behaviour that I am experiencing.
Please let me know if I am missing a property or if this is a bug.
Thanks,
Voula
__________________________________________________________
package com.example.myproject.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Button;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
public class Testbutton implements EntryPoint {
Button someButton2;
Button someButton3;
Button someButton4;
public void onModuleLoad() {
someButton2 = new Button();
someButton2.setTitle(null);
someButton2.setIcon("[SKIN]/actions/back.png");
setupButton(someButton2);
someButton2.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
//someButton1.setDisabled(false);
someButton2.setDisabled(true);
}
});
someButton3 = new Button("Disable");
setupButton(someButton3);
someButton3.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
someButton2.setDisabled(true);
}
});
someButton4 = new Button("Enable");
setupButton(someButton4);
someButton4.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
someButton2.setDisabled(false);
}
});
VLayout vlLayout = new VLayout();
vlLayout.addMember(someButton2);
vlLayout.addMember(someButton3);
vlLayout.addMember(someButton4);
RootLayoutPanel.get().add(vlLayout);
}
private void setupButton(Button button) {
button.setShowDown(true);
button.setShowDisabledIcon(true);
button.setShowDisabled(true);
button.setShowSelectedIcon(true);
button.setShowRollOver(true);
button.setShowFocused(false);
button.setShowFocusedAsOver(false);
button.setCanFocus(true);
button.setShowClippedTitleOnHover(true);
button.setAutoWidth();
button.setOverflow(Overflow.VISIBLE);
}
}
I am using
a) SmartClient Version: v9.1p_2014-05-15/Pro Deployment (built 2014-05-15)
b) Testing using IE 11.0.9600.17126
I have a button with just an image. If I click on it and in the that button's click handler I disable it, the style does not switch to buttonDisabled. As a result the appropriate icon is not displayed. However the button itself is disabled.
Below you will find code that demonstrates this. There are simply 3 buttons - one that enables, another that disables the button with the back icon. Those work fine. If you click on the button with the back icon you will see the behaviour that I am experiencing.
Please let me know if I am missing a property or if this is a bug.
Thanks,
Voula
__________________________________________________________
package com.example.myproject.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Button;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
public class Testbutton implements EntryPoint {
Button someButton2;
Button someButton3;
Button someButton4;
public void onModuleLoad() {
someButton2 = new Button();
someButton2.setTitle(null);
someButton2.setIcon("[SKIN]/actions/back.png");
setupButton(someButton2);
someButton2.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
//someButton1.setDisabled(false);
someButton2.setDisabled(true);
}
});
someButton3 = new Button("Disable");
setupButton(someButton3);
someButton3.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
someButton2.setDisabled(true);
}
});
someButton4 = new Button("Enable");
setupButton(someButton4);
someButton4.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
someButton2.setDisabled(false);
}
});
VLayout vlLayout = new VLayout();
vlLayout.addMember(someButton2);
vlLayout.addMember(someButton3);
vlLayout.addMember(someButton4);
RootLayoutPanel.get().add(vlLayout);
}
private void setupButton(Button button) {
button.setShowDown(true);
button.setShowDisabledIcon(true);
button.setShowDisabled(true);
button.setShowSelectedIcon(true);
button.setShowRollOver(true);
button.setShowFocused(false);
button.setShowFocusedAsOver(false);
button.setCanFocus(true);
button.setShowClippedTitleOnHover(true);
button.setAutoWidth();
button.setOverflow(Overflow.VISIBLE);
}
}