Hi, how do we auto refresh our chat screen? for example, when there is a new text by someone who is also using this app, the page will be refresh automatically instead of us clicking on the 'update' button.
please help, thank you!
Hi Lim,
It's not good way to refresh all chat page.
You just need to update needed data.
For example in Appery.io you can do it with invoking datasource which will update your messages.
Also if after these facts you still want to update the page you can use following code:
Common way:
pre
window.location.reload();
/pre
JQM specific:
pre
//Note you should replace "Screen20" with page name you need to reload.
Apperyio.navigateTo("Screen20", {reloadPage: true, transition: 'none'})
/pre
Regards.
Hi, thanks for the advice.
How do i invoke datasource that will update my messages then? as i have already invoked datasource in my 'send' button.
Hi Lim,
As i understood, you have "send" message service and invoke this service on "send" button click.
In this case you need:
1 Open your page in data mode.
2 Open bottom "EVENTS" panel.
3 Select your "send" datasource and add "success" event hander with action "invoke service" and select then "messages" list service. http://prntscr.com/3yj6y8/direct
Regards.
Hi, it works.
Thank you so much!