ReactJS-Labbook 1
ReactJS-Labbook 1
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
March 2018 1 Rahul Vikash Created new lab book as per course contents
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Table of Contents
Getting Started..……..…………………………………………………………………………… 4
Overview............................................................................................................... 4
Instructions............................................................................................................ 5
Learning More....................................................................................................... 5
1.2: Create a React Application & display the result shown below........................7
.............................................................................................................................. 7
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
When we put some data in ID, name, salary, department it will come
automatically come below the submit button shown below...................................7
.............................................................................................................................. 7
Lab 2. React................................................................................................................... 8
Create a web page in React & display the results shown below...........................8
Click on any header --Id, name, salary, department it will display the list in sorted order
of that header ................................................................................................................. 11
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
.......................................................11
Lab 4: React.................................................................................................................... 13
4.1 Read the booklist.json file with the help of react & display the images shown
below;.................................................................................................................. 14
Lab 5: React CRUD with Java middle ware application (Spring REST) with Router......15
Getting Started
Overview
This lab book is a guided tour for learning React For JEE version and above. It comprises ‘To
Do’ assignments. Follow the steps provided to work out the ‘To Do’ assignments given.
Here’s what is expected on your machine for the lab in order to work.
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Instructions
Learning More
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Time 60 minutes
All 3 classes are in separate file. We have to add mobile details such as id, name, cost & type
from different typescript file & print data in console
a. Get Data from array
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
1.2: Create a React Application & display the result shown below
When we put some data in ID, name, salary, department it will come automatically come
below the submit button shown below
When we click on Add employee alert box will open & display all data inserted as shown in given
image
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Lab 2. React
Goals
Understand the Directives & Data Binding
Time
180 minutes
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Create a web page in React & display the results shown below.
{empId:1001,empName:"Rahul",empSal:9000,empDep:"Java"},
{empId:1002,empName:"Sachin",empSal:19000,empDep:"OraApps"},
{empId:1003,empName:"Vikash",empSal:29000,empDep:"BI"},
];
When the user enter Id, name, salary & department in Add Employee & click button Add
Employee data will come in Show All Employee & message will display as shown in figure below
–example inserted id 1004,name rashi,salary 87000,department BI
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
When we click button “Delete” that particular row will be deleted from Show All Employee &
message will come ”DATA Deleted” as shown in below figure –Example delete rows 1003 by
pressing delete button
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
When we click button “Update” that particular row will be come in Update employee from Show
All Employee & as shown in figure & when updated employee button click the data will update in
show All employee & message will display
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
After Update employee button clicked data updated in show all employee & message came
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Click on any header --Id, name, salary, department it will display the list in sorted order of that
header .
Internal Array: [
{empId:1001,empName:'Rahul',empSal:9000,empDep:'JAVA',empjoiningdate:'6/12/2014'},
{empId:1002,empName:'Vikash',empSal:11000,empDep:'ORAAPS',empjoiningdate:'6/12/2017'},
{empId:1003,empName:'Uma',empSal:12000,empDep:'JAVA',empjoiningdate:'6/12/2010'},
{empId:1004,empName:'Sachin',empSal:11500,empDep:'ORAAPS',empjoiningdate:'11/12/2017'},
©2016 Capgemini. All rights reserved.
The information contained in this document is proprietary and confidential. For Capgemini only. | 15 / 25
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
{empId:1005,empName:'Amol',empSal:7000,empDep:'.NET',empjoiningdate:'1/1/2018'},
{empId:1006,empName:'Vishal',empSal:17000,empDep:'BI',empjoiningdate:'9/12/2012'},
{empId:1007,empName:'Rajita',empSal:21000,empDep:'BI',empjoiningdate:'6/7/2014'},
{empId:1008,empName:'Neelima',empSal:81000,empDep:'TESTING',empjoiningdate:'6/17/2015'},
{empId:1009,empName:'Daya',empSal:1000,empDep:'TESTING',empjoiningdate:'6/17/2016'} ];
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Time 40 minutes
3. Create a registration form and perform validations on the data entered in the
fields.
Note:
a. Make use of React form
b. All fields are mandatory
c. Product category will be –Grocery, Mobile, Electronics & Cloths
©2016 Capgemini. All rights reserved.
The information contained in this document is proprietary and confidential. For Capgemini only. | 17 / 25
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
d. When click on Add Product if all fields are validated the output will
come on console
e. We can select multiple store in Available list
Lab 4: React
Goals Working with react http services & axios redux and thunk
4.1 Read the booklist.json file with the help of react & display the images shown below;
Use booklist.json
4.2: Extended assignment 4.1 read booklist.json & apply search filter on id, title, year &
author ,as shown in diagram
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
If we Search author, id, title, year only searched value will display in output …..searching K in
author
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Lab 5: React CRUD with Java middle ware application (Spring REST) with
Router
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
b. When the user clicks on “Search Movie By Category” -> Allows user to
search movie(s) by Category. [Depending on Genre
(Drama,Fiction,Satire)]
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Note:
f. In above assignment movies are added via “Add Movies” and
Searched via “Search Movie By Category”. These are different
components.
g. Make use of React Forms.
h. Make use of services.
i. Make use of Router Module. Which should be created as a
separate module and included in the main App Module.
j. Use Spring restful & JPA concept to add movies & search movies.
k. All adding & searching movies done through database
Capgemini Public
2. REACT FOR JEE FS LAB BOOK
Figure 1........................................................................................................................................... 5
Figure 2........................................................................................................................................... 5
Figure 3........................................................................................................................................... 6
Figure 4........................................................................................................................................... 6
Figure 5........................................................................................................................................... 7
Figure 6........................................................................................................................................... 8
Figure 7........................................................................................................................................... 8
Figure 8........................................................................................................................................... 8
Figure 9........................................................................................................................................... 9
Figure 10....................................................................................................................................... 10
Figure 11....................................................................................................................................... 10
Capgemini Public