I want to disable the anchor link event when it clicked one time. I used anchor.setenabled(false) but nothing happend. When I click the same button again the event e is true. I want false at that time.
public void onCellClick(GridPanel grid, int rowIndex, int colindex,EventObject e)
{
if(rowIndex==0 && colindex==2){
tomcatHandler = "Start";
anchorStart.setEnabled(false);
}else if(rowIndex==0 && colindex==3){
tomcatHandler = "Stop";
****anchorStop.setEnabled(false);
anchorStart.setEnabled(false);
anchorRestart.setEnabled(true);****
}else if(rowIndex==0 &&colindex==4){
tomcatHandler = "Restart";
anchorRestart.setEnabled(false);
}
AdminService.Util.getInstance().tomcat(tomcatHandler,new AsyncCallback<String>() {
@Override
public void onSuccess(String result) {
imageChangeEvent(result);
}
@Override
public void onFailure(Throwable caught) {
}
});}
Anchors in GWT have always had a problem with
setEnabled()because HTML doesn’t support such a property. A quick workaround is to create a new widget that subclasses GWT’sAnchor, adding the following override:This disables the passing of the browser event to GWT’s
Anchorclass (summarily disabling all related handlers) when the link is double clicked, focused or clicked and is in a disabled state.Source