Display data from database using Javascript in Java code - java

I am using java and jsp to display my data.
I want to use javascript to display data from database on select of item from dropdown list.
i.e. i have a form where on selecting an item from a dropdown list the information of that item should be displayed.
How should I start it?

Related

dynamic creation of checkboxes based on retrieved database

I have a table that stores the values of labels both in English and French. How to show dynamic checkboxes based on that labels as checkboxes in JSP Structs
In the action class, I get a list of values. How to get them populated on JSP?
expected

change table based on selected value from database in JSP

I need to change the values displayed in the timetable based on the room I select from the dropdown list but I don't know how to do it.
The code for dropdown list is:
select option list
And on the same page, the code for the timetable:
timetable JSP page
Right now it shows all values from the database regardless of the selected room.
AJAX(Asynchronous Javascript and XML) can do this for you. AJAX allows for the updating of contents within an HTML object without reloading the page. W3Schools and the JQuery reference both have lots of helpful info on the matter.

Facted navigation using checkbox

I want a page in which list is need to be displayed and further I need to refine the result of list based on checked checkbox. i have set of checkboxes like filter by date , filter by status etc. In each set of checkbox, multiple options can be selected.
what i have tried till now is that i m retrieving separate list for each checkbox selected in the controller class. can u tell me how can i merge all the list in single based on selection (I also don't want duplicate entries) and pass it to my view.jsp or any other way to do this.
and one more thing when m using onClick for radio or checkox html input tag, action is triggered but tick is not getting retained in view page. Option is getting unchecked automatically on page refresh

Passing select row of HTML table to next JSP page

I created a HTML data table in a page say DATABROWSER.JSP through Java script (including all its row and there on click function in JS). I want to pass the selected(highlighted) row value to another JSP page(a new page that i open after selecting) without submiting the first page. !!
There's no way to get to another JSP without going back to the server.
I would place the items you select in hidden form fields and then submit the form. This would allow you to bring back a new JSP.

editable table in jsp whose rows(may be more than one row) on updation are updated in database

I need to develop an jsp application where I need to bring data from database table and display it in table in frontend dynamically. I need to make this table editable. The user can edit any number of rows which all should be updated in the database table automatically on clicking Save Changes button.
I am able to bring data from database table and display it. I am displaying the values obtained from table in each cell of input type text of form. We am i clicking edit button i am able to update only last edited row in the table.
Please tell how to update all the edited rows at a time.
Provide two links for view and edit
of table values
In view keep the values simply in td element of table.
In edit , use input elements of type text inside td element.
If you want to do everything in same page, Ajax can be used for both view and edit.

Categories

Resources