Tip:
Highlight text to annotate it
X
in this lesson we will use the debugger to review the page life cycle
now that we have Screen Actions. Let me just
first of all open here the application I'm
and let's see what happens behind the scenes
when we navigate into a
Contact Detail page, let me just quickly draw here
what happens so when we navigate
we have here our user
and requests this page sending
the contact ID into the server
we executed the Preparation we
fetch the contact from the database
and we
bind this result to the Form
in the screen and we send a response back to the user
now when we press
when the user presses this save button, this will trigger
another request into the server that will
executes the Save action
and on the Save
action we are actually using
the UpdateContact Entity Action
that will send again the
contact information to the database and
after this save action and
we are redirecting the user to the list
page and this mean that the Preparation
of that list page is going to be
executed, we are going to fetch
the contacts from the database again
we're going to bind these contacts do the Table Records
and render them
one by one during the server-side render
and once this is over we're going to send
the response back to
the user's browser. Now lets add a couple of breakpoints
in our development environment to see this
life cycle step-by-step so
let's go back here and set a couple of break points
in the Save action
in the Preparation of the Contacts screen
and let's start the debugger
okay
let's go back to the browser
on Joana Rivera's page
we can change here
the information about this contact and now we're going to press
the Save button and
we are stopped in the first break point, we are on the Save action
as you can see here we're
on the Contact Details Save action, let's look here into
the Form Record variable and
as you can see we have the information that the user
changed here so we have
the new information that we want store into the database let's go back to 'In Use'
and Step Over the Start node
now we're going to use the
Record property of the Form widget which holds this information that was
changed we're going to use this contact
to send it to the database using the UpdateContact Action
lets step over and
now that we send the information back to the database we are going to redirect the
user
do the contacts page so if we continue, I'm going to the Contacts page
okay and there we have it now it runs the Preparation of the page
let me just step over it we're going to
fetch the contacts from the database
an let's look at the contact List
and there we have it. The number the phone number was
changed back to 209 and
if we continue we're going to
render these contacts
in this Table Records, one more step
over and there you have it, Joana
the number 209, let's just continue
and go back to the browser, and there we have it.