Implement List of Values Switcher

Advanced Oracle ADF 12c Course Model|List of Values Switcher
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
€67.24
List Price:  €96.07
You save:  €28.82
£55.68
List Price:  £79.55
You save:  £23.86
CA$100.66
List Price:  CA$143.82
You save:  CA$43.15
A$111.82
List Price:  A$159.75
You save:  A$47.93
S$94.88
List Price:  S$135.55
You save:  S$40.66
HK$543.79
List Price:  HK$776.87
You save:  HK$233.08
CHF 62.67
List Price:  CHF 89.54
You save:  CHF 26.86
NOK kr792.28
List Price:  NOK kr1,131.89
You save:  NOK kr339.60
DKK kr501.55
List Price:  DKK kr716.53
You save:  DKK kr214.98
NZ$123.71
List Price:  NZ$176.74
You save:  NZ$53.02
د.إ257.07
List Price:  د.إ367.25
You save:  د.إ110.18
৳8,328.16
List Price:  ৳11,897.89
You save:  ৳3,569.72
₹5,958.01
List Price:  ₹8,511.81
You save:  ₹2,553.80
RM314.25
List Price:  RM448.95
You save:  RM134.70
₦108,236.03
List Price:  ₦154,629.53
You save:  ₦46,393.50
₨19,398.69
List Price:  ₨27,713.60
You save:  ₨8,314.91
฿2,394.21
List Price:  ฿3,420.45
You save:  ฿1,026.24
₺2,465.01
List Price:  ₺3,521.60
You save:  ₺1,056.58
B$426.13
List Price:  B$608.79
You save:  B$182.65
R1,290
List Price:  R1,842.93
You save:  R552.93
Лв131.30
List Price:  Лв187.58
You save:  Лв56.28
₩101,582.03
List Price:  ₩145,123.41
You save:  ₩43,541.37
₪254.54
List Price:  ₪363.65
You save:  ₪109.10
₱4,098.92
List Price:  ₱5,855.86
You save:  ₱1,756.93
¥10,967.38
List Price:  ¥15,668.35
You save:  ¥4,700.97
MX$1,406.50
List Price:  MX$2,009.38
You save:  MX$602.87
QR254.06
List Price:  QR362.96
You save:  QR108.89
P963.25
List Price:  P1,376.14
You save:  P412.88
KSh9,053.20
List Price:  KSh12,933.70
You save:  KSh3,880.50
E£3,568.78
List Price:  E£5,098.48
You save:  E£1,529.69
ብር8,687.63
List Price:  ብር12,411.43
You save:  ብር3,723.80
Kz64,250.82
List Price:  Kz91,790.82
You save:  Kz27,540
CLP$69,297.02
List Price:  CLP$99,000
You save:  CLP$29,702.97
CN¥510.87
List Price:  CN¥729.84
You save:  CN¥218.97
RD$4,243.89
List Price:  RD$6,062.96
You save:  RD$1,819.07
DA9,435.69
List Price:  DA13,480.14
You save:  DA4,044.44
FJ$162.05
List Price:  FJ$231.51
You save:  FJ$69.46
Q536.99
List Price:  Q767.16
You save:  Q230.17
GY$14,580.66
List Price:  GY$20,830.41
You save:  GY$6,249.74
ISK kr9,757.30
List Price:  ISK kr13,939.60
You save:  ISK kr4,182.30
DH701.41
List Price:  DH1,002.06
You save:  DH300.64
L1,291.33
List Price:  L1,844.84
You save:  L553.50
ден4,135.36
List Price:  ден5,907.91
You save:  ден1,772.55
MOP$557.92
List Price:  MOP$797.07
You save:  MOP$239.14
N$1,283.07
List Price:  N$1,833.03
You save:  N$549.96
C$2,564.57
List Price:  C$3,663.83
You save:  C$1,099.26
रु9,479.94
List Price:  रु13,543.35
You save:  रु4,063.41
S/259.51
List Price:  S/370.75
You save:  S/111.23
K282.61
List Price:  K403.75
You save:  K121.13
SAR262.99
List Price:  SAR375.71
You save:  SAR112.72
ZK1,928.73
List Price:  ZK2,755.44
You save:  ZK826.71
L334.62
List Price:  L478.06
You save:  L143.43
Kč1,690.23
List Price:  Kč2,414.72
You save:  Kč724.49
Ft27,882.67
List Price:  Ft39,834.10
You save:  Ft11,951.42
SEK kr772.23
List Price:  SEK kr1,103.23
You save:  SEK kr331
ARS$71,547.27
List Price:  ARS$102,214.77
You save:  ARS$30,667.50
Bs481.59
List Price:  Bs688.02
You save:  Bs206.42
COP$305,890.51
List Price:  COP$437,005.17
You save:  COP$131,114.66
₡35,162.35
List Price:  ₡50,234.08
You save:  ₡15,071.73
L1,769.11
List Price:  L2,527.41
You save:  L758.30
₲543,432.39
List Price:  ₲776,365.26
You save:  ₲232,932.87
$U3,131.93
List Price:  $U4,474.38
You save:  $U1,342.44
zł286.59
List Price:  zł409.44
You save:  zł122.84
Already have an account? Log In

Transcript

Hello. So in this video I need to implement this list of value switcher. And I will show you step by step, how you can define a list of value over multiple lists of value over one attribute with a switch. So let's go to the jdeveloper and start implementing this. So now I have created a new application called list value switcher. Okay, so let's now implement the model from HR.

Okay, so let's create to automate and in buoy this, what we will need in this Application Okay, it's your object and application module. Okay, so now let's start with the first point, which is carried all view object which will be used as a list of value or create view criteria. So now we have inbuilt we view. This image will review there is an attribute called department ID. This department ID should div we should define list of value to get all the board minutes from the department table. So, the first step we need to do is to create all view object We need to get this data.

For example, in your application, you need to create two lists of value over one attribute. Like in the department ID here, I need to create two lists of value. First list of value will return all the Bartman which has the bottom into ID lists and or equal 50. And I need to create another view object which will return all departments which has department ID greater than 50. You have two option you can query to dedicated view object and defined the query inside it like you can create here a new view object you can you can say you bought minutes this set of equal 50 view and you can see it is blue sorry a justice security query and you can right here your query, select depart mint or eg depart mint name from bar mints where you pour mint ID This is or equal 50 you can do something like this okay.

So so it will return only this row Okay. Then you can create another view object which will be the same, but instead of return or equal 50 you can make it greater than 50. So, you will have here here to view object, one for listened the 50 and one greater than 50 and we will use To view object to filter our list so far, this is will be okay and we'll be fine. But if the data was coming in from the same table in the same view object, but the only weird condition really change, so, I prefer to create view criteria because in way we will use the same table and same up but the only change will be in the where condition. So, we can use the view criteria instead of defining multiple view object this way is okay as well but it is not recommended.

So, I will show you another way this is easy. I think you should be able to do that just define return if you object with the query, what else do you want and just we will use this is a list of value, but I will show you a different way to create a list of value using view criteria. So, now I have this department this view, just workman's view will return all the buttons So, I need to create two view criteria here. One will return department's view criteria lists then 50 okay and I will add a condition here where department ID less than or equal to 50. So, this is our condition over the main query I will add another view criteria call greater than 50 and I will add item again department is Gary Tarzan these are all value 50. So, because of the two lists of value will read from the same table same object but the only where condition will be changed so we can create two different view criteria We can use this view criteria to filter our list of value.

So, this is the first step which we should define a few criteria or define dedicated view object whatever you want to do. So, now we are the initial value data is ready and we know from where we will get the data. So this is a fairly sophisticated overview object, which will be used as additional value or create or view criteria. So we create view criteria now, after that, we will create all this to value over the department attribute. So let's back again to the employee view, department ID. Now I need to define multiple lists of value.

Okay as I want. So for our example, I will create two lists of value one, which will return department IDs and 51 was shorter department ID greater than 50. So here I will create a list of value name for example, this Zen 50 Okay. And here I will add the bottom into the bottom interview, this is what I need to get the data from the bottom interview, but I need to get it from the view criteria, I will show you how to go into the view criteria. But now I will go to the main view this is a filter system and I will create a map department ID was department ID okay department name. So, this is a type of the list of value we should be able to know to do it, but if you define to one type, so, all of this value would be in the same type I will show you now.

So, this is the first step. This scope is this. This is a first this value I will create another one which will be Gary greater than 50 and I will select departmental view but as a time it would be the bottom interview to they will select the bottom into each department ID here you will not be able to select the five because there is already one was typed Chromebooks. So the all other will be the same type and they will displace any okay. So here after you define multiple lists of value in one attribute, okay, there is by default, if if there is no condition is there is no switcher, by default it will return, the department lists Zen 50 Okay, so now we have defined two lists of value over the department and the department list and 50 is get the data from the bottom interview one innocent one and the best argument greater than 50 is read as a data source from department view to.

So, now, I need to go into here to the view criteria which is less than 50. And here to view criteria which we have created is greater than 50. To do this, you can go to the accessors here. So, it's pretty simple. This accessors you will find the department view one and department two view to which we are used here as a data source, so, I will go to the successors, and I would say that the bottom interview one should cynic Zed this view criteria, this then 50 Okay, and the bottom interview to accessors when you get the data from the view criteria greater than 50. So, now, most data source here is read the value from the view criteria have set the bottom interview again.

So, now, once we defined the list of value, you will we define the data source, we create first one development view ahead one, then we create the other department department view too. So, once you create a department you want the work to interview to both go into the main department, but this is called innocence. So, for this innocent button if you want, I need to bring to the view criteria which I created. So we select here from accessor department to view one and I will shuttle department view current area which we defined and the same in the department two. So now, we define second point which is defined all lists of value we need. You can define multiple series for whatever a number of reasons You and delete each industry value component from different table different view object.

So, you can define any number of the list of value but each you list a value as you can see has its own name okay. This is the second point is create all this value over a specific attribute 30 point we need to create transit attribute which will be used as a love switch. So, as you can see here, this value switcher we have to select which will be our attribute which will return the name of the list of value. So, I would define here now, new attribute as a truncated attribute and I can see here deport meant a movie switch, okay, this is our switcher of type string because it will return the name of this loss list of value. So divorcement ELO v switch okay. and respect to the department and is the list of value switcher I will select my department list of value switch okay.

So, this is the third point we just create a transit attribute and we select this transit attribute as a list of value switch, this is the third point fourth point is configure this transit attribute to return this value name depending on specific condition. So in our example here, we need to check the salary if the salary is less than 5000, or you need to return this name, list of all department, glove department lists and fifth if the salary is greater than 5000, I need the switcher to return this name. Okay, so what Now copy this name. So, how to configure the switcher to return the list of value named depending on condition in the salary for example, so, we will go to to the Java and we will implement a view row mn and we will include accessors this is it means if accrued accessor it will you can access all attribute it will generate setter and the getter for or attribute of this view object so, that if you want to manipulate or deal with attribute programmatically, you have to select include accessors and we will generate in believe euro m okay.

Once you generate view, m ro M and you select accessors you will find the setter and the getter for all attribute in this view. So, example we have this all attribute You will find here setter and the getter for all attribute. So, we will go to to the getter auth just switch okay because we need this switcher to return this value name. So, I will go for the get department love switcher okay. This getter here I should write the code which will return the list of value name how we can do that, we will need to check the salary. So, I will say if get salary if you will find here method called Get a salary because I select extra So, all attributes that are on the guitar you will find it here.

So, if gets salary not equal no and get salary do double value if it is listed 5000 maybe or equal return my distal balloony it's return. So either one return we don't want this. So now with this transit attribute, we'll return one of the list of value name. We'll check the salary if a salary greater than 5000 it will return sis name, otherwise it will return the greeter name. So now we configure switcher To return list of value name, depending on the salary value, this is the fourth point configure this trust attribute. So, the first point is set to auto submit and dependency is the view attribute.

As you know here, this now, department ID will be dependent on the switcher value. So is the switcher value here I will set the auto submit to be true and are you will go to to the department and I will say that dependency of the Department of switch okay. And one more thing as well maybe in the salary because the salary is the main main attribute which will control There is a value I will sit in auto submit be true and switcher will depending on the salary, so I will add salary as a debit okay. So, now we define the fifth point which is auto submit and dependency between attribute that this will value will be dependent on the salary and department ID list available depending on the switcher. So, we defined here the bottom in dependency is a switcher and development switcher is a setter is a dependency.

So, this is the fifth point. The last point is it also made a bursary into GCF. So let's generate the GCF now and this scenario, the GCF and you check this okay. So this is a Bluey target here are the four key. So here I will salary should be our main attribute which would control. So the Submit would be true so true because this will control the list of values at the bottom And I will take this ID and set it to the department list of value.

And if you need to see this which switcher is a change we can refresh the switcher as well but this will actually should be hidden or you should not add it in the beach but I will keep it so that you will see the value of the switch or will change depending on the salary. So let's now which is really the snow run and see how it looks like Okay. So now you can see here the salary is greater than 5000 and loves we shall return greater than 50. So you find this value here is is this to this missus data. So now let's start to add a salary is greater than 5000 for example 4000 You will find here a list of value less than 50 and you find the list now become only with this and 50 is you add here So, if you add here 6000 you will find the list of value now, let's switch it.

So, one attribute has two lists of value and depending on the salary it will decide which list of value will be used. This is called this value switch. If your ADF application needs something like this, at least now you know how you can do list over the switch. Because the video I will go to another feature so see you next video

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.