WEBVTT 00:00.440 --> 00:03.250 In this letter let us sort out the mess that we have created. 00:03.280 --> 00:09.220 We are all writing literally and so if I perform to your full function I say it is going to be quite 00:09.220 --> 00:11.380 confusing in our application. 00:11.380 --> 00:11.770 Why. 00:11.800 --> 00:14.050 Because we are not clearing the previous layer. 00:14.410 --> 00:20.430 So the first time I create my portfolio and create a layer on my counter application. 00:20.530 --> 00:25.600 Now the second time when I click on Do you fish and call my function call my portfolio. 00:25.780 --> 00:32.350 So again it is going to create a new layer overwriting our previously and then effective the stiffest 00:32.380 --> 00:39.130 third time it is going to create a mess because it is going to write new layer or my previous layer. 00:39.790 --> 00:43.500 So that is the problem and we need to solve this one. 00:43.510 --> 00:50.590 So what I have to do is firstly I just need to remove this one and thus take a new function maybe call 00:50.590 --> 00:56.430 it does reset or refresh something like that inside that we would be doing experiment. 00:56.440 --> 00:58.650 So I would be calling it as reset. 00:58.720 --> 01:01.150 You can call it as refresh or anything. 01:01.150 --> 01:02.950 And now we need to write. 01:03.310 --> 01:05.020 He said function. 01:05.020 --> 01:07.960 So remember one thing reset will include us. 01:07.960 --> 01:12.970 This function because currently refresh is calling this particular function. 01:12.970 --> 01:20.080 So the slider def reset and then does call this function. 01:20.080 --> 01:22.700 That means we haven't changed anything in our application. 01:22.700 --> 01:26.600 Instead of this I'm calling this and it is doing the same task. 01:27.070 --> 01:28.560 So if I run this one again. 01:30.270 --> 01:35.550 So and suppose I delete 3 delete this. 01:37.050 --> 01:44.390 Refresh this one you can see what mess I'm talking about so it is doing the same toss up currently because 01:44.500 --> 01:46.130 I am calling this function. 01:46.440 --> 01:52.620 Also one thing now I don't need to call only this function I also need to call the other one that is 01:52.650 --> 01:54.750 my header otherwise. 01:54.750 --> 01:58.020 In some cases it is going to override this also. 01:58.020 --> 01:59.880 So I also need to call my header 02:03.640 --> 02:04.890 cause that is. 02:05.160 --> 02:10.170 Now the next thing I need to talk about is how I'm going to clear up my window. 02:10.170 --> 02:16.800 So there is a method called Destroy which actually do a simple task and destroy all the widgets that 02:16.800 --> 02:17.920 we are applying. 02:18.060 --> 02:24.960 So I destroy our labels and destroy all the fields that we are using and destroy our buttons so destroy 02:24.990 --> 02:28.020 basically everything and I kill that application. 02:28.080 --> 02:33.760 So for that I need to use my window that is my root window and then that is a function called Vin for 02:33.790 --> 02:34.860 unless schoolchildren 02:38.740 --> 02:41.620 now disk contain all the windows that we have. 02:42.040 --> 02:46.510 So all the windows that we are dealing with as inside this. 02:46.960 --> 02:51.540 So what I need to do is I need to iterate with that and destroy each one. 02:51.550 --> 02:54.850 So I would be using a form method and call them frame 02:57.490 --> 03:03.530 and then destroy each frame. 03:04.880 --> 03:10.850 Once that is destroyed I would be using these two methods to recreate my application. 03:10.850 --> 03:16.070 That means I am currently just destroying each element that is each frame so this is a frame. 03:16.070 --> 03:16.910 This is a frame. 03:16.910 --> 03:20.120 This is a frame I'm just destroying each frame. 03:20.450 --> 03:25.470 You can name it as we know you can name it as frame you can call it as sin. 03:25.520 --> 03:33.290 That would be more fine so I'm just destroying each cell once all the cell are destroyed. 03:33.490 --> 03:38.040 I just rewrite my whole application so it is not going to create a mess. 03:38.080 --> 03:40.090 These are the two methods that I am calling. 03:40.090 --> 03:44.640 If I had a third method here I also need to add that third method and my reset. 03:45.250 --> 03:49.090 Let me close this one and see if our experiment is going to work. 03:52.360 --> 03:54.950 OK so let me delete anything. 03:54.970 --> 03:56.430 Maybe fault. 03:56.670 --> 03:57.640 Click on delete. 03:58.540 --> 04:00.870 He says this one yeah. 04:00.890 --> 04:01.420 This one. 04:01.470 --> 04:02.290 Fine. 04:02.360 --> 04:02.810 Why. 04:02.940 --> 04:08.430 Because I destroyed all the elements all the cell from my previous layer. 04:08.460 --> 04:10.750 Then rewrite mine completely. 04:10.950 --> 04:13.060 Now this is fine. 04:13.080 --> 04:17.380 We now have our capability to add a coin update coin delete coin. 04:17.460 --> 04:23.190 Also we are fetching our data from our database and we have a valid refresh button. 04:23.320 --> 04:29.700 Now the next thing I want from my application is so whenever I delete any point it should show me a 04:29.700 --> 04:36.090 popup message or a notification that disquiet is deleted successfully or whenever I delete any coin 04:36.090 --> 04:41.210 or update any point out at any coin my application should refresh automatically. 04:41.340 --> 04:43.500 I should not go to refresh button. 04:43.560 --> 04:47.960 So suppose i deleted this coin to refresh automatically. 04:47.970 --> 04:50.740 There should be no case that I have to go refresh. 04:50.760 --> 04:54.580 That should be only done when I need to update my prize. 04:54.600 --> 04:55.930 So that would be quite simple. 04:56.040 --> 05:01.500 All we need to do is once we do commit call our reset method. 05:01.500 --> 05:02.870 So that would be quite simple. 05:02.870 --> 05:11.050 Once we execute and commit I just need to call my reset function. 05:11.910 --> 05:13.590 So this should solve our problem. 05:13.600 --> 05:14.660 Let me close this one 05:17.650 --> 05:18.630 out on you Quinn. 05:18.700 --> 05:20.170 Maybe adding a TDM again 05:28.000 --> 05:28.700 Yeah this one. 05:29.060 --> 05:32.880 And now we don't have any mess these all other fields that we required. 05:33.530 --> 05:35.210 So this looks pretty fine. 05:35.210 --> 05:42.010 One thing I was talking about remember I need a popup or notification that can solve a lot of problem. 05:42.110 --> 05:47.060 So in the next lecture let us add up all pull functionality that we have with Clinton. 05:47.300 --> 05:49.310 So we call it text message box. 05:49.360 --> 05:52.040 So in the next lecture let us out on message box. 05:52.040 --> 05:59.520 So whenever we do anything we can show user a notification that we have done this particular task successfully. 05:59.540 --> 06:01.690 I hope these letters are easy to understand. 06:01.820 --> 06:03.170 So see you in the next one.