Vuetify v-combobox automatically selects the typed word when updating items - combobox

When the user starts to typing something in the v-combobox component, an axios request is sending to search users in the database. The content of the list is updating dynamically. The problem is that when items in the combobox has been updated, it automatically selects the word previously typed by the user and updates v-model (and in my case, it creates a chip on the frontend). How to prevent automatic select when updating items?

You may want to use a v-autocomplete component to get the behaviour you're expecting. You can think of combobox as a select so any input is a change/selection and autocomplete as a text field where input filters the dropdown options.

I solved the problem as follows.
Changed the v-combobox component to v-autocomplete. Made a form for adding a new user. Since v-autocomplete does not allow displaying items outside of the list, I disabled the display of v-model contents using a slot and made a custom display of v-model items using v-chip component with deletion.

Related

Ag-grid React Multiple Selection with Checkbox not getting selection change with Api

I want to basically know if I am having rows selected to activate an input, the thing is
"selectionChange" event is not capturing when the selection is being changed I have a small example.
https://codesandbox.io/s/ag-grid-react-redux-events-forked-459v6?file=/index.js
What id expect to happen is to get the alert to show when something is selected on this example.
Turns out in React this property is onSelectionChange, following react pattern

Is there a simple way to fake prepopulated suggestions onclick, but onchange show autocomplete resuts using material-ui autocomplete?

Id like to show a popper with data in it which represents a history of searched suggestions on click, but replace that with the default autocomplete dropdown on type, and keep it unless the input is blank. One idea I thought would work was using a onChange handler to detect the length of input typed... which Ive not managed.
On click of the highlighted value Id like to redirect to another page. Currently I'm using json object to hold a few strings, with urls like this.
To achieve the desired results, we will be maintaining two seperate options searchHistory options & the default options. We can toggle between the options by checking if the input field is empty or user has entered something to search through the default options.
I've modified your code on sandbox. Following is the link.
https://codesandbox.io/s/zen-northcutt-fnc03?file=/src/App.js

clearing a material-UI autocomplete field on the press of a button

I am using material-UI autocomplete for a project that involves rendering a dynamic array based on what you select from the menu. I am finished with the project and now trying to implement multi-select to make choosing things from the menu easier. When you have everything you want from the menu, you click an "Add" button that takes everything you currently have selected and adds it to a table (and adds the properly formatted text into a query on the side, the goal is to build queries for users without them worrying about syntax). When I was not using multiselect, and only adding one thing at a time to the query, I was easily able to clear the autocomplete field by changing the value prop to null. This prevents users from adding the same fields to the query over and over (when add is clicked the options that were added are popped from the list of options). When using multi the rules seem to change and now changing value directly causes an error. My question is, does anyone know of a way to programattically click the x button built in to material-ui autocomplete fields to clear that text field in an event handler? Or is there any reliable way of clearing that on my end?

Angular Formly - HideExpression on page load

I have a number of fields on my form. When the user changes the selected value in a dropdown, there is a hideExpression on each field that shows/hides the fields depending on what the user has selected. This currently works fine.
However, I am trying to make the dropdown default to the first option in the select. This also works fine.
My issue is that all of the hideExpression logic is not being fired upon loading of the screen. So the select is defaulting correctly but none of the fields (that should be shown) that go with that option are visible.
If I manually change the dropdown value then everything is shown correctly. Is there a way to make the hideExpression logic get kicked off even when the select is being defaulted via code?
Here is a JSBin for my issue: http://jsbin.com/doliyiruza/edit?js,console,output
The page defaults to Option2. Yet, there is a hidden field that should show whenever Option2 is selected. So if you change the dropdown to Option1 and then back to Option2...you will see the hidden field. The hide/show logic doesn't seem to get kicked off if you set a dropdown to a certain value by default.
I'm not 100% sure why what you had wasn't working, but querying the DOM in your controller is a very very bad idea. Also, angular-formly intentionally tries to make field IDs non-deterministic so you can't do that (should probably make it more random). Here's what I think you're trying to accomplish: http://jsbin.com/bifaza/edit?js,console,output

Apex radio button check from controller

I have a scenario and i ma getting no where:
I am having 20 record and i m using pagination via standartcontroller and my page size is 1.
one by one record are displayed on the screen and i am having a list or radio button to select options.
When user select a radio button i am getting its value and fill a map with record,value for some processing.
What i want to do is that when a user hits back button the option he has selected in radio button must be visible there. But its not coz every time i m filling new values in the radiobutton list so old values are not sustained.
What i want is when user hits back button he should be able to see the old radio button selected.
How can i achive this:
1.Is there any way to make a radio button list's values be checked through controller.
2.Do I need to use wrapperclass to do this.
Help needed.! Thanks
It will be easier to put this field into object. If you don't have such field in you sObject than I would suggest to create wrapper class in your controller and display list of this wrappers instead of your native sObject.
If your radio button field is already part of the object, then there's no need for a wrapper class, but if the radio button doesn't need to be part of the object then use a wrapper class to keep the object simple.
Check out this example of a wrapper class with check boxes.
Wrapper classes don't have to be complex.

Resources