Automatic Refresh Part in the Page to Get a Real Data

Advanced Oracle ADF 12c Course View|Real-time Data Refresh and Regions in ADF
18 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.51
List Price:  €92.16
You save:  €27.65
£55.26
List Price:  £78.95
You save:  £23.68
CA$95.77
List Price:  CA$136.82
You save:  CA$41.05
A$105.61
List Price:  A$150.88
You save:  A$45.26
S$94.49
List Price:  S$134.99
You save:  S$40.50
HK$546.56
List Price:  HK$780.84
You save:  HK$234.27
CHF 64.51
List Price:  CHF 92.16
You save:  CHF 27.65
NOK kr745.92
List Price:  NOK kr1,065.65
You save:  NOK kr319.72
DKK kr481.76
List Price:  DKK kr688.26
You save:  DKK kr206.50
NZ$114.32
List Price:  NZ$163.32
You save:  NZ$49
د.إ257.07
List Price:  د.إ367.26
You save:  د.إ110.19
৳8,200.05
List Price:  ৳11,714.86
You save:  ৳3,514.80
₹5,813.28
List Price:  ₹8,305.04
You save:  ₹2,491.76
RM329.26
List Price:  RM470.40
You save:  RM141.13
₦102,276.30
List Price:  ₦146,115.27
You save:  ₦43,838.96
₨19,447.66
List Price:  ₨27,783.57
You save:  ₨8,335.90
฿2,561.05
List Price:  ฿3,658.80
You save:  ฿1,097.75
₺2,253.54
List Price:  ₺3,219.48
You save:  ₺965.94
B$361.65
List Price:  B$516.66
You save:  B$155.01
R1,289.17
List Price:  R1,841.76
You save:  R552.58
Лв126.36
List Price:  Лв180.52
You save:  Лв54.16
₩95,655.33
List Price:  ₩136,656.33
You save:  ₩41,001
₪256.70
List Price:  ₪366.73
You save:  ₪110.03
₱4,073.73
List Price:  ₱5,819.86
You save:  ₱1,746.13
¥10,984.57
List Price:  ¥15,692.92
You save:  ¥4,708.34
MX$1,168.81
List Price:  MX$1,669.81
You save:  MX$500.99
QR254.92
List Price:  QR364.18
You save:  QR109.26
P949.81
List Price:  P1,356.93
You save:  P407.12
KSh9,122.85
List Price:  KSh13,033.20
You save:  KSh3,910.35
E£3,298.27
List Price:  E£4,712.01
You save:  E£1,413.74
ብር4,016.76
List Price:  ብር5,738.47
You save:  ብር1,721.71
Kz59,376.64
List Price:  Kz84,827.41
You save:  Kz25,450.77
CLP$63,605.87
List Price:  CLP$90,869.43
You save:  CLP$27,263.55
CN¥497.66
List Price:  CN¥710.97
You save:  CN¥213.31
RD$4,116.79
List Price:  RD$5,881.38
You save:  RD$1,764.59
DA9,406.51
List Price:  DA13,438.44
You save:  DA4,031.93
FJ$158.71
List Price:  FJ$226.74
You save:  FJ$68.02
Q543.03
List Price:  Q775.80
You save:  Q232.76
GY$14,626.09
List Price:  GY$20,895.31
You save:  GY$6,269.22
ISK kr9,653.57
List Price:  ISK kr13,791.40
You save:  ISK kr4,137.83
DH697.32
List Price:  DH996.21
You save:  DH298.89
L1,240.19
List Price:  L1,771.78
You save:  L531.58
ден3,973.31
List Price:  ден5,676.40
You save:  ден1,703.09
MOP$562.57
List Price:  MOP$803.71
You save:  MOP$241.13
N$1,284.81
List Price:  N$1,835.52
You save:  N$550.71
C$2,572.99
List Price:  C$3,675.86
You save:  C$1,102.87
रु9,296.83
List Price:  रु13,281.76
You save:  रु3,984.92
S/261.34
List Price:  S/373.37
You save:  S/112.02
K271.67
List Price:  K388.13
You save:  K116.45
SAR262.50
List Price:  SAR375.02
You save:  SAR112.51
ZK1,865.84
List Price:  ZK2,665.60
You save:  ZK799.76
L320.98
List Price:  L458.57
You save:  L137.58
Kč1,589.64
List Price:  Kč2,271.01
You save:  Kč681.37
Ft24,759.44
List Price:  Ft35,372.15
You save:  Ft10,612.70
SEK kr760.40
List Price:  SEK kr1,086.34
You save:  SEK kr325.93
ARS$62,235.70
List Price:  ARS$88,911.95
You save:  ARS$26,676.25
Bs483.06
List Price:  Bs690.12
You save:  Bs207.05
COP$270,493.43
List Price:  COP$386,435.76
You save:  COP$115,942.32
₡35,841.38
List Price:  ₡51,204.17
You save:  ₡15,362.78
L1,727.58
List Price:  L2,468.08
You save:  L740.49
₲525,820.15
List Price:  ₲751,203.84
You save:  ₲225,383.69
$U2,694.45
List Price:  $U3,849.38
You save:  $U1,154.93
zł274.83
List Price:  zł392.63
You save:  zł117.80
Already have an account? Log In

Transcript

Hello, in this video I will talk about how you can refresh a page periodically like every second or every five seconds you make Do you want to refresh the data automatically. So, we can call it like a real data, real time data refresh. In this video, I will explain how you can do how I will show you how you can do this. For example, let us create a beach which has a time running time like 01234 and I need to get a number of employees a database and I will try to insert one in baleen. So that the big reveal and we will see that this number is will be refreshed inside the database. So let us first create a page.

I will call this page is refresh. This is just an empty fabrication I have created so now I will create one bitch We can add here when in group do it inside betting group do it I will add our tickets and after our test I went under our test does s3 open text just been improved oh it would have been the I need to be vertical and this sir Sarah window is battling through the horizont okay so this is we will be like a time and second and minutes which is running automatically and this is will be a number of number of employees in the database okay so we can add services as well was when a group do it and to add a title to it horizontal and we can add here before this idea as a no particular number of reuse shirt in weird ways.

So I will just display the number of him Bluey spacer and this would be the number of employee I can add a color, different color maybe discolor okay and Same here, this is a time running time it's an optic just between them and this optics will be just so cool. And I will add here and he is different color. The spacer between this and spacer between this and the meek because this horizontal makes all the width BMP five and we can add space between poses. Okay, so now I have a group node vertical so it will display both component under each other and the vertical way, the second, the first component would be horizontal so it will display our tickets. Since this column decided after that our tickets, this would be the minutes and seconds and this will be the minutes after that I will need to display number of registered employees and the interspeech account of this employee from the database and I need to of course is that to be refreshed automatically every one seconds of time should be changed automatically this time and as number from when we if I add one in between the database just in between should be changed automatically.

So let us implement this. So I will go through our checklist here. can use a value I would keep the value here I will keep the value and I will add pointing to a bit back pain. So I will add here pointing it I would kill it you by being my bean muy bien. View And I need to make the scoop here to be session because all he needs to tell him to be keep running, even says user navigate to other page and return back, I need the time cookie in the same session. So, this is the object will be created in this bag bean it will be stored in the session of the application Alice So, if we lose our MC look out and log in again.

So, this is a new session. So to start the beginning from again from beginning from zero again. So, in end of page you can have multiple back been so but for this kind of information I need to be always available during the user using system and decision scope. So I will make the scope of sis p to be in the session scope. Okay and him is that his attribute seconds our ticket tickets and this is will be The same might be minutes will take just this is number of movies okay to me exist that to be always okay. So, let us now add the code which will generate this time so I will navigate here in the pain and I will right here private void just time Hear private and get in between these count This is a two methods want to calculate the time and we want to calculate the number of employees.

Okay Here is the actual employee count. I add here, select the segment selected count from an MBE. So I will define Java to the secure the connection, Java secure the revert statement results set, then I will get a connection if you find the connection here I create it would look up to the data source, each RDS which is defined in the WebLogic level. So, now, in this function actually well what we'll do is get an employee count it we'll call the database gets a count of the MVP and To the result, this is what actually this function will do. Second thing we need to implement is adjusted time. So we have to define here private integer.

Second, private integer, minutes. Okay. And in constructor we can just initialize is seconds equals zero minutes equals zero. Okay. And here we say can call seconds, plus plus it will increase one and if second This is 10 we will sit right here, second elbow thickest, so I will get second Oh we'll take a sensitive value. Don't sit value zero plus a second and return.

Okay. So if it's second greater than 9am second This 60 Okay, we will sit it Oh, the second one will take us to is the seconds itself. If seconds equals equals 60 we will return in seconds equal zero and minutes plus plus we will increase the minutes and we sit second second and we would check again if the minutes is 10 sit mean this would take just zero plus minutes and return city value here should get get him in so tickets are city value like this and if minutes greater than nine minutes is sick st can sit minutes exists okay this is just assemble how you can displace seconds and minutes okay. So, now I need to call this function every one second how you can do this there are a div component called ball we will add it here in the page. So I will insert it here if component call Paul this component this component will run the listener of this component every interval he will decide it.

So, I press OK with a property Come on, you will find here the interval is 5000 if it is less than zero it means it is disabled. So, if you want to disable this pool you can add here minus one for example to this one will stop, but here you is the time will be there millisecond it means if I add 1000 it means it is one second now. So, I need the interval to be 1000 it means every one second and here you will find the full list of bull listener which is the code which will be executed every one second. So, in the bull listener here, I will add the function here in the bean born listener okay. And from this poor listener I need to cold adjust time and I need to sit Sorry yes we can we can add here we already added yes number of employees.

So can add a call here get a number with a number we do city value sitting value with get you to go like this. So every one second this code will be executed so it will go and adjust time so it will adjust our tickets and after that it will call and get it number of employees it in value and we'll set a number of employee from this function Okay Okay. So, now let us just refresh this from the board. So, I will take the be one here and I will add it here as a beach as a bunch of triggers so that it will refresh this every one second this part of the beach will be refreshed one want to sink I just want to make a change here for the minutes this minute I just we need to edit here as well inside sit second here and here as was just guess, okay so now let us try to run and see Beach wind looks like okay as you can see here, the Bible is a start now refresh automatically 567 every second and here's a number from Billy he is 107 so let's now try to go to the database level and it's certainly even better we can see is this number will automatically refreshed.

So I will go to the database here and I will add a new employee number images is just for test and me to eat and shop and let's commit and back to the beach. Find here it is 108 whatever Again, I don't really want all night. So, here once that is inserted database, automatically insert export the number will be refreshed and as you can see every one second here the data is refreshed like this. This is how you can make automatic refresh in EDF application, you should use the ball component and you can define the interval and the Boo listener will go and execute it and the code inside the pod listener function this is one of the features if negativity We'll go to the other features to see the activity

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.