I am using a combobox in a webapp with Vaadin 14. When the user clicks into the textfield, he can enter text.
I do not want that. The values of the combobox itself should not be editable, but the user should still be able to select the predefined values.
This is the standard behaviour of these components.
How to do that in Vaadin 14.6.8?
The standard behavior of a ComboBox is that you can both type and select – thus the "combo".
I believe you are looking for the Select component: https://vaadin.com/docs/v14/ds/components/select
The solution I found on the internet (on the feature request site):
cb.getElement().setAttribute("onkeydown", "return false");
It works partially, the cursor keeps blinking in the textfield, but custom user input is disabled.
Related
Dears,
I have implemented a pop-up window to be shown by clicking a trigger-button of a textbox, and it has a radioGroup in it. in some cases I have to check the radio based on user input.
The problem is that if I try to invoke radioGroup.setValue() before opening the popup once, I face with two selected items in radioGroup. The issue doesn't occur if open-close the popup before trying to set the checked radio.
Is it a rendering issue or something like that?!
I am building an ExtJS4 Web Application and there's a part where the user is shown a "Search Panel". It's basically a floating panel with textfields and a gridView. The textfields allow the user to put his or her input for first name and last name filters. There's also a combo box that the user can use to filter the search. The results are shown in the gridView. The search functionality works well.
However, when the floating panel is hidden and then shown, the fields are reset and the user would have to enter the input once more.
What I want to happen is for the textfield and combobox values to persist even though the panel is hidden then shown again. I have tried using setVisibility(false) then using setVisibility(true) but that did not work for me.
How can I persist values of fields when their parent view is hidden/shown?
The fields should have retained the value as you are just hiding and showing the search panel. It seems there is a bug in your program, but I cannot ascertain that without seeing some code. Assuming that your search panel includes a close button, I would suggest you to use closeAction: 'hide' on the panel instead of using setVisibility(). Also make sure that you are not creating multiple instances of search panel, use a single object of search panel.
Here is a quick fiddle http://jsfiddle.net/DirtyParadoxx/gL9aekzz/
If you want to use cookies, then as Nikolay Lopin suggested, stateful: true would be a nice way of doing it.
I got a ComboBox in Vaadin and want to reload (from db) the set of entries in the dropdown list while typing in the text field of the ComboBox. I always got the exception:
java.lang.IllegalStateException: A connector should not be marked as dirty while a response is being written.
I tried to lock the session (getUI().getSession().getLockInstance().lock();), but it didn't help.
Is it possible to dynamically set/load the selection list of a ComboBox?
Cheers
Stefan
why do you want to change the content from DB as the user type? you'll get a postback and a query every key the user presses... isn't better to use the standard combo feature (which tries to autocomplete the value given what the user is typing)?
Anyway, if you really need this feature, you may extend the standard behaviour of combo extending the container behind the combo, as the data shown is taken from a container.
I have a WinForms app that uses this control and I would like to prevent the user from typing in a date. We want to make them have to use the popup calendar to make the date selection.
I tried setting ReadOnly of course but that puts the whole control into the read only state.
Our version of DevExpress is: 9.1.9.0
You can accomplish this task using the RepositoryItemButtonEdit.TextEditStyle property.
Assign the DisableTextEditorvalue with this property. In this mode a button editor is displayed in its normal way. However, editing and selecting text is not allowed.
Code snippet:
dateEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
The reason I ask is: when I run Jaws 12 on IE9 and hit this page: http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/form/_autoComplete.html
Jaws does not automatically switch to forms mode when I tab to the first combobox: US State test 1. It announces that it is an edit combobox but I cannot use down arrow or alt down arrow to navigate through the state options and pick a state. Is this expected behavior?
According to this blog: http://www.paciellogroup.com/blog/2010/10/jaws-support-for-aria/ Jaws is supposed to automatically switch to forms mode for edit inputs and alt down arrow is supposed to drop down the combobox, neither of which seems to be happening...
This is surprising since dijit widgets are supposed to be accessible...am I missing something here?
As a blind jaws user welcome to the wonderful world of cross browser accessibility quirks. I would say Jaws is supposed to automatically switch to forms mode when encountering a dijit combobox. Using Jaws 13 when I tab to the combo box in either Firefox 12 or Google chrome 18 Jaws automatically enters forms mode. If I navigate to the combobox using arrow keys Jaws does not automatically enter forms mode but this is the expected behavior based on the blog entry you have posted. The current computer I am on has IE 7 and I have behavior similar to yours. Forms mode is not entered when I tab to the combobox. Even when I tab to the combobox and hit enter forms mode is not activated. The only way for me to interact with the combobox is to navigate to it with arrow keys then hit enter. Doing this turns on forms mode and allows me to interact with it. I will test with IE 9 when I get a chance and update my answer with my results.