on 10-15-2015 7:19 PM
Hi,
I would like to know if it is possible to prevent the user to type in a ComboBox?
The user can only select one of the options. I want the same behavior as the sap.m.Select, where the user cannot type or "select empty".
Thanks, Cristiano.
You can fetch the jQuery instance of the input control used in the ComboBox and set the attribute readonly to true.
oComboBox.addEventDelegate({
onAfterRendering: function() {
oComboBox.$().find("input").attr("readonly", true);
}
});
updated jsbin link - JS Bin - Collaborative JavaScript Debugging
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Taking cue from - here is the example - JS Bin - Collaborative JavaScript Debugging
Sakthivel you link for jsbin does not have any code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In compobox change these lines, oComboBox1.setEditable(true); to oComboBox1.setEditable(false);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In compobox change these lines, oComboBox1.setEditable(true); to oComboBox1.setEditable(false); this will prevent user to type
and
oDropdownBox.getLiveValue(); i think it works to select item
hi,
regarding the editable, go to :http://veui5infra.dhcp.wdf.sap.corp:8080/snippix/#39411 test and uncomment the editable line, and check. This is not what I want. thanks.
Hi,
this is sample code JS Bin
But i could not make make that editable, i think in dropdown we can't prevent user from typing. Returned the value on click
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.