Strange Vaadin Combo box behaviour - java

I have the following UI in my Vaadin app. 1. A USER combo box linked to a users container and 2. a UI table with a list of STUDENTS linked to a students container.
I am periodically refreshing the students container every 10 seconds. However on refresh of the students container, if i have the combo box list selected the items are grayed out and then i have to re-select the combo.
The como list is ok until the refresh, thereafter all the elements are gray.
I dont think this is normal behavior? Any ideas on to how to resolve this?

you can put all your elements from SQLContainer to an indexed container and set that as a source to comboBox, alternatively , you can add the values of desired property of SQLContainer to an arrayList and get items from arrayList to add to combo list

Related

Android ListView Math equation Interface

I want to program an activity where a user has an input interface to enter three different values(an equation) and a listView to display them.
My current app uses an arraylist in which(with arraylist.add) a new value gets added. With adapter.notifydatasetchanged() the standart adapter is updated and the list view changed.
But my programme needs to have 2 additional features:
getter Functions on the listView in order to later use the entered data
the possibility to delete an entry in the list by for example pressing it
One approach of mine would that there should be a function that's the opposite of Arraylist.add() in order to delete an element from the data shown in the list view(I wouldn't need getter Functions from the ListView) But in order to delete a certain element I would still need to know which element was clicked...
Although this should not be such a special problem I haven't found a good solution for this specific problem so any kind of experience is appreciated:D...
Thank you very much
You can add do this with 2 approach:
1.Delete at once's - Means add a Delete button in each item of list and by click of that button you can delete that data item from ArrayList and then notify Adapter to refresh ListView
Also you can add deleted Item in separate ArrayList for your record which items was deleted so you can use this for your further business operations .
2.Delete Bulk data- For this add CheckBox in each item of list and by click of that button you can add that data item in separate ArrayList for selected items for deletions. And When you want delete add some delete button on header or bottom of ListView you can delete selected Data Items from ArrayList of Initial Data list and notify Adapter to refresh ListView.

Javafx : Remove an item from TableMenu

I have a TableView with setTableMenuButtonVisible(true) but i want to remove the "x-th" item from the contextMenu list so the user cannot hide that column. I found the columnPopupMenu in the TableHeaderRow but I don't know how to manage it's items. Is there a possibility without a dirty workaround?

add checkbox item inside Listbox gwt

How can we add Checkbox item inside Listbox or there is a checkboxlist i did not see ?
i want to get a list of checkboxes that i will after filter a list of appointments by checking those checkboxes
GWT 2.2 , java , eclipse
You can't add widgets like a CheckBox to a ListBox, nor is there a CheckBoxList, but you can use a CellList with a CompositeCell (TextCell + CheckboxCell) and it'll do what you want.
I don't think you can add checkboxes within the Listboxe.
You can probably create a List box with multiple selection enabled.
ListBox list = new ListBox();
list.setVisibleItemCount(10);
list.setMultipleSelect(true);
Here is something using GXT's XTemplate (if you want only GWT then use Template).
Other than that, how you pass your data is something you can define, but if you go with GXTs ModelData then this could work.
https://gist.github.com/Aadi1/4949994

Creating a multiple column combobox in Java

I need to create a ComboBox in Java that will have information in a column on the left and a Checkbox in a column on the right so that a user can select multiple items in the ComboBox. This needs to be a ComboBox because there could be 100 items in the list that may need to be checked but they cannot take up much space on the user interface.
Does anyone know how to do this?
Using a JList inside a JScrollPane seems more appropriate for dealing with that many items. It supports the standard CTRL-click to select multiple items.
A multi-selection combobox with 100 items sounds like a UI nightmare.

Problem selecting the value from a JComboBox binded to a list

I have a JComboBox binded to an observable list (result of a jpa query) in a java desktop application. It gets all the values from that list and displays them correctly, but I'm not able to select any particular value from the dropdown: that is, when I click on the widget the list of options gets displayed correctly, when I click on an item the list closes and the first value is shown independently from the selection of that particular item.
However, no exception is thrown.
This problem occurs if I have more than a model associated to the same entitymanager.
What's wrong with that?
I solved it using two separate entitymanagers for each model I have in the frame.

Categories

Resources