How to reload "beans" method result?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to reload "beans" method result?

unbearablepain
Hello, i have something like this.

<div class="modal-body">
     <p><\span th:text="${'result: '+beans.user.getLastText()}"></p>
</div>

Consider following case:
User presses some button on page which makes some controller's method invocation with ajax which changes result of getLastText(), but my div still holds old value. How do i refresh value in div without reloading page?
Any help is appreciated!
Reply | Threaded
Open this post in threaded view
|

Re: How to reload "beans" method result?

Emanuel
Administrator
You can make your Ajax response return the updated user.getLastText() value, so that in the response callback function of your Ajax request, you update the HTML code with that response value.