-
Jun 28th, 2011, 03:12 AM
#1
Multiple Event Decoration using Spring JS
Hi,
I'm building an application that uses Spring ajax event decoration to asynchronously send a request to the server and update a fragment on the page on completion (which is all working fine). What I'd like to do now is, whilst the request is being processed, display a message on another part of the page informing the user that their request is being handled. Additionally, once the async call completes, I'd like to update the message informing the user that their request has completed successfully.
I know that elements can be decorated with different types of functionality using numerous decorators (as per the decorator pattern), but I'm not sure how this might work with the functionality I require.
So I've got a couple of questions. Firstly, how would I display a message on a Div element using a Spring JS decorator? I imagine that I would need to create and add an additional event handler that will update the message Div. This handler would need to be added to the same element that's going to trigger the async call. I'm not sure how to do this.
Secondly, how would I add another callback to cancel/remove the message? I can see that the functionality that updates the DOM when the asyc call is completed could be used to also update the Div, but I don't see a way of initialising this piece of JavaScript
I can't seem to find too much documentation/examples on Spring JS - I've looked at the reference applications and unfortunately there are no bits of code similar to what I'm trying to do.
Any information would be very much appreciated
-
Jun 29th, 2011, 09:42 AM
#2
Fixed!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules