XPages DojoCombobox user is not allowed to enter a value which is not in the list - combobox

I have created a dojo combobox with dojo (djCombobox),
I get values in to combobox which works very well. I added a screenshot how it should look like...
But user can also enter a value that is not in the list.
It should look like in the picture above and a user cannot be entered a value which is not in the combobox list. How can i do this.

You should use <xe:djFilteringSelect id="djFilteringSelect1"></xe:djFilteringSelect> instead of a combobox.

Related

How to create textbox with pull-down ? When enter something like a search text box , the matched data will be displayed in a pull-down

I want to display like the following image.textbox with pulldown
It's called combobox field with remote query.
You can see example at remote-combo example.
There is example with templating (headers like): remote-loaded-combo.

ListView with Checkboxes and Editable Fields?

I have a ListView form that looks like this:
How do I make it so each cell is like an editable textbox so the user can edit the values by clicking on a cell? Like if they click on "Count" a text edit cursor should appear in-place and they should be able to type to change the value of the field (Not in a separate dialog box or text field)
The ListView is intended for flexible display of a list of items. Similar to windows explorer's ability to show icons, thumbnails, details and basic list, all from the same set of objects. If you really want to edit all of the elements in your data objects, you should probably read up on DataGridView and data-binding.

ComboBox selection not reset to top of dropdown list (items) in javafx 2.2

I have a Source ComboBox to populate source fields (25-30 items) shown below in first page
"A"
"B"
...
"Z"
I have selected last item from ComboBox as shown below
"Z"
and when traversing to the next page after saving, i need to make the source combo selection blank, so i have return the below code to reset the Source combobox to point to first item (to reset the display to start from top of dropdown list for user selection)
// my first value in source List is empty space - “”
sourceComboBox.setValue("");
even if you use below code snippets like
sourceComboBox.getSelectionModel().selectFirst();
sourceComboBox.getItems().clear();
sourceComboBox.getSelectionModel().clearAndSelect(0);
but when i click open the combobox dropdown it still shows dropdown display from bottom as shown below
...
"X"
"Y"
"Z"
I am unable to post images for representing combobox values, so has put in above examples.
This looks like a graphics bug to me or am I doing something wrong?
I have seen similar issue reported in below question but no work around suggested so far
Combobox clearing value issue
If you want to simply "reset" the combo box, I think all you have to do is set the value to null, like so:
sourceComboBox.setValue(null);
I ran into nearly the exact same situation and came across your question while looking for a solution. Fortunately, I came up with a workaround that forces the ComboBoxes to reset. When you reset the data on your pane, instead of doing something like:
sourceComboBox.getSelectionModel().clearSelection();
sourceComboBox.getItems.clear();
do something like this...
parentNode.getChildren().remove(sourceComboBox);
sourceComboBox= new ComboBox(); // do whatever else you need to format your ComboBox
parentNode.add(sourceComboBox);
You'll also need to do a setItems() again on your ComboBox so the new one will be populated. This is not an ideal solution but it seems to be working as I expect the provided clearSelection() method would.
Below is the code you're looking for. It will reset it to whatever index you give in within the parenthesis.
sourceComboBox.setSelectedIndex(0);
Goodluck
Most of the things were giving me an error when I tried them. What worked best for me was to use this
comboBox.getSelectionModel.clearSelection();
This will essentially set the value of your ComboBox to null. Because of this, if you are referring to the value of the ComboBox in another place, it becomes important to check for whether the value of the ComboBox is null using this
if(comboBox.getValue() != null)
//Code segment here
The ComboBox control has not a method like scrollTo(index) of the ListView. So it seems hard to workaround that behavior. You can issue a feature request at JavaFX Jira.

Does anyone know of a good load-on-demand combobox for WPF?

I have been searching for a while now, and have not been able to find a load-on-demand combo box that populates itself depending on what is typed in the combo-box.
I also have a requirement that an item in the list must be selected (i.e.: free text can be entered but not "selected" - only a "search result" can be selected from the list in the combo box.
The scenario is as follows : there is a text box/combo box where someone enter the first 2 or 3 characters, a web service is called which queries a database and then populates the combo box.
Are there any controls or code example that anyone knows of? Or alternatively another way to implement this?
Here is a link to an asp.net control that has this functionality:
http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/autocompletesql/defaultcs.aspx
use the event "textchanged" to dynamicly add/remove items :)
updated :
why not bind the results to observable collection and databind that to the combo box , so on chnage > query database > bind items to the collection , .net automatilcy updates the items , this might work :)
Telerik combobox with autocomplete will be what you are looking for.

Alternative Content for a Selected ComboBoxItem

I need to place a ComboBox in a place where I have very limited space. Is there any way to show content for the SelectedItem in the ComboBox that is different than the content that is displayed for the item in the ComboBox's Popup?
As an example, Firefox does this with it's Site Search box in the top right of the browser. When you open the dropdown, the site names are displayed along with their respective logos, but when a site is selected, only the icon is displayed.
UPDATE: Solution found :-)
I found a solution at this site:
http://blogs.windowsclient.net/airborneengineer/archive/2009/06/25/wpf-styles-and-templates-part-ii-combobox-customization.aspx
I just needed to modify the "DisplayImageWithText" DataTemplate to only show the field I want.
Yes, have 2 sets of data and change the display member column of the combobox - according to the position. as long as the value is the same, it will work good, and you'll get 2 displays out of the same combo-box.

Resources