| <?xml version="1.0" encoding="UTF-8" ?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| |
| --> |
| <library> |
| |
| <class name="countryCombobox" extends="resetCombobox" editable="false" |
| fontsize="11" style="componentStyle"> |
| |
| <attribute name="refObj" value="null" /> |
| |
| <attribute name="doUpdate" value="false" type="boolean"/> |
| |
| <handler name="onselect" args="sel"> |
| if ($debug) Debug.write("onselect ",sel,this.refObj,this.doUpdate); |
| if (this.refObj != null) { |
| if (this.doUpdate) { |
| |
| this.refObj.setSelectedValue(sel.text,sel.value); |
| |
| this.setAttribute("visibility","hidden"); |
| this.doUpdate = false; |
| |
| } |
| } |
| </handler> |
| |
| <handler name="onisopen" args="o"> |
| if ($debug) Debug.write("on isopen ",o); |
| |
| if (!o) { |
| lz.Timer.addTimer( new LzDelegate( this, "removeItem" ), 200 ); |
| } |
| </handler> |
| |
| <!-- |
| You can close the combobox without selection, for that purpose we need |
| another way to trigger a close event |
| --> |
| <method name="removeItem" args="o"> |
| if (this.visibility == "visible") { |
| this.setAttribute("visibility","hidden"); |
| this.doUpdate = false; |
| } |
| </method> |
| |
| <labeldTextListItem datapath="countrySet:/item" text="$path{ 'name/text()' }" |
| value="$path{ 'state_id/text()' }" /> |
| |
| </class> |
| |
| </library> |