Updating flowScope member via Ajax?
Hi all,
I am making an ajax call that I need to update my page's model (claimEntryModel). I'm able to access claimEntryModel from the flowscope, but my changes don't appear when I submit the page.
My code so far looks like:Code: protected ModelAndView handleRequestInternal( fromServletRequest request , fromServletResponse response ) throws Exception {
final Maplt;String, Objectgt; flowMap = new HashMaplt; String , Object gt;(); ApplicationContext context = this.getApplicationContext();
FlowExecutorImpl executer = ( FlowExecutorImpl ) context.getBean( quot;flowExecutorquot; ); FlowExecutionRepository repository = executer.getExecutionRepository(); ExternalContext externalContext = new ServletExternalContext( getServletContext() , request , response ); ExternalContextHolder.setExternalContext( externalContext );
FlowHandlerAdapter handler = ( FlowHandlerAdapter ) context.getBean( quot;flowHandlerAdapterquot; ); FlowExecutionKey flowExecutionKey = repository.parseFlowExecutionKey( handler.getFlowuclHandler().getFlowExecutionKey( request ) ); FlowExecution flowExecution = repository.getFlowExecution( flowExecutionKey );
ClaimEntryModel claimEntryModel = ( ClaimEntryModel ) flowExecution.getActiveSession().getScope().get( quot;claimEntryModelquot; );
... some code that updates claimEntryModel ...
flowExecution.getActiveSession().getScope().put( quot;claimEntryModelquot; , claimEntryModel );
... expected the above would save changes, but it didn't ...
ModelAndView mav = new ModelAndView(); mav.setViewName( quot;ajax/lensStylesquot; ); mav.addObject( quot;namequot; , claimEntryModel.getName() );
return mav;
Any help on getting the model's changes to be saved would sure be welcome.
Thanks. |