SmartGWT 2.2 all browsers
After a refreshRow the embended button does not work, image still stay but no hover or button click event fire.
code:
public ListGrid getGridAgent() {
if (gridAgent == null) {
gridAgent = new ListGrid() {
@Override
protected Canvas createRecordComponent(
final ListGridRecord record, Integer colNum) {
HLayout hOptions = null;
String fieldName = this.getFieldName(colNum);
if (fieldName.equals("agentOptions")) {
hOptions = new HLayout(3);
hOptions.setAlign(Alignment.CENTER);
ImgButton imgLogoff = new ImgButton();
imgLogoff.setShowDown(false);
imgLogoff.setShowRollOver(false);
imgLogoff.setLayoutAlign(Alignment.CENTER);
imgLogoff.setSrc("logout.png");
imgLogoff.setShowHover(true);
imgLogoff.setPrompt("Desloguear Agente");
imgLogoff.setHeight(16);
imgLogoff.setWidth(16);
imgLogoff.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
SC.say("Click en desloguear agente : "
+ record.getAttributeAsString("agentId"));
}
});
hOptions.addMember(imgLogoff);
}
if (fieldName.equals("agentTimer")){
hOptions = new HLayout(2);
hOptions.setAlign(Alignment.CENTER);
hOptions.addMember(QueueAdmin.get().getAgentTimer(record.getAttributeAsString("agentId")).getLabelTime());
}
return hOptions;
}
};
gridAgent.setFields(new ListGridField[] {
new ListGridField("agentId", "Agente"),
new ListGridField("agentName", "Nombre"),
new ListGridField("agentCallsTaken", "Contestadas"),
new ListGridField("agentStatus", "Estado"),
new ListGridField("agentTimer", "Timer"),
new ListGridField("agentPaused", "Pausado"),
new ListGridField("agentOptions", "Eventos") });
gridAgent.setTitle("Estado de Agentes");
gridAgent.setShowRecordComponents(true);
gridAgent.setShowRecordComponentsByCell(true);
gridAgent.setShowAllRecords(true);
}
return gridAgent;
After a refreshRow the embended button does not work, image still stay but no hover or button click event fire.
code:
public ListGrid getGridAgent() {
if (gridAgent == null) {
gridAgent = new ListGrid() {
@Override
protected Canvas createRecordComponent(
final ListGridRecord record, Integer colNum) {
HLayout hOptions = null;
String fieldName = this.getFieldName(colNum);
if (fieldName.equals("agentOptions")) {
hOptions = new HLayout(3);
hOptions.setAlign(Alignment.CENTER);
ImgButton imgLogoff = new ImgButton();
imgLogoff.setShowDown(false);
imgLogoff.setShowRollOver(false);
imgLogoff.setLayoutAlign(Alignment.CENTER);
imgLogoff.setSrc("logout.png");
imgLogoff.setShowHover(true);
imgLogoff.setPrompt("Desloguear Agente");
imgLogoff.setHeight(16);
imgLogoff.setWidth(16);
imgLogoff.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
SC.say("Click en desloguear agente : "
+ record.getAttributeAsString("agentId"));
}
});
hOptions.addMember(imgLogoff);
}
if (fieldName.equals("agentTimer")){
hOptions = new HLayout(2);
hOptions.setAlign(Alignment.CENTER);
hOptions.addMember(QueueAdmin.get().getAgentTimer(record.getAttributeAsString("agentId")).getLabelTime());
}
return hOptions;
}
};
gridAgent.setFields(new ListGridField[] {
new ListGridField("agentId", "Agente"),
new ListGridField("agentName", "Nombre"),
new ListGridField("agentCallsTaken", "Contestadas"),
new ListGridField("agentStatus", "Estado"),
new ListGridField("agentTimer", "Timer"),
new ListGridField("agentPaused", "Pausado"),
new ListGridField("agentOptions", "Eventos") });
gridAgent.setTitle("Estado de Agentes");
gridAgent.setShowRecordComponents(true);
gridAgent.setShowRecordComponentsByCell(true);
gridAgent.setShowAllRecords(true);
}
return gridAgent;