Create a Dynamic ADF Components in Your ADF Application

Advanced Oracle ADF 12c Course View|Create Dynamic ADF Components at Run-time
20 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€64.33
List Price:  €91.90
You save:  €27.57
£55.09
List Price:  £78.70
You save:  £23.61
CA$95.29
List Price:  CA$136.14
You save:  CA$40.84
A$104.44
List Price:  A$149.21
You save:  A$44.76
S$94.20
List Price:  S$134.58
You save:  S$40.38
HK$546.10
List Price:  HK$780.18
You save:  HK$234.07
CHF 63.62
List Price:  CHF 90.89
You save:  CHF 27.27
NOK kr751.73
List Price:  NOK kr1,073.95
You save:  NOK kr322.21
DKK kr480.45
List Price:  DKK kr686.39
You save:  DKK kr205.93
NZ$114.09
List Price:  NZ$162.99
You save:  NZ$48.90
د.إ257.07
List Price:  د.إ367.26
You save:  د.إ110.19
৳8,195.22
List Price:  ৳11,707.96
You save:  ৳3,512.74
₹5,830.20
List Price:  ₹8,329.22
You save:  ₹2,499.01
RM328.07
List Price:  RM468.70
You save:  RM140.62
₦102,885.30
List Price:  ₦146,985.30
You save:  ₦44,100
₨19,393.48
List Price:  ₨27,706.17
You save:  ₨8,312.68
฿2,536.99
List Price:  ฿3,624.43
You save:  ฿1,087.43
₺2,256.71
List Price:  ₺3,224.01
You save:  ₺967.30
B$357.27
List Price:  B$510.40
You save:  B$153.13
R1,265.02
List Price:  R1,807.25
You save:  R542.23
Лв125.89
List Price:  Лв179.86
You save:  Лв53.96
₩94,793.75
List Price:  ₩135,425.45
You save:  ₩40,631.70
₪259.28
List Price:  ₪370.41
You save:  ₪111.13
₱4,039.50
List Price:  ₱5,770.97
You save:  ₱1,731.46
¥10,895.69
List Price:  ¥15,565.94
You save:  ¥4,670.25
MX$1,162.43
List Price:  MX$1,660.69
You save:  MX$498.25
QR253.91
List Price:  QR362.75
You save:  QR108.83
P948.27
List Price:  P1,354.73
You save:  P406.46
KSh9,168.69
List Price:  KSh13,098.69
You save:  KSh3,930
E£3,283.23
List Price:  E£4,690.53
You save:  E£1,407.30
ብር4,009.02
List Price:  ብር5,727.42
You save:  ብር1,718.40
Kz59,310.71
List Price:  Kz84,733.22
You save:  Kz25,422.51
CLP$62,605.89
List Price:  CLP$89,440.82
You save:  CLP$26,834.93
CN¥505.55
List Price:  CN¥722.24
You save:  CN¥216.69
RD$4,078.44
List Price:  RD$5,826.59
You save:  RD$1,748.15
DA9,404.82
List Price:  DA13,436.03
You save:  DA4,031.21
FJ$155.95
List Price:  FJ$222.79
You save:  FJ$66.84
Q543.74
List Price:  Q776.81
You save:  Q233.06
GY$14,641.89
List Price:  GY$20,917.88
You save:  GY$6,275.99
ISK kr9,678.91
List Price:  ISK kr13,827.61
You save:  ISK kr4,148.70
DH693.20
List Price:  DH990.33
You save:  DH297.13
L1,231.95
List Price:  L1,760
You save:  L528.05
ден3,957.99
List Price:  ден5,654.52
You save:  ден1,696.52
MOP$562.43
List Price:  MOP$803.51
You save:  MOP$241.07
N$1,273.79
List Price:  N$1,819.78
You save:  N$545.99
C$2,572.13
List Price:  C$3,674.63
You save:  C$1,102.50
रु9,330.17
List Price:  रु13,329.38
You save:  रु3,999.21
S/260
List Price:  S/371.45
You save:  S/111.44
K271.59
List Price:  K388.01
You save:  K116.41
SAR262.46
List Price:  SAR374.96
You save:  SAR112.50
ZK1,777.13
List Price:  ZK2,538.86
You save:  ZK761.73
L320.28
List Price:  L457.57
You save:  L137.28
Kč1,590.03
List Price:  Kč2,271.57
You save:  Kč681.54
Ft24,925.85
List Price:  Ft35,609.88
You save:  Ft10,684.03
SEK kr750.08
List Price:  SEK kr1,071.59
You save:  SEK kr321.50
ARS$62,063.63
List Price:  ARS$88,666.13
You save:  ARS$26,602.50
Bs483.56
List Price:  Bs690.83
You save:  Bs207.27
COP$266,463.69
List Price:  COP$380,678.73
You save:  COP$114,215.04
₡35,817.30
List Price:  ₡51,169.76
You save:  ₡15,352.46
L1,723.87
List Price:  L2,462.78
You save:  L738.91
₲524,369.02
List Price:  ₲749,130.70
You save:  ₲224,761.68
$U2,697.33
List Price:  $U3,853.49
You save:  $U1,156.16
zł274.39
List Price:  zł392.01
You save:  zł117.61
Already have an account? Log In

Transcript

Hello, in this video I will show you how you can create a dynamic EDF component at runtime. For example, if you have a system menu exists in the database and you want to display a dynamic menu, so you need to get it from create the menu for in at runtime, depending on what existing database or if you want to create a dynamic tab if you want to have tab should be created from data coming from the database at runtime. So in general, I will show you in this video how you can carry it IE dynamic if component in your page at runtime. I will give you two example in this video. So in this course, I will first I create this HR database schema tables. I create two tables won't call main system menu and one call sub menu you in the in this course resource in the beginning of this course the there is an object script, you will find the script which would create this two cables in your HR.

What I need to do is I need to add here my main menu menu has three column is this is for the ID, this is a menu description which should appear in the main menu here and active if this active or not active, you can control if you want to disable it or enable it. So it does create some sample menu in our system and see how how we can display this menu at runtime. So first, I will create here for example menu ID menu description we can call it lookups active maybe why To search why three transaction Why? Okay, this is I have this three menu main menus and in the sub menu here that has add sub menu for each of this big menu. So menu one for the parent which is one is a lookups we can add some menu description like four minutes so menu action tips.

This is movies a menu option which will navigate to the beach was would come depths submenu active yes okay let's add another one for lookups call Emily's action and why three will be for the main mirror to which will be searched we can see search okay so here I create for each beer on the menu to beech forest we're on to will have a look up which is the bark missing Bay employees This is for search this is for renewed automate or numeral II is just for a simple sample example. So let us know try to explain in general How you can create a dynamic PDF component at runtime. After that, we will do this example. So, let us create a symbol symbol pitch Okay. Now, we need to know how we can query any PDF component at runtime. So the first thing you have Farish to know which clause or is this component will be present in in the Java class.

So for example, if I need to insert a menu, a few menu, so I need to know is this if menu is what Exactly is a class which map to this if mean you show how to do this. So first I will add the component which I need to create it at runtime. So in our example I need to create a menu so let's add menu Okay, let's look at menu bar mean v menu bar will appear on but we will add a menu inside it. menu. So now I to create this menu in a Trump time. So, how you can do this.

First I need to bind this component to the backbeat. So, I will create a bean here, my P my bean And I need to create a vertical menu combo. So, as you can see here, it creates a rich menu. So now I know to Create menu item type I have to create object of reach menu, Oracle ADF, view rich component rich rich menu. If you want to add the bottom at runtime, which clause Okay, I need to add a button at runtime I will add now a button then I will go to the binding and let us bind this bottom and see what actually is a crossword we'll create it create rich bottom. So the first thing you need to know is what is class the ADF class which represent your component which you want to create it at runtime.

So now we know to Create Menu all you need really menu. If you want to know what is the menu item, which is a sub menu in our sample menu items, so I would find menu items and did we know what actually sis will represent? It should be rich menu, which command menu item. So, any component you want to create it dynamically, you have to first fight it to know which clause if you notice it's a clause, no need to bind it just just for your information after that, do you need actually this component at all in our pitch? Okay, because the first thing we did is to know which clause Java class I need to use to create the component at runtime. This is the first step second step.

You should have a component in your page which will contain your body dynamic component. For example, in my example here, I need to create a menu at runtime. So, I need to put a component in my beach, which will be the parent of this dynamic component which I will create at one time. So I will add here, menu bar, this menu bar will will be my parent component, which I will create dynamically, the menu and the menu item items as a child as children to this menu bar. So what I should do with this parent, I should bind it in the back. So I will bind this menu bar by beans so I could call it parent menu bar.

Okay, So, this is the second step again first step just to know what is the class name of the component which you should use to create the component type. Second thing, you should add a beer on component in your page and the binds is parent component as an object in a baggie. Now, we can start creating a component at runtime. So for example, if I need to create some menu now, let us make it static. I will not connect to the database but just the statics to create some menu inside this show for what what you should do is create here a function private, void, Kitty dynamic menu and we can call this function From the constructor or from anywhere now I need in this code I need to create a dynamic menu give some space here okay. The first step you need to get my parents my bill which I added here in beach and I binded it in their back pain, so I need to get this parent first.

So I will say parent but what inside this parent you will find here at all Get the children what is this getting the children it will get the list of component which is inside this parent. Currently, there is no component. So this list will be null. Not not the site is zero dot get Sheldon. As you can see it is a return list of UI component. So this is our list of children.

So we can't call here. List UI component. My sure drink equal. If you want to exactly know what it is, you can go to get children here. You'll find this list UI component you can copy it and put it here. So this is the object which the bureau will return.

So now I have a list of my children. Let's import this show for your to do. list and UI component will be Java two trees to component Ok so now I get a list of my children I need to create this children first after that I will add it to this list. So how we can do this now I need to create menu or new now it called rich menu. So I will create object of rich menu first or menu one equal new rich human now I will create object of Richie Rich menu okay which should be added inside this menu bar. After you create an object to fish menu you should set the attribute same like if you have a menu here what what actually you will set if you have menu here.

If you add menu so what you actually use it you will see the thickest The description should appear so here I will set the tick is to sit thickest be lockups. Okay, this is all what I need to do it now for this menu it is limited. Just I just want to show you how you can create a menu at runtime so I create object of Ritu menu and I set the tickets to be lookups after that I need to add sub menu inside this menu. Okay, so to create sub menu, we know switch command menu item. It will add menu item inside this menu. So I will create rich command menu item.

Tip equal new, rich mode menu item and tip to city tickets You bought mints and I need to create another menu item inside this menu one or look up score in Billy's and he should be m after that I need to add this to object inside this. So I will go to the menu one dot get a chill, drink booked looked at I need to add depth and all you need to add it okay so now I create one menu called lookups After that accurate tool menu item, and I add, I get his children off the menu one, dip one gets shaded one and after that I should add the blue one to my appearance. So actually no need to write this here. Right now, we can straight away edit. After you create your menu, you can go here and say get my parent component which is this to get children to add and I will add my menu one.

Now we created one menu in my parent component. Okay, so before we start running, we just need to make two changes First, I need to check if this is not null. should create an object okay. So I will just add if condition. If it were on the menu bar component equal equal not If it is not, it means that he still didn't create this parent component it could just be on the component. So, I will create it after that, I will add the choice otherwise I will get null pointer exception if this object is null.

Second thing I need to do is I need to call this function is the constructor. So, I will go to the constructor here and I will call this function in the constructor. If you want to call it only one time, to be sure it is only one time is rubbish not every time you can right here, if phases contest if contiguous equal if this is contiguous This is if this is contiguous dot get current instance after that we can see if it if contest.is post back. so we can write here if not post back you can call this just to be sure that it will call only one time at the beach because the bean of this is a request been so every action will go to constructor, but if you are in the same page and you make any action, it this this postback will return true.

So, this not it means it will just enter here only one time. So, now, we can use this in a constructor to call my dynamic function and in dynamic function here Create rich menu with stickers to lookups insights this rich menu I add to I get Should I add two component one is department here and second is so it should be in the city tickets here and after that I will add two components inside the menu which is department and after that I will get the beer on and the chick if it is not I would create your component otherwise I will get shouldn't add the main menu one. So this has now run this run this application and check if this menu will generate it at runtime or not. Okay so as you can see here, the lookups menu is created and there are departments and employees A menu is created at runtime.

So this is how you can in general, create a video component at runtime and gets the children in this component and try to work in this component. Nick is the video little symbol with our custom menu. So see you next to it. You

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.