Flex 4 DropDownList Selected Item - flex4

the standard behaviour of a Flex dropdownlist is to disable the currently selected item from the list. Does anybody know how to override this to allow the user to re-select the selected item (if they so desire)?
NOTE: I don't want there to be a selected item in the list but I still want the selecteditem property to be set in the dropdownlist control, otherwise how will I know what has been selected. This is slighly trickier than it sounds...unless I have missed something...
Thanks
Mark

I'm not sure I understand the question but you can listen to close event of the component :
Dispatched when the drop-down list closes for any reason, such when the user: Selects an item in the drop-down list. Clicks outside of the drop-down list. Clicks the anchor button while the drop-down list is displayed.
So, you can access the component and gather the selectedIndex, selectedItem properties.
I guess what I'd like to know is that why you want to "re-select", possible to trigger something again but I'd try close event...

Related

MAUI Show/Hide controls based on mode New/Edit/View

I need an idea, please. I have a Details form which shows the fields of a model (about 10 fields in all). There are three modes in which I could show this view - in mode "Edit", in mode "New" (which, of course, is like an edit but without values), and in mode "View" (no changes allowed, just labels).
I could of course create three Details pages, one for each mode, and call them selectively, but I would like to have just one and pass the "DocumentMode" parameter to it. That View should bind to that mode and selectively show/hide controls, probably like "DocumentMode = VIEW => Show labels" or "DocumentMode = EDIT => Show Entry or Editor, show DatePicker, TimePicker, etc".
My question is this: How do I show/hide these groups of controls depending on the DocumentMode parameter ? Which would be the best way to do this ? I could probably bind the "IsVisible" property to my documentMode parameter, but I think that is a really ugly solution (and I assume that regardless of whether the controls are used or not in a specific mode, they will all be loaded anyway).
Thank you.
Alex
I think you can use a Listview or Collectionview to represent your data because you mentioned that you have 10 fields.
In addition, you said you need a "new" button, so you can set it at the top of the app as a button, when you click the button then you jump to another page which is blank and you can add the data.
This must refer to the shell you may need to set a navigation.
Then the "view" and the "edit" you can use the property SelectionChanged to control the item, I mean when you click the item in collectionview, the SelectionChanged method can be triggered and turn to another page which can show the detail about the item you clicked. In the page you can view and edit the data.
Here are some articles you might be able to use: Listview, Collectionview, Shell
If you have more information to add, please kindly share with me.

How can I deselect all selected option of a dropdown when selecting an option in a different dropdown?

I am having two dropdown menus/ comboboxes on which I can select content which I wanna display on a DataTable.
The first Combobox is called ColorCombo and gets the following options to choose from an Excel sheet:
Sort(Distinct(Table3;Color);Result;Ascending).
The second Combobox is called SizeCombo and gets the following options to choose from an Excel sheet:
Sort(Distinct(Table3;Size);Result;Ascending).
My question is how can I make my code work so that each time I choose a color on one dropdown, then all options from the other dropdown are being deselected? I tried to reset the comboboxes when the onChange even triggered as follows:
ColorCombo onChange : Reset(SizeCombo)
SizeCombo onChange : Reset(ColorCombo)
But this doesn't work because every time I choose a new option then all options from the drop-downs are being unselected because the events trigger each other. Could someone help understand how I could go about it?
If you can only have a value in either one of the drop downs, you could make the onChange variable of each one set the DisplayMode of the other one to Disabled. eg:
ColorCombo onChange : SizeCombo DisplayMode.Disabled
SizeCombo onChange : ColorCombo DisplayMode.Disabled
Sorry if I misunderstood your question!

Custom drop-down as an item in a kendo tree

I am trying to create an item that is a button "show more" and when you press on it you can show a kind of context menu / drop down that all of the items in that drop down are with checkboxes and there is a search component in it too, so you can search some items in the dropdown by their name. For example: (instead of "c++,c#,Object c" it's should show "show more", i.e. static text)
I tried to use kendoContextMenu. But I don't know if it's could work because the problem with context menu is that when I will click on a checkbox the menu will close. Please advise me of a way to do that or if you have an example of code. Thanks!
The MultiSelect component might be a good starting point
https://docs.telerik.com/kendo-ui/api/javascript/ui/multiselect.
My understanding is that MultiSelect does not have a "select more than one at a time in dropdown" feature.
You might consider using a pop up window and within that implement your own custom ui that features everything you want
search term box
scrolling list of selected and selectable items
accept or cancel changes in selection
Regarding your dojo that extends drop down list, I can't code the extension for you. However, changing the dataSource assignment to a setDataSource call will populate the extension component according to the template.
// kendo.ui.DropDownList.fn.dataSource = options.testItemSource;
me.setDataSource(options.testItemSource);

Win32 ComboBox: Programmatically select (highlight) string from the list, without update the edit control

My goal is to Programmatically select items from the List of the combo box, but without updating the edit control. The same can be achieved with the mouse. E.g. when you drop down and hover an item from the list, that item is highlited. And that is all. If you want to select in it the combo box (e.g. move it to the edit control) - you must click on the LisBox.
I tried with CB_SELECTSTRING. But it automatically updates the ComboBox edit control with the selected text which is not what I want. I want to do this using raw Win32 or VB6
Thanks
There is a big difference between highlighting an item in the drop-down list and actually selecting an item to make it active. CB_SELECTSTRING selects an item, as its name implies. But there is no official ComboBox API to highlight an item, though.
However, you can display the drop-down list manually (CB_SHOWDROPDOWN), and either:
move the mouse over the desired item so the list can perform hot-tracking logic.
manipulate the list directly. Use CB_GETCOMBOBOXINFO or GetComboBoxInfo() to get the list's HWND, and then send LB_SETCURSEL to it.

Multiselect option with remove item

I'm looking for a Qt/QML multiselect control that have a remove button.
I want to add a filter builder and I didn't find a good example or control for this purpose.
I can design token by myself. I'm just curious if someone already did that and can share it.
Multi filter selector
Thanks
A simple radio button for each option can do the job. If you do not include all these radio buttons under an exclusive group, a second click on these buttons deselects the option.
A click on the radio button includes selected option in the search results and second selection removes the option from the results.
An extra button which deselects all the radio buttons can also be added.
I don't intend to insult or disrespect you, but i think with radio buttons the task takes less time than posting this question.

Resources