45
Views
4
Comments
Ajax Refresh
Question
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


2019-07-08 11-04-35
Leonardo Fernandes
 
MVP
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.
2021-10-11 16-59-13
António Barroso
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


 
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
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.
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.