IDEMPIERE-3552 update to zk 8.5.0. Fixed context menu not working for readonly combobox.
This commit is contained in:
parent
3669419d2c
commit
0e6ae23f83
|
|
@ -22,6 +22,7 @@ import java.util.List;
|
||||||
import org.adempiere.webui.AdempiereIdGenerator;
|
import org.adempiere.webui.AdempiereIdGenerator;
|
||||||
import org.zkoss.zk.au.out.AuScript;
|
import org.zkoss.zk.au.out.AuScript;
|
||||||
import org.zkoss.zk.ui.IdSpace;
|
import org.zkoss.zk.ui.IdSpace;
|
||||||
|
import org.zkoss.zk.ui.WrongValueException;
|
||||||
import org.zkoss.zk.ui.util.Clients;
|
import org.zkoss.zk.ui.util.Clients;
|
||||||
import org.zkoss.zul.Comboitem;
|
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 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;
|
private static final long serialVersionUID = -6278632602577424842L;
|
||||||
|
|
||||||
public void setEnabled(boolean enabled)
|
public void setEnabled(boolean enabled)
|
||||||
{
|
{
|
||||||
this.setDisabled(!enabled);
|
this.setReadonly(!enabled);
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
//ensure list is close and not on focus
|
//ensure list is close and not on focus
|
||||||
if (this.getPage() != null)
|
if (this.getPage() != null)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue