0

Is it possible to disable input edit of combobox?

asked 2009-02-27 20:11:57 +0800

jyluo gravatar image jyluo
147 1 1

But still allow select from the drop down menu? Thanks!

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2009-02-27 20:33:55 +0800

james gravatar image james
255 2

Do you want something more like this...

<listbox mold="select" rows="1"/>

Kind of a standard dropdown / select box?

link publish delete flag offensive edit

answered 2009-02-27 21:57:51 +0800

jyluo gravatar image jyluo
147 1 1

But you cannot edit a listbox. I am thinking of a drop down box which users can set whether it's editable at runtime (without replace the entire component..)

link publish delete flag offensive edit

answered 2009-02-27 22:21:59 +0800

james gravatar image james
255 2

updated 2009-02-27 22:27:30 +0800

oh, i thought you meant to just not let edit, at all; not to be able to change (during run time) if you can edit it or not
try this

<combobox id="cb" readonly="true">
<comboitem label="test1"/>
<comboitem label="test2"/>
</combobox>
<button label="readonly" onClick="cb.readonly=true"/>
<button label="editable" onClick="cb.readonly=false"/>

(or implement it however you want, but just change the "readonly" attribute)

edit: also, you might need to use "setReadonly" depending on how you implement it.
http://www.zkoss.org/javadoc/3.5.2/zul/org/zkoss/zul/Combobox.html
(Methods inherited from class org.zkoss.zul.impl.InputElement)

link publish delete flag offensive edit

answered 2009-02-27 22:39:33 +0800

jyluo gravatar image jyluo
147 1 1

james, thank you so much!

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-02-27 20:11:57 +0800

Seen: 425 times

Last updated: Feb 27 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More