zul.wgt.Selectbox=zk.$extends(zul.Widget,{$define:{selectedIndex:function(a){var b=this.$n();b&&(b.selectedIndex=a)},disabled:function(a){var b=this.$n();b&&(b.disabled=a?"disabled":"")},name:function(a){var b=this.$n();b&&(b.name=a)}},_fixSelIndex:function(){0>this._selectedIndex&&(this.$n().selectedIndex=-1)},bind_:function(){this.$supers(zul.wgt.Selectbox,"bind_",arguments);var a=this.$n();this.domListen_(a,"onChange").domListen_(a,"onFocus","doFocus_").domListen_(a,"onBlur","doBlur_");zk.gecko||
(a=[this,this._fixSelIndex],zWatch.listen({onRestore:a,onVParent:a}));this._fixSelIndex()},unbind_:function(){var a=this.$n();this.domUnlisten_(a,"onChange").domUnlisten_(a,"onFocus","doFocus_").domUnlisten_(a,"onBlur","doBlur_").$supers(zul.wgt.Selectbox,"unbind_",arguments);a=[this,this._fixSelIndex];zWatch.unlisten({onRestore:a,onVParent:a})},_doChange:function(a){a=this.$n();var b=a.selectedIndex;zk.opera&&(a.selectedIndex=b);this._selectedIndex!=b&&(this.setSelectedIndex(a.selectedIndex),this.fire("onSelect",
a.selectedIndex))},doBlur_:function(a){this._doChange(a);return this.$supers("doBlur_",arguments)},beforeCtrlKeys_:function(a){this._doChange(a)},domAttrs_:function(){var a;return this.$supers("domAttrs_",arguments)+(this.isDisabled()?' disabled="disabled"':"")+(-1<(a=this.getSelectedIndex())?' selectedIndex="'+a+'"':"")+((a=this.getName())?' name="'+a+'"':"")}});
