IDEMPIERE-3552 update to zk 8.5.0. Fixed context menu not working for readonly combobox.

This commit is contained in:
Heng Sin Low 2017-11-26 07:29:50 +08:00
parent 3669419d2c
commit 0e6ae23f83
1 changed files with 24 additions and 2 deletions

View File

@ -22,6 +22,7 @@ import java.util.List;
import org.adempiere.webui.AdempiereIdGenerator;
import org.zkoss.zk.au.out.AuScript;
import org.zkoss.zk.ui.IdSpace;
import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Comboitem;
@ -33,14 +34,35 @@ import org.zkoss.zul.Comboitem;
*/
public class Combobox extends org.zkoss.zul.Combobox implements IdSpace
{
/**
public Combobox() {
super();
override();
}
public Combobox(String value) throws WrongValueException {
super(value);
override();
}
private void override() {
this.setWidgetOverride("slideDown_", "function(pp) {"
+ " if (this.isReadonly()) return; "
+ " this.$slideDown_(pp); "
+ "}");
this.setWidgetOverride("doKeyDown_", "function(evt) {"
+ " if (this.isReadonly()) return; "
+ " this.$doKeyDown_(evt); "
+ "}");
}
/**
*
*/
private static final long serialVersionUID = -6278632602577424842L;
public void setEnabled(boolean enabled)
{
this.setDisabled(!enabled);
this.setReadonly(!enabled);
if (!enabled) {
//ensure list is close and not on focus
if (this.getPage() != null)