in this lesson will use the debugger to inspect step-by-step
the requests to retrieve, update, and create contacts
let's start by adding a couple of break points in our application
an let me add a break point in the Preparation
of the Contacts screen and
another one here
in the title and
on the Contact Detail sorry
also here on the Search and on the Contact Detail
also in the Preparation in the screen
so here in the
If for instance, let's add a breakpoint here
and also on the Save action. Let's start the debugger
and let's open the application
okay so
we're stopped in the Preparation our
local variable is empty we haven't fetched anything from the database so
the list in my Aggregate is empty
let me step over and this one
and now we have we have the contacts fetched from the database
matching that search keyword and
in this case since we haven't filled the search keyword
this will return all the contacts and now
let me continue we will stop in the screen
so once the Preparation and we have the server-side rendering
and we're going, let me just step over and we're going to render
all these widgets one by one
the input now the Table Records
and let's see here that the Table Records
List is empty let's start rendering the Table Records
and now
we already have the results there
the the binding occurred and now if we're going to the 'In Use' you'll notice
that the
Current property of the list is pointing to Alfred Camire
so this is the contact that it's being rendered at this time
let me just go through this and
the next one Anthony Ericsson and so on so we can just
continue okay so
now we can search for Joana, search
and again the local variable holds the value
we don't need to do anything in the Screen
Action, continue and were stopped again in the Preparation
SearchKeyword holde th value Joana. Step over
and execute the Aggregates and now
the List on Aggregate has Joana
and we can continue we will rendered the screen again
all the widgets on the screen and send the response back
to the browser. And there we have it - Joanna
let's edit now the record
and what happens here
we are stopped in the Preparation other contact detail. We received
as an input for this screen the ContactId, the number one there
we're going to use this variable to fetch that contact
from the database so let's step over and now
on the Aggregate List, we are going to have only one result
Joana Rivera, there it is, and we can continue
and now we are going to render the screen
we are testing if the ContactId is
empty or not. It isn't it has a value so this is going to render
Joana Rivera this expression so it's getting the value from
the Aggregate and let's continue it's going to render the Form
and it's going to use the Form Record property
to bind to these inputs to render them on the screen
let's continue and there we have it
now we can edit this notes for instance
and let's save
and again here we are in the breakpoint the widget
variable the Record property here
has the contact and as you can see it has the values that the user
changed in the user interface and this is the record, let's go back here to the
'In Use'
he sees the record that we're going to use as input for
as a source parameter on the CreateOrUpdate Contact
which in this case is looking into the ID so it's looking into
this Contact and
determining if this contact is in the database if it
is which is the case it will update to Joana Rivera
in the database there and we will go back into the Contacts, so let's
continue and we are in the Preparation of the Contacts Screen
step over let me just show you that
the local variable is empty now so this is a new request
the value is not maintain between requests
and we're going to use the Aggregate to fetch the contacts from the database
and again render them on the screen
let's just continue this one
and here we are back in the Contacts
and Joana Rivera is here, now
let's create a new contact again
we're going to run the Preparation. In this case
that contact ID is empty. This zero here means that its
empty so when we fetch the
contact from the database there is no contact in the database
whose identifier is zero, so this list
is actually empty and this means that
on the screen this condition will be tested
and the value
is empty so we're going to render
the new contact and the form
is bound to
the form is bound to the the result of the
Aggregate but in this case since we have no contact
we're going to have and empty contact to fill-in these inputs
and so that the user can create a new contact. So let me just
step over this and in the 'In Use'
here we have it no name no phone number
and so on and we can
continue go back to the screen and we can now create
Alfred Pine and phone number
55 55 55 55
alfred.pine@gmail.com
Google and let's save it
and when we save, again
we're on the same action we are going to receive
the record from the form and as you can see here
we have Alfred all the data and I entered
in the form, we have no identifier
because we are going to create this contact in the database
and it's the database that it's going to populate this identifier
it a number automatically provisioned by the database
so let's step over
continue to the contacts again run the Preparation
let's just going to continue, render the screen
and there we have Alfred pine
with all the data that I entered
that's it.