iam inserting the emp details to TABLE, values are updating to ATABLE but iam not getting updated values in view (java sript in jsp file) please suggest me how to solve this problem

5 Years
Discussion Span
Last Post by javaAddict

Are you sure that the values are updated to the table. Do you query it and see them updated?
You cannot use javascript to run java code and update the table. Javascript has nothing to do with the java we run here.

If the values are updated, reload the page.

Post code at the JSP forum.

Edited by javaAddict: n/a


yes, query is updating the values into the TABLE
in java script i wrote like this:

<% if(request.getParameter(


yes, query is updating the values into the TABLE
in java script i wrote like this:

<% if(request.getParameter("emplUpdate") != null && errStr.equals("")) {%>

            alert("<bean:message key='siteadmin.errlbl.EmpEntSuccess'/>");   

            //reload the search frame
            window.parent.document.all.selEmp.value = "";
        <% } %>

But while clicking the hyper link the updated value is not showing in the view
By using then same hyper link iam added the new values, the values has been updating in the DB but in view iam getting updated values, it's showing previously values

Edited by Dani: Formatting fixed


From what I understand, the fraSearch is the frame where you have the code tha displays, and when you click the link, you put the emplUpdate in the request and determine if the javascript code will execute or not?

Well for that javascript to execute, you need to have it in a <script></script>
The java code executes and creates the javascript code you wrote. But that doesn't mean that the javascript will execute. It must be in the body and in the script tag.

I am not very familiar with frames so I wouldn't advice you use them.
Usually when you update the database and load the page again, you can read the database and display.
After seeing your code it depends where the code that updates is and then how you execute the page where you have the window.parent.frames("fraSearch").window.location.reload(); Can you post more code that shows how you update, how you display, where those happen and in general your jsps structure?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.