Hello, last video, I'll show you how you can create a dynamic native component in a component in at runtime. In this video, I just want to display this menu. And I will show you how you can invoke this action to navigate to the page dynamically at runtime. So here, this is our parent, as I told us, the first step is just put an appearance in your a page as a component, then you bind this component into the back bean which is here. So now I just will comment this code, which is just a sample which we created. And I need now to connect to the database and I need to loop first over main system menu, which we'll get to the main menu.
Also set for each menu I need to loop over sub menu and they get the old data from the sub menu and the create the main menu item inside them and to do this, I just create the code for you. So what I did here is I carried carried medium function called Create menu. This function will select a menu ID or menu description from a main system menu. So this is we'll loop over the main system menu. We're active equal way to get all active menu. So for each menu, I will get a menu ID and description for each menu, menu ID and description.
After that, I will send after that Ferris I will create a menu new menu rich menu I will create yours menu and they will sit take us to wizard scription. After that, I will send this menu which I created and the menu ID to the sub menu which will loop over sub menu with some menu active equals boy and the parent equal the parent which are you. So I will get the child to the children of the main menu. So I will move over the children and I will give the description and action then I will create a new rich component menu and I will set it thickest with that description. Here to sit action action action take method binding, so I will create a new action method binding and I will set that method binding to the set action and you action is boiling, we'll take the action name so actually action binding sucks internal clause, which I created, which will take sec action action code for this clause and after that to return amis binding and you can see that action was dismissal binding.
So this is how you can invoke an action from the back pain. Then I will get the menu the parent menu which I said and I will add the symbol so it will keep over over over all the children for this menu, which I sent menu ID and it will fill the children of this menu. After that I will return the menu back again here it will receive a menu after that I will insert the menu to the bureau so this is how you can loop over the menu on sub menu and make action and so on. So let's think I just we need to do is as the sub menus are some action here dips in search. This takes me to just two examples. Section dips and maybe search dips.
Just to show you how we can do it. So, I will create here. This is add here this is dynamic you would create here your minutes and maybe soon search viewport mints and we can add here action dynamic it will return to the main page. And for the verse means a search Bachmann's latest ad the same action outcome which we store here is a database. So, here Bachmann's and search dips share sheets. So let us create departments is F and create departments okay.
So here it departments you just with that your diction and they will just drag the department's okay so departments is here to this add button which will return to the dynamic beach is here to here toolbar and I would add bottom which will return back return to my dynamic okay and in the search I will add here so the mode when search query query was table okay and we can add back to dynamic beach okay so now I can adjust to beaches was the outcome dips and surgeon's tips which we toured is database Okay, but we have fairest to call this function from this function because is the constructor we call create a dynamic menu. And in the curriculum menu, I will create a query to make the test run. Let's see. Okay, so as we can see now, our system menu is generated and read it from the database.
If I select departments now, it should move to the department's page and you can back again and we implement as well as a search. So if we go for the search departments, it will move To the search towards the back. So, this is how you can dynamically generate menu this will try to make a small list which will go to two sub sub menu and we can maybe hide in between these make it n and in the main menu we can hide maybe the transaction so I will hide here the transaction to make it no okay so let us refresh will find transaction is disappear and the lookup has already department. So, that was the menu has become dynamic and read from the database. This is how you can create a dynamic menu and you can do anything The IV component can be created dynamically. So if you, for example, want to create a Bennett tab, tab, so what you will do, you will create a pending tab here maybe if you want for each departments you needed here in a tab at runtime.
Okay, so what we'll do first we need to create a parent component as it will do parent component which I need to insert the tap. Second thing I need to add to bind this component maybe Penny tap period parent This is a first tip just a parent component and the point it is a pain it's a pain after that knows what what is the class name of the bending step so I will add here a penny step Okay, was one detail item since I will point the bundle tab to know what is the Java class map to it benefit tab and I need to know as well show detail item which I will create inside the bin. Okay. So, now is the pin, I should know for the panel tab Do you use Richard Bennett and should it meet us rich shoe detail item. So, now we can remove it now here and we keep our parent.
So it is same like any This is way which can be implemented for any ADF components. If you need if components you want, you can do as the same so we have the Bennett apparent and we need to create rich benefits. For each department, we can all live over the department and create Richmond equal new tab and set it Bendel tab. After that we go cold shooting item and city shooting tickets and so on. This is a way how you can create a PDF dynamically at runtime because the video will show you another feature so see you next video.