VJS VJS - 7 months ago 12
Java Question

JSP pop up showing previous / old values

My requirement is I have one data table on the JSP page in which one column is student and values are link there. If user click on link then pop up should open and provide the student details.

In popup I need to maintain look and feel like my other pages ( css etc ) so this means I cannot open normal default windows popup.

When I am loading the jsp using load function of jQuery. Jsp is calling only once so when my trying to fetching the dynamic content next time then previous value is showing on popup

$jScript("#DetailPopUpContainer").load('../admin/DetailPopUp', function() {
$jScript(this).dialog({
autoOpen: true,
//height:540,
width:680,
//loadUrl: 'http://xyz/admin/popup',
position: [250, 150],
modal: true,
cache: false
});


Please help.

Answer

Try adding one parameter to the URL which will pass random number every time to make it unique like below. To suit jquery syntax, you may need to adjust the code(ran=Math.random())

$jScript("#DetailPopUpContainer").load('../admin/DetailPopUp?rand='+Math.random(), function() {
                 $jScript(this).dialog({ 
                       autoOpen: true,
                       //height:540,
                       width:680,
                       //loadUrl: 'http://xyz/admin/popup',
                       position: [250, 150],
                       modal: true,
                       cache: false 


                 });