Announcement Announcement Module
No announcement yet.
Multiple Event Decoration using Spring JS Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple Event Decoration using Spring JS


    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

  • #2

    Ok, discovered another post that solved my problem:


    • #3
      Thanks for share the post.