merge revision 6492 from branches/adempiere341
This commit is contained in:
parent
98baad232a
commit
b82fc8a241
|
@ -29,6 +29,7 @@ import org.zkoss.zk.ui.Component;
|
|||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
import org.zkoss.zul.Listitem;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -281,4 +282,27 @@ public class Listbox extends org.zkoss.zul.Listbox implements EventListener
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterInsert(Component comp) {
|
||||
super.afterInsert(comp);
|
||||
if ("select".equals(getMold()) && comp instanceof Listitem) {
|
||||
if (getSelectedIndex() < 0 && getItemCount() > 0) {
|
||||
setSelectedIndex(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeChild(Component child) {
|
||||
boolean b = super.removeChild(child);
|
||||
if (b) {
|
||||
if ("select".equals(getMold()) && child instanceof Listitem) {
|
||||
if (getSelectedIndex() < 0 && getItemCount() > 0) {
|
||||
setSelectedIndex(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue