logo

NJP

Part 18 - Debugging

Import · Mar 17, 2021 · video

[Music] the ui builder video series and in the last video we saw that how we can add a confirmation and rejection message for our reading widget whenever it is failing or succeeding any event now if you remember in the last one when we added this our client script and the hooking of the client script we added this script so it's the time to explain this script so basically what we are doing is that whenever this uh script is being called from any of the event so first we are checking that from where this script is being called so our data broker name was create record underscore one so basically it says that this script is being called from this data broker event and then in this line this line is pretty important so basically this is the item which we are passing in our emit function as a json object so right now what we are having it has an empty one and then this line number 40 which says that if my event name is data op success succeeded so it says that if my element id of data broker is create record 1 and the event that this data broker has emit is succeed event so once it is done then we can execute our code for succeed event now this is the crucial part line number 41 that how we came up with this one even dot payload dot data dot output this whole big json object so yeah and then for that let me let me explain here so let's let's walk walk everyone through right so after line number 40 can you just press enter uh and there you can just put a debugger yeah put a semicolon and save it and now let's go back to the browser make sure you open your inspect window let's do that let me refresh it let me give some rating so we see that it is paused in our debugger because we have put one debugger and now it has put it on this one so yeah go back go back to the console let me just make it bigger yep just type event and press enter okay now let's explore this so you see name is equal to data op subsidiary is where it came from and then there is a payload payload dot uh what we had we had uh what was oh yeah payload data dot output dot data glide chin and then again explore the no no no explore the mutation object as well yeah you see that is where we got the action name like insert kb feedback and that's how we built that particular line what what we saw then so yeah yeah so let's go anything any client script where it's basically a simple debugger as a debugger what we put and we can debug like this in future if you wanna if you have any errors or anything else we wanna look at it this would be the best place and basically it's not a new component or anything it's pretty much famous if you are doing anything on react or angular or any other front-end libraries any javascripts for that matter yeah it comes pretty handy so yeah so uh you so guys you see that how we can use the webber to get this object details so if i come here and if i check it's this one so this insert kb feedback so we are checking this one if the output is not now then uh we are getting the data so insert kb feedback is a proper json object so that's why we are getting the successful so this is the way that uh how we can do the debugging and in the future we gonna see that how we can uh debug for server side as well but uh in this video thank you folks thank you you

View original source

http://www.youtube.com/watch?v=SulSmuNchg8