4 Replies Latest reply on Sep 12, 2016 2:09 AM by qngo RSS
    fmanniti Creator

    How to set a value on opening a page

    Hi, I want to make a kind of Facebook notify icon when I have new alerts.

    I created a helper thing with these properties:

    NumberOfNewAlerts //Number

    HasNewAlerts //Boolean

    NumberOfUnackAlerts //Number

    HasUnackAlerts //Boolean

     

    through a subscription in my template (where the event is the new alert) I set NumberOfNewAlerts +=1 and HasNewAlerts = true.

    I would like a service that, anytime I open my AlertMashup, will set

    NumberOfNewAlerts =0 and HasNewAlerts = false.


    Is there a way to know when I open my page?

    Plus, this service must depend per user because if I have three users (A, B and C) which are allowed to see the project; I want that NumberOfNewAlerts refers to the actual new alerts to the user.

      • Re: How to set a value on opening a page
        aanjan Heavyweight Champ

        Fabio, if you always want to trigger that when opening a page, you can possibly write a service to fetch and set your value (something like GetProperties) and set that to trigger at Mashup Load.

          • Re: How to set a value on opening a page
            fmanniti Creator

            Yes, I've done something quite similar but my actual problem is:

            Let's say I have my alert's page open and I keep it open of one hour.

            Since my service triggers at opening page I have my values reset when I open it;

            but if a new alerts happens in that hour I don't want my NumberOfNewAlerts properties to increase because, if my Alert Page is open I guess I am already seeing new alerts incoming.

            I don't know if I was clear enough.

            So, in other words, I want my subscription which sets NumberOfNewAlerts +=1 and HasNewAlerts = true only works when Alert Mashup  page is closed.

              • Re: How to set a value on opening a page
                aanjan Heavyweight Champ

                I don't believe you can track if a page is open or not. If you use Popup Mashups, for example, you can trigger a 'close popup' event; that doesn't hold up for standard Mashups. I was going to suggest using user session information next, but that would hold true for the entire user session, regardless of whether the Mashup is open or closed.

            • Re: How to set a value on opening a page
              qngo Creator

              Hi, in the version 7.2.0 release notes, there's a feature enhancement of Mashup Builder: "Added the ability to update properties automatically in a mashup". I don't know what does it mean exactly but maybe it could help.