Changeset 4421
- Timestamp:
- Feb 25, 2013, 2:48:31 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/api/waf/src/se/lu/thep/waf/Event.java
r2677 r4421 259 259 260 260 /** 261 * @return the last action in the queue, that is not marked as being an Ajax request 262 */ 263 public AbstractAction getLastNonAjaxAction() 264 { 265 AbstractAction lastAction = null; 266 if (actionChain.size() > 0) 267 { 268 // Return last AbstractAction that is not an Ajax type action 269 for (int i = 0; i < actionChain.size(); i++) 270 { 271 AbstractAction action = actionChain.get(actionChain.size() - 1 - i); 272 if (action != null) 273 { 274 String requestType = ""; 275 HttpServletRequest req = action.getRequest(); 276 if (req != null) 277 { 278 requestType = req.getParameter("requestType"); 279 } 280 if (requestType == null || !requestType.equals("Ajax")) 281 { 282 // Set action as last action 283 lastAction = action; 284 break; 285 } 286 } 287 } 288 } 289 return lastAction; 290 } 291 292 293 /** 261 294 * Runs the specified action and returning the next action to run 262 295 * -
trunk/client/servlet/src/org/proteios/action/ActionFactory.java
r4159 r4421 774 774 public void setLastEvent(Event event) 775 775 { 776 event.getRequest().getSession().setAttribute("previous.action.id", 777 event.getLastAction().getId()); 776 AbstractAction action = event.getLastNonAjaxAction(); 777 if (action != null) 778 { 779 event.getRequest().getSession().setAttribute("previous.action.id", 780 action.getId()); 781 } 778 782 } 779 783 -
trunk/client/servlet/src/org/proteios/action/job/ListJobsAjax.java
r4420 r4421 79 79 { 80 80 String ID = req.getParameter("ID"); 81 String requestType = req.getParameter("requestType"); 81 82 String cmd = req.getParameter("cmd"); 82 83 String jobIdListStr = req.getParameter("jobIdList"); 83 84 log.debug("doGet(): ID = \"" + ID + "\""); 85 log.debug("doGet(): requestType = \"" + requestType + "\""); 84 86 log.debug("doGet(): cmd = \"" + cmd + "\""); 85 87 log.debug("doGet(): jobIdList = \"" + jobIdListStr + "\""); 86 if ( cmd == null || !cmd.equals("updateJobTable"))88 if (requestType == null || !requestType.equals("Ajax")) 87 89 { 88 // Request not intended for this servlet , forward to ListJobs89 setForwardTo(ListJobs.class);90 // Request not intended for this servlet 91 log.debug("doGet(): requestType = \"" + requestType + "\" - Immediate return"); 90 92 return; 91 93 } -
trunk/client/servlet/www/static/js/script.js
r4419 r4421 438 438 function updateJobTableColumns() 439 439 { 440 // Set cmd so Ajax application can verify that the request was not intended for other servlet440 // Set cmd 441 441 var cmd = 'updateJobTable'; 442 // Set requestType to "Ajax" to prevent action from being returned as "last action" 443 var requestType = 'Ajax'; 442 444 // Get job id values in comma-separated list 443 445 var jobIdList = getJobIdList(); 444 var url = 'app?action=org.proteios.action.job.ListJobsAjax&cmd=' + cmd + '&jobIdList=' + jobIdList; 446 // Create url for Ajax XMLHttpRequest 447 var url = 'app?action=org.proteios.action.job.ListJobsAjax&requestType=' + requestType + '&cmd=' + cmd + '&jobIdList=' + jobIdList; 445 448 var request = new XMLHttpRequest(); 446 449 request.open("GET", url, false);
Note: See TracChangeset
for help on using the changeset viewer.