Page 1 of 1

Auto page refresh

Posted: Tue Jul 01, 2014 4:40 am
by Lim Samantha

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. Image

please help, thank you!


Auto page refresh

Posted: Tue Jul 01, 2014 5:14 am
by Yurii Orishchuk

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:

  1. Common way:

    pre

    window.location.reload();

    /pre

  2. JQM specific:

    pre

    //Note you should replace "Screen20" with page name you need to reload.
    Apperyio.navigateTo("Screen20", {reloadPage: true, transition: 'none'})

    /pre

    Regards.


Auto page refresh

Posted: Tue Jul 01, 2014 5:26 am
by Lim Samantha

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.


Auto page refresh

Posted: Wed Jul 02, 2014 2:42 am
by Yurii Orishchuk

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.


Auto page refresh

Posted: Wed Jul 02, 2014 11:34 am
by Lim Samantha

Hi,
I do not have any "success" event handler. Where can i find it? Image


Auto page refresh

Posted: Wed Jul 02, 2014 11:43 am
by Lim Samantha

Hi, it works.
Thank you so much!