Hello, in this video I will talk about with Bob listener Bob listener wants to use the opens a bob we need to execute some code once a bob is once it is open and or if the user cancels above or close the pop up we need to secure another codes listener. So there are two actually listener in the boba. I will show you how you can deal with them. So for now I need to enter bandit group. Okay, and I need to add one button to display a department Bobo for example. So I will add here a bottom and I need to add pop up.
This is pop up and inside this pop up. I need to Hello dialog. And inside this dialog I will drag the department few as for now I need once the user press on this button, I can call it new report meant okay I need zubaba once the ball is open and you roll should be created for the department and the user will be able to enter a new department to exist portal opens a pop up the I need to add show pop up behavior and you can point to your pop up She's above ID and it will be in the action button action. So in the bottom action, I will show sis Bob. Okay, so let us now try to run and see if the Bobo will open. Okay, so let's open here's a bob.
I will find here a new department put on you will press in it, it will open the department but as you can see it is returning the current row of the department. What I need to do is I need Once I press new department, I need to invoke the Create insert operation to create new row and I find this form is empty for inserting new department. Okay, So now if if this is one of the listener I need to add the second ditional is once I can set the bulb up should consider any change for example now if I add here the bottom if I make a change in it, then I cancel it, then I open it again or you will find it is the same exist so that the change is not habit. There is no so I need to two things now to do once I briefly you need to invoke create insert operation in the department to set the Department for will be ready to insert a new department.
Second thing if I'm making a change and I just can't see it or close the bulb I need to revert to cancel all the changes have been in this role. So, there are tourists not I will talk about it for this bow. Okay, I will sit next to Bob up here in the poverty you will find here. Bob fit she listener and Bob considers Bob a feature listener, this listener will be fired once as Bob starts to open. So in the observer feature listener, I will invoke the Create insert operation. And in the bob of cancer listener, I will invoke the rollback operation to cancel all the changes.
One thing I will add is a bob because the mobile app has some data from the binding you can just add a content delivery to be lazy uncashed. It just set it as Elisa cache. So here I need is a feature listener. I would edit and select the my bean. You do? pop up pitch listener.
And the same is the cancel if the user press cancel or closes any cancel if you just cancel it or just to close the x, this is we'll hit the bob cancel message. So, here I will add it hobo can see this okay. So we have two listener in the bubble one for fridge one for cans. So, in the back we now here you will find here our Bob of fish it is not for me I need to execute the operation. So same like we did in the iterator repeats a binding but instead of gets a iterator you will get the operation pining so always will take the binding here and they will right here operation binding will be equal windings looked good in operation binding of sorry create insert I will take it from the beach definition will be imported will be done execute okay.
So, here I should go to the binding and the from binding I will get operation binding and then I will execute so before to currently it will give you an orbiter exception because there is no operation called create insert. So, you have to go to the beach definition here and you have to add Action for your department operation create insert. So, here you add a create insert will invoke to the department if you want to return or instead of doing this you can go to the data control in the bottom interview operation you can drag and drop the Create insert into the page in that case, it will add this operations binding but actually I don't want any bottom is ah this is why I go to the binding straightaway and edit like this. Simon wrote back I need to add a rollback because I will invoke roll back into canceled so I will add new action the rollback will be in the application module limits and I will call a rollback so this create insert and rollback This is an empty read insert rollback.
This is what we will write. Insert operation binding is a code So same I need one says he was a breast cancer I need to invoke the roll back the roll back so that it will revert all the changes in their initial just having an old view object. Okay so let's now try to test this okay so let's go to the pop up this now bris new department. You will find now the department's open in a new phase. Try to enter any data and the breast cancer If you will win again it will be nothing because it will invoke, but what we can do to be sure that it is executed we can try to print some values here. So, that you will be sure that it entered here.
So, we can write here who I am in which Mr. Nash in Bobo cancer listener, so that you will be sure is that the listener is hit once you press cancel or close button so, when it says run again Okay, so let us go to the pop up again. That just clears the look here and press Put on go to look you're fine I am in both features. So, the feature is not is executed. So, let us now try to press this close chick here I am in Bob cancel this clear it again press E here I am in a book of fiction is not breast cancer you will find your IMDb canceled list. So, this is a to mean listener in the book we are always working with it in case if you want to execute code just before the Baba is appear or if the user press Cancel if you want to do any other this is the bob listeners next video or you can go to force at table solution is not so see you in consuming you