Hi Aaron, Ben and Grzegorz

Thanks for the replies. I think a code snippet may be helpful as I'm  
probably not explaining what I'm trying to do very well...

@DefaultHandler
     @DontValidate
     public Resolution view() {
         ServiceProviderContext sp = getServiceProviderContext();
         serviceProvider = getService().getServiceProvider 
(sp.getServiceProviderId());
         return new ForwardResolution("/WEB-INF/jsp/serviceProvider/ 
editAccount.jsp");
     }

     public Resolution update() {
         ServiceProviderContext sp = getServiceProviderContext();
         telephoneNumber.setTelephoneType 
(TelephoneNumber.TelephoneType.LANDLINE);
         serviceProvider.addTelephoneNumber(telephoneNumber);
         ServiceProviderValidationResult result = getService 
().updateServiceProvider(serviceProvider);

         if (result.isValidationSuccessful()) {
             return new RedirectResolution("/service-providers/" +  
getServiceProviderDisplayName());
         } else {
             return getContext().getSourcePageResolution();
         }
     }

I've taken out some error handling code to cut down the line count.  
What I'm trying to do is load the entity in the view method, allow the  
user to modify certain fields in editAccount.jsp and then update these  
changed fields along with the original unchanged data in the update  
method.

What is happening at the moment, I think, is that no state is  
persisted across the two requests - that's fine and I don't expect it  
to. I wonder if there is an built-in way to handle this transient  
state though? I don't want to re-load the entity before the update  
method as there is a small possibility that the entity may have  
already been updated during the users think time and this would result  
in that update being lost.

Many thanks

--
Stephen

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to