Ajax Refresh

  
Hi all

Ajax refresh allows to refresh an element by id in design time. Is it possible to ajax refresh  an element defined in an expression?

the ideia is to "ajax refresh" a container that is only known in runtime (by its client id) depending on a event message.

Thanks

Antonio Barroso


Hi António.

Depending on your scenario, you might try creating a web block for that, let's call it RefreshableContent. This web block would contain a single placeholder and a hidden ajax button. Clicking in the hidden button (via JavaScript) would refresh the placeholder.

Now you can use the RefreshableContent on your screens: whenever you want some content that may be refreshed, just place it inside the placeholder of this web block. On the client side, you still need to find the correct hidden button in JavaScript (maybe adding a special class to it would help), and send it a click event.
In general though, it would be nice to be able to refresh an element by its Id. Perhaps I'll create an Idea for that, as I've needed it in the past.
Leonardo Fernandes wrote:
Hi António.

Depending on your scenario, you might try creating a web block for that, let's call it RefreshableContent. This web block would contain a single placeholder and a hidden ajax button. Clicking in the hidden button (via JavaScript) would refresh the placeholder.

Now you can use the RefreshableContent on your screens: whenever you want some content that may be refreshed, just place it inside the placeholder of this web block. On the client side, you still need to find the correct hidden button in JavaScript (maybe adding a special class to it would help), and send it a click event.
 Thank you Leonardo

It seems to be a good way to resolve my  problem

best regards