Detailed Notes
We are continuing a series of tutorials focused on Spring Boot. The crux of the project is to convert/migrate an old JSP/Tomcat application to a modern Spring Boot application and Java 7/8 to a current version. We are working on a complex form for entering data. We revisit options in this episode as we look at some more complex ways to grab values. This is part 1 of a brief, 2-part series.
You can learn more through our online classes at https://school.develpreneur.com and register for free. Registration will add you to our email list, and you will periodically receive coupons for courses and notifications of the latest releases.
Transcript Text
[Music] well hello and welcome back we are continuing looking at our application conversion and we're going to jump back into we're working on a couple different field um form entries here and focus on some drop downs again so let's just make sure we're pretty solid on those give you some more examples because this type this difficulty and if we go over to uh an opport Unity or an overhead I believe yeah it's got a type and a difficulty as well so these are going to be pretty easy for us to uh you know basically replicate and what we're going to do is let's go back to our project form because we've got a real nice copy and paste we can do for our select uh let's see if we go here there we go so we've got a select in our options and we're going to do that for both of these so let's go look at our task form first and we've got two things working with we've got type and difficulty so let's look at our type now this one's note that we've got an onchange here so we're actually calling stuff based on this so we're going to keep the onchange and that's a straight you know normal on change events we don't have to do anything special with that uh we do want this to be uh the field that it's going to be coming from is going to be type and that's what we're getting From the Path and the items are in the type list and we have an ID is the value and name is essentially the the label that we're going to see so if we take that that should take care of our um type I don't know if we have that in our we probably don't in our overhead form so if we look over here in our overhead form which we still have a couple things we got to clean out we've got a lot of these form inputs uh type does have calcal oh interesting enough so we should be able to take the same thing it's coming from type type list oh excellent so it should be almost identical did we get the form we did not get the form yet so let's go ahead and do that while we're at it let's get our form straightened out uh if we go in here I need to make sure I get that spelled right and let's see so let's go over to overhead form let's get our form fixed and it's going to be save overhead and it is going to come from overhead and here we go overhead instead of task overhead if I can spell it right and I don't need that piece so it gives us something oh we don't need all these form hiddden uh this is going to be input type equals hidden so let's just do that and we know that our path is actually uh what did we call that that was going to be the uh th field I believe so we'll see that again actually we probably see take that stuff from the top of the task form it has an ID a project ID so I think that's exactly what we have user ID project ID overhead same thing so hey so we can just look at that we like rocking and rolling okay so I got a little bit sidetracked on that so let's go look at our task form the other one we need to do in our selects is our so we got our type done we take the same thing and now we're going to do it for difficulty difficulty oh look it has the Cal hours as well so we don't have to change that and it's basically the field is difficulty instead of type list oh I'm sorry uh oh yeah so that's type the difficulty is our type difficulty list is our list well difficulty I guess is our our value and then it is an ID and a name so we should be good so we now should be able to take that and I bet we're pretty darn close on our our task let's go ahead and do that with our difficulty real quick so I think it's going to be the exact same and yep if you look at it it comes for difficulty lit so it's exactly the same here that makes stuff a little bit easier so now let's run this and let's see what we got so when we run it if we do a new task it's interesting doesn't have that that was a bug from last time so here we've got our types we've got our difficulties uh doesn't display super well we're going to have to work on that a little bit uh I wonder why let's go look at our layouts real quick and oh we're using a so he's a six a two a two and a two that's cuz he just rolls over too much so we can make him a five and a three let's do that this is on task so let's go to our task form and let's just change that real quick so let's change that shorten up the name and extend the type and this could be partial because of the wrong thing if I because I may have my view yeah so if I shrink my view down then depends on where you're at sometimes it works sometimes it doesn't but anyways we now have all of our pieces let's go look at this let's just do a test uh this is a test let's see if we try to do a SA or update what does it do uh there we go um we'll do this we'll just make one instance just because hours worked we'll make that uh 2.0 hours estimated oh because it probably doesn't have a cost [Music] um trival trivial there don't need that little thing that's bothering me oh probably because it's a it's probably looking some stuff up based on that oh it is because it's based on the the type let's see if we try to save it's probably going to give us an error because of the not a number uh yeah not a number so what we need to do is we need to figure out this Cal hours because it has issues so if we go to calc hours uh let's see it's probably missing a value oh here it is it's because it's doing this get I wonder if it's that simple uh it may be all we need to do for it uh while we're here let's look at the Save oh save is just the form so we should be good let's see what happens so now if we run it oh and that means we're going to have to change that on overhead so might as well get it on our overhead form as well so this oh that one's actually interestingly enough that one probably is going to work uh task form did we get that Cal hours okay let's go check it out so if we come in here we'll try to send I don't know if it's going to care because it's going to make me log in come in here let's add a task this is call it task one one instance uh environment setup we'll call it that difficult simple oh look see so our hours estimate is coming in oh I see so that's just so we haven't worked any yet but let's just say uh this is a test save or update now it did not come across error because here it did not save so while it came came in it didn't actually save the data and we're probably going to see uh index negative one out of bounds for length 17 so we've got something here let's see if it'll give us where that actually happened uh let see let's jump all the way to top of our little stack trace and by little I mean extremely huge uh typ list task. tap type number one template project form 170 okay so let's go look at that oh interesting um type one so it's probably blowing up here oh so maybe it did save something there we go out of bounds [Music] precondition let's see so now we got to dig up here this will be fun uh there it is Project form there it doesn't like it so there's a task. type minus1 and well let's look at project form 150 let's see if this helps us out I'm sorry not 150 170 so if we go here oh so this is I wonder if it's going to give us that probably this may be something that we're doing that's going to give us some issues because it's trying to do something out of our list so what we're going to try to do is we're going to try to get this out of a mapping so this will be sort of interesting let's see so it's blowing up on trying to list the task which is why we're seeing an error but at least it's somewhat going so let's go play with that so this may be something we're going to have to tackle as well is so so I bet we're going to see if we go here yep blew up yep give us an issue cannot render because so what we need to do here is what we want to do is [Music] probably this um we're going to see if that's going to give it to us uh it's not going to be a get so it probably be this let's see not sure that's actually going to allow us to get that but let's take a shot at it real quick so if we do this um yeah let's try it I don't think it's going to work I think we're have to come back because it's a map and we're going to have to do it based on a so we come and do this and it still give us the same thing so we need to to do is we need to go figure out how do I oh it's index minus one for like so yeah so see it's trying to get in here so it probably needs to be that git of some sort and it's probably because I wonder if we can just do it as simple as that it's probably going to give us one off but let's see um except it's uh so that's for each task and that we really want is the yeah let's see what it does let's see what it gives us I don't think it's going to do it I think what we're going to have to do is we're going to have to go figure out how how to grab a map value which would be a fun little thing to add to this oh there we go okay so it is coming across here uh Tas name did I make it average I think I had it simple yeah so it's off by one so that's part of its problem is if I look here if I look at my options yeah so 1 two 3 four five but so he's simple but if I go back and I look here he is g to be average and so he's bringing the wrong piece interestingly enough trivia works I wonder if it gave us an error it did not give us an error huh so that's interesting so if I come into here so we did save a couple of these so if I come in and make this uh simple then he moves to average if I move him to complex does he die nope then he just is he's not able to be uh he's not able to display so he just blows up on that one if I do hard it's going to say it's complex there we go so what I need to do interesting thing that we got it this way so let's go to this one and let's see if we delete this task does that give us something nope it doesn't so delete yeah it does not so delete is probably giving us an error we got a couple of things here to fix in this next round uh index five out of bounds for only five oh so so we probably probably got it off by one so first thing we're going to do is we're going to try to figure out this little thing about displaying our you our proper type and name because I think in our type yeah because these were actually environment setup they were not database tables so we've got to fix those too both of those we've got things that were um not working right so we're going to see if we can get a little bit of math going on in here and see what we can do with that and then uh we'll just sort of try to get this fixed and then get our delete and keep on going so go out there and have yourself a great day a great week and we will talk to you next [Music] time
Transcript Segments
[Music]
well hello and welcome back we are
continuing looking at our application
conversion and we're going to jump back
into we're working on a couple different
field um form entries here and focus on
some drop downs again so let's just make
sure we're pretty solid on those give
you some more examples because this type
this difficulty and if we go over to uh
an opport Unity or an overhead I believe
yeah it's got a type and a difficulty as
well so these are going to be pretty
easy for us to uh you know basically
replicate and what we're going to do is
let's go back to our project form
because we've got a real nice copy and
paste we can do for our
select uh let's see if we go
here there we go so we've got a select
in our options and we're going to do
that for both of these so let's go look
at our task form first and we've got two
things working with we've got type and
difficulty so let's look at our type now
this one's note that we've got an
onchange here so we're actually calling
stuff based on this so we're going to
keep the onchange and that's a
straight you know normal on change
events we don't have to do anything
special with that uh we do want this to
be uh the field that it's going to be
coming from is going to be
type and that's what we're getting From
the Path and the items are in the type
list and we have an
ID is the
value and
name is essentially the the label that
we're going to see so if we take
that that should take care of our um
type I don't know if we have that in our
we probably don't in our overhead form
so if we look over here in our overhead
form which we still have a couple things
we got to clean out we've got a lot of
these form inputs uh type does have
calcal oh interesting enough so we
should be able to take the same thing
it's coming from type type list oh
excellent so it should be almost
identical did we get the form we did not
get the form yet so let's go ahead and
do that while we're at it let's get our
form straightened
out uh if we go in
here I need to make sure I get that
spelled right
and let's see so let's go over to
overhead form let's get our form fixed
and it's going to be save
overhead and it is going to come from
overhead and here we go overhead instead
of
task overhead if I can spell it
right and I don't need that piece so it
gives us something oh we don't need all
these form hiddden uh this is going to
be input type equals hidden so let's
just do
that and we know that our path is
actually uh what did we call that that
was going to be
the uh th
field I believe so we'll see that again
actually we probably see take that stuff
from the top of the task form it has an
ID a project ID so I think that's
exactly what we have user ID project ID
overhead same thing so hey so we can
just look at that we like rocking and
rolling okay so I got a little bit
sidetracked on that so let's go look at
our task form the other one we need to
do in our
selects is our so we got our type
done we take the same thing and now
we're going to do it for difficulty
difficulty oh look it has the Cal hours
as well so we don't have to change that
and it's basically the field is
difficulty instead of type list oh I'm
sorry uh oh yeah so that's type the
difficulty is our type difficulty list
is our
list well difficulty I guess is our our
value and then it is an ID and a name so
we should be good so we now should be
able
to take that and I bet we're pretty darn
close on our our task let's go ahead and
do that with our difficulty real quick
so I think it's going to be the exact
same and yep if you look at it it comes
for difficulty lit so it's exactly the
same here that makes stuff a little bit
easier so now let's run this and let's
see what we
got so when we run
it if we do a new task it's interesting
doesn't have that that was a bug from
last time so here we've got our types
we've got our difficulties uh doesn't
display super well we're going to have
to work on that a little bit uh I wonder
why let's go look at our layouts real
quick and oh we're using
a so he's a six a two a two and a
two that's cuz he just rolls over too
much so we can make him a five and a
three let's do that this is on task so
let's go to our task form and let's just
change that real quick so let's change
that shorten up the name and extend the
type and this could be partial because
of the wrong thing if I because I may
have my view yeah so if I shrink my view
down then depends on where you're at
sometimes it works sometimes it doesn't
but
anyways we now have all of our pieces
let's go look at this let's just do a
test uh this is a
test let's see if we try to do a SA or
update what does it
do
uh there we go
um we'll do this we'll just make one
instance just because hours worked we'll
make that uh
2.0 hours estimated oh because it
probably doesn't have a
cost
[Music]
um
trival trivial
there don't need that little thing
that's bothering me oh probably because
it's a it's probably looking some stuff
up based on that oh it is because it's
based on the the type let's see if we
try to save it's probably going to give
us an error because of the not a
number uh yeah not a number so what we
need to do is we need to figure out this
Cal hours because it has issues so if we
go to calc
hours uh let's see it's probably missing
a
value oh here it is it's because it's
doing this
get I wonder if it's that simple uh it
may be all we need to do for it uh while
we're here let's look at the
Save oh save is just the form so we
should be
good let's see what
happens so now
if we run it oh and that means we're
going to have to change that on overhead
so might as well get it on our overhead
form as well so this oh that one's
actually interestingly enough that one
probably is going to work uh task form
did we get that Cal hours okay let's go
check it out so if we come in here we'll
try to send I don't know if it's going
to care because it's going to make me
log
in come in here let's add a task this is
call it task one one
instance uh environment setup we'll call
it that difficult simple oh look see so
our hours estimate is coming
in oh I see so that's just so we haven't
worked any yet but let's just say uh
this is a
test save or
update now it did not come across error
because here it did not save so while it
came came in it didn't actually save the
data and we're probably going to see uh
index negative one out of bounds for
length 17 so we've got something here
let's see if it'll give us where that
actually
happened uh let see let's jump all the
way to top of our little stack trace and
by little I mean extremely huge uh typ
list task. tap type number one
template project form 170 okay so let's
go look at that oh
interesting
um type one so it's probably blowing up
here oh so maybe it did save
something there we go out of bounds
[Music]
precondition let's see so now we got to
dig up here this will be
fun uh there it is Project form there it
doesn't like it so there's a task. type
minus1 and well let's look at project
form 150 let's see if this helps us out
I'm sorry not 150
170 so if we go
here oh so this
is
I wonder
if it's going to give us
that
probably this may be something that
we're doing that's going to give us some
issues because it's trying to do
something out of our
list
so what we're going to try to do is
we're going to try to get this out of a
mapping so this will be sort of
interesting let's
see so it's blowing up on trying to list
the
task which is why we're seeing an error
but at least it's somewhat going so
let's go play with that so this may be
something we're going to have to tackle
as
well is so so I bet we're going to see
if we go here yep blew up yep give us an
issue cannot
render
because so what we need to do here is
what we want to do is
[Music]
probably
this
um we're going to see if that's going to
give it to us uh it's not going to be a
get so it probably be this let's see not
sure that's actually going to allow us
to get that but let's take a shot at it
real quick so if we do this um yeah
let's try
it I don't think it's going to work I
think we're have to come back because
it's a map and we're going to have to do
it based on
a so we come and do this and it still
give us the same thing so we need to to
do is we need to go figure out how do
I oh it's index minus one for like so
yeah so see it's trying to get in
here so it probably needs to be that git
of some
sort and it's probably
because I wonder if we can just do it as
simple as that it's probably going to
give us one off but let's
see
um except
it's
uh so that's for each
task and that we really want is
the yeah let's see what it does let's
see what it gives us I don't think it's
going to do it I think what we're going
to have to do is we're going to have to
go figure out how how to grab a map
value which would be a fun little thing
to add to this oh there we go okay so it
is coming across here uh Tas
name did I make it average I think I had
it simple yeah so it's off by
one
so
that's part of its problem is if I look
here
if I look at my options yeah so 1 two 3
four
five
but so he's simple but if I go back and
I look here he
is g to be average and so he's bringing
the wrong
piece interestingly enough
trivia
works I wonder if it gave us an error it
did not give us an
error huh
so that's interesting so if I come into
here so we did save a couple of these so
if I come in and make this uh
simple then he moves to average if I
move him
to complex does he die nope then he just
is he's not able to
be uh he's not able to display so he
just blows up on that one if I do hard
it's going to say it's complex there we
go so what I need to
do interesting thing that we got it this
way so let's go to this one and let's
see if we delete this task does that
give us something nope it doesn't so
delete yeah it does not so delete is
probably giving us an error we got a
couple of things here to fix in this
next round uh index five out of bounds
for only five oh so so we probably
probably got it off by one so first
thing we're going to do is we're going
to try to figure
out this little thing about displaying
our you our proper type and name because
I think in our
type yeah because these were actually
environment setup they were not database
tables so we've got to fix those too
both of those we've got things that were
um not working right so we're going to
see if we can get a little bit
of math going on in here and see what we
can do with that and then uh we'll just
sort of try to get this fixed and then
get our delete and keep on going so go
out there and have yourself a great day
a great week and we will talk to you
next
[Music]
time