How to disable GWT ValueListBox?
Asked Answered
V

2

7

ValueListBox doesn't implement HasEnabled interface, so I can't disable/enable it.

And although ListBox implements HasEnabled, method getListBox is private in ValueListBox. So I cannot get inner listBox, to disable it.

Anyone knows how to solve this problem? Thanks in advance.

Vorticella answered 4/5, 2011 at 5:23 Comment(0)
L
14

You can do the following:

DOM.setElementPropertyBoolean(valueListBoxObject.getElement(), "disabled", boolean)

Rest GWT should add a method, which isn't there for now.

Limbert answered 4/5, 2011 at 11:3 Comment(1)
Great, then mark above answer as useful as that might help others too ;)Limbert
A
0

You can simply do this:

valueListBoxObject.getElement().setAttribute("disabled", "true");

I've tried it and it works.

Aaberg answered 4/1, 2014 at 19:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.