Are you using T5.3? Have you tried moving tracker.recordError(…) from setupRender() to onUploadException(…)? I don’t think there’s any need to do your own persisting of the error message (because Tapestry will persist the Form through the redirect because it has an error).
Unless I’ve missed something, the principle is the same for upload in a component as it is in a page. See http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/fileupload Geoff > On 26 Aug 2015, at 3:25 am, Charlie Deuter <charlie.deu...@lithium.com> wrote: > > I'm trying to use a onUploadException event listener to catch failed uploads > and report the error as a validation error after the page reloads. I have > access to the error when the page reloads, but I don't know how to report the > error as it is not clear how to report an error to the validation tracker > outside of a validation event. > > Here is what I have at the moment, the setup render fails because the > validation tracker isn't yet available. > > @Environmental > private ValidationTracker tracker; > > @SetupRender > public void setupRender() { > > tracker.recordError(errorMessageService.getErrorMessageDescriptionText(exception) > } > @Persist(PersistenceConstants.FLASH) > @Property > private TotalUploadTooLargeException errMessage; > > @OnEvent(UploadEvents.UPLOAD_EXCEPTION) > Object onUploadException(FileUploadException ex) throws > TotalUploadTooLargeException > { > errMessage = new TotalUploadTooLargeException(1, 1, ex); > > return this; > } --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org