I call servlet from project tab panel (using AJAX ) update database from servlet.
now i want to come back on project tab panel
i use
resp.sendRedirect(req.getContextPath() + "browse/TEST?selectedTab=com.jira.example.example_ao:wbs-project-tab-panel");
but its not working i want project tab panel page get refreshed
Hi Sachin,
I have a query : if you are doing AJAX call then why you are doing page refresh (which is similar to form submission).
you should understand the AJAX & Form submission concept first.
Again , can you elaborate your problem in detail ?
Hi Dipti
I have project tab panel in that i display AO table.from this project tab panel i called servlet throgh ajax on event. in servlet i make changes on AO table that changes should be reflecated on project tab panel from which i called servlet
database get modified but that changes is not shown on project ab panel After refreshing that page it show modified changes
<script> var data; var baseURL=document.getElementById("baseURL").value; $("#issuetable tbody").sortable( { stop: function( event, ui ) { var draggedItem = $(ui.item).find('td').eq(1).text(); var destinationDI=$(ui.item).prev().find('td').eq(1).text(); jQuery.ajax({ url: "${baseurl}/plugins/servlet/WBS_DNDUpdate", type: "GET", data: { source: draggedItem, destination: destinationDI }, dataType: "json", }); } }); </script>
this is Ajax script which call WBS_DNDUpdate.java servlet after event
on servlet
String url = ComponentAccessor.getApplicationProperties().getString(APKeys.JIRA_BASEURL)+"/browse/TEST"; System.out.println("==url=="+ url); resp.sendRedirect(url);
use this code for redirecting to project tab panel . the class of panel get executed after redirecting but updated data is not able to send to .vm file of that panel
so that updated data is not show on tab panel .
after manually refreshing page it shows.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sachin,
The problem here is the ajax call you are making .
a) Just do a direct form submission with form tag , which in turn will refresh the complete page.
b) please see $.get() in the link if it can be helpful : http://api.jquery.com/jquery.get/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@sachin,
Use this ,
var vBrowser = window.open('${req.contextPath}/secure/AddProject.jspa?projectstr='+selectedProjectStr,"_self");
vBrowser.opener=self;
vBrowser.focus();
instead of jQuery.ajax()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dipti
Thanx for u r help. http://api.jquery.com/jquery.get/ this link very helpful
jQuery.ajax({ url: "${baseurl}/plugins/servlet/WBS_DNDUpdate", type: "GET", data: { source: draggedItem, destination: destinationDI }, success: function() {location.reload();}, dataType: "json", });
success: used for calling function after successfull request.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.