Hello, last video, I show you how you can implement an auto suggest for list of value on the list of value. In this video I will show you how you can implement this at any input tickets programmatically you can fix features or data or the suggest items from any database table and he gives his suggestion to the user. For example, here the first data of St. Louis, I need once the user starts entering the first name, it should get the old first name which already exists in the database table and give him as such as Alright, so as I show you last videos, that is a component which gives the auto suggest is auto suggest. So I will insert inside this input text it faces and I will select it to such just behavior. Okay, so now to get the data which you should display it to the user once the user starts typing or entering the data, I told you last video should be in the suggestion item but this video I'll just type I need to it programmatically.
So I will select here. I can read it. I carry it a manage been coded muy bien. Muy bien in view to be in package, so I would create a managed bean for this and the method should be first name. Items okay. This Have a look again here dictate again here and so this is just I think is might be into first name suggested.
So here let's go to choose a bean and see there you create it method which should return a list list of what should be list of select items. So I will create here list of select item call it select items you equal new edited a list of select item And I should return this selected, but in between here I should fill this select item lists so I will implement the Java fizz module to select items here and the ArrayList should be Java dot util dot ArrayList. Okay, so now I have create list of the select items. And I need to fill this selected you can fill this select item from anywhere you want you can get any view object you have and loop over this view object and fill this select items or you can run selected statement in your Java code bind to any other table you have and filter select items So in this video I will show you how you can write your SELECT statement from the Java good boy into the MVP table and the pitch old first name and fill this selected.
Okay, so here I create a code, which will run a security statement and start filling the select items. So here I need to write the selected statement which will get the suggest items. So I will write here select the first name from MB wheeze because I either suggest it should be a first name. So once the user start entering some first name that suggested first name should display to the user. So I need to select the first name from an MVP but I Need to filter this will first name they've been the ones or letters which is a user start entering in sample tickets. How I will get this value is a value which is the user start entering his name with tickets I need to get this value under start filtering my first name in St Louis.
So, I will write select the first name from William bill we were will first name like and I need to get the value here from who is a very wishes a user is start entering it and we say like this how you get this value from the auto suggest your hint this object which car Don't get the submitted value. So once a user is start submitting its value, I will run this SELECT statement which will get the first name from an employee, where in first name like what is the user suggest like this this is it means it is start with if you want to contain you should add this contain. So what it does is start with a ID once the user enters a value it should get the first name, well first name like whatever the user is suggests. Here, I will get the connections the connection will point to your data source which you defined in your WebLogic and start running this SELECT statement.
So, I will loop over the result of this SELECT statement and I will get the list and I will add new select item with Felicity name. So it will loop over the result of this SELECT statement and start adding items to this list after that it will return the list. So this is how you can programmatically filter the list, which you want to send it to the user as a suggestion. And you will fill this list from selected statements from the table you can define any table so you will just receive the value submitted value from the user and run your SELECT statement which will filter the data depending on the submitted value. After that you will look over the result of the select statement and store. You start filling the list then you will return sentence.
This is how you can programmatically filter Phil solicits off suggestion item and this artist Just behavior as you know it is pointing to the very suggest items. So, let us now try to run this and test this feature Okay. So now let us go to the first name and start typing. Let us see this now with the start filtering and getting the data as you can see, if you enter something not exist you'll find no results found and it now works as expected. So, this is how you can implement auto suggest in EDF if you want to get it programmatically from any tables or using list of value. So, this is the two ways you can implement the auto suggest