Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
th-app-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oscar Enrique Gonzalez Escurra
th-app-java
Commits
bce55aca
Commit
bce55aca
authored
Nov 01, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eliminar experiencias js
parent
3d8622d4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
19 deletions
+12
-19
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+1
-0
curriculumsearch/src/main/resources/static/main.js
+11
-6
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+0
-13
No files found.
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
View file @
bce55aca
...
@@ -33,6 +33,7 @@ public class PostulanteController {
...
@@ -33,6 +33,7 @@ public class PostulanteController {
@PostMapping
(
value
=
"/postulante"
,
consumes
=
"application/json"
)
@PostMapping
(
value
=
"/postulante"
,
consumes
=
"application/json"
)
public
String
guardarPostulante
(
@RequestBody
Postulante
postulante
){
public
String
guardarPostulante
(
@RequestBody
Postulante
postulante
){
System
.
out
.
println
(
postulante
.
getExperiencias
().
get
(
0
).
getCargo
());
return
"redirect:/"
;
return
"redirect:/"
;
}
}
...
...
curriculumsearch/src/main/resources/static/main.js
View file @
bce55aca
...
@@ -18,19 +18,24 @@ function agregarFieldExpierncia(evt){
...
@@ -18,19 +18,24 @@ function agregarFieldExpierncia(evt){
<input type="cargo" class="form-control " name="experiencia-
${
cont_experiencia
}
-cargo" id="cargo" >
<input type="cargo" class="form-control " name="experiencia-
${
cont_experiencia
}
-cargo" id="cargo" >
<label for="refNombre" class="form-label">Referencia Nombre</label>
<label for="refNombre" class="form-label">Referencia Nombre</label>
<input type="text" class="form-control " name="experiencia-
${
cont_experiencia
}
-referencias" id="refNombre" >
<input type="text" class="form-control " name="experiencia-
${
cont_experiencia
}
-referencias" id="refNombre" >
<button type="button" onclick="eliminarExperiencia(event)">Eliminar</button>
`
;
`
;
nee
.
className
=
"mb-3 col-5"
nee
.
className
=
"mb-3 col-5"
form
.
insertBefore
(
nee
,
btn
)
form
.
insertBefore
(
nee
,
btn
)
}
}
function
eliminarExperiencia
(
event
)
{
event
.
target
.
parentElement
.
remove
()
}
function
serializeJSON
(
form
)
{
function
serializeJSON
(
form
)
{
// Create a new FormData object
// Create a new FormData object
const
formData
=
new
FormData
(
form
);
const
formData
=
new
FormData
(
form
);
// Create an object to hold the name/value pairs
// Create an object to hold the name/value pairs
const
pairs
=
{};
const
pairs
=
{};
const
experiencias
=
[
{}
];
const
experiencias
=
[];
const
estudios
=
[
{}
];
const
estudios
=
[];
const
tecnologias
=
[
{}
];
const
tecnologias
=
[];
// Add each name/value pair to the object
// Add each name/value pair to the object
for
(
const
[
name
,
value
]
of
formData
)
{
for
(
const
[
name
,
value
]
of
formData
)
{
...
@@ -60,9 +65,9 @@ function serializeJSON (form) {
...
@@ -60,9 +65,9 @@ function serializeJSON (form) {
}
}
}
}
}
}
pairs
[
"experiencias"
]
=
experiencias
pairs
[
"experiencias"
]
=
experiencias
.
filter
(
exp
=>
exp
)
//eliminacion de nulos
pairs
[
"estudios"
]
=
estudios
pairs
[
"estudios"
]
=
estudios
.
filter
(
est
=>
est
)
//eliminacion de nulos
pairs
[
"tecnologias"
]
=
tecnologias
pairs
[
"tecnologias"
]
=
tecnologias
.
filter
(
tec
=>
tec
)
//eliminacion de nulos
// Return the JSON string
// Return the JSON string
return
JSON
.
stringify
(
pairs
,
null
,
2
);
return
JSON
.
stringify
(
pairs
,
null
,
2
);
...
...
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
bce55aca
...
@@ -68,19 +68,6 @@
...
@@ -68,19 +68,6 @@
<input
type=
"text"
class=
"form-control "
name=
"modalidad"
id=
"modalidad"
>
<input
type=
"text"
class=
"form-control "
name=
"modalidad"
id=
"modalidad"
>
</div>
</div>
<div
class=
"mb-3 col-5"
>
<label
for=
"institucion"
class=
"form-label"
>
Institucion
</label>
<input
type=
"text"
class=
"form-control "
name=
"experiencia-0-institucion"
id=
"institucion"
>
<label
for=
"fechaDesde"
class=
"form-label"
>
FechaDesde
</label>
<input
type=
"date"
class=
"form-control "
name=
"experiencia-0-fechaDesde"
id=
"fechaDesde"
>
<label
for=
"fechaHasta"
class=
"form-label"
>
Fecha Hasta
</label>
<input
type=
"date"
class=
"form-control "
name=
"experiencia-0-fechaHasta"
id=
"fechaHasta"
>
<label
for=
"cargo"
class=
"form-label"
>
Cargo
</label>
<input
type=
"cargo"
class=
"form-control "
name=
"experiencia-0-cargo"
id=
"cargo"
>
<label
for=
"refNombre"
class=
"form-label"
>
Referencia Nombre
</label>
<input
type=
"text"
class=
"form-control "
name=
"experiencia-0-referencias"
id=
"refNombre"
>
</div>
<button
type=
"button"
name=
"addExp"
onclick=
"agregarFieldExpierncia(event)"
>
Agregar
</button>
<button
type=
"button"
name=
"addExp"
onclick=
"agregarFieldExpierncia(event)"
>
Agregar
</button>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment