Forum Discussion

telpochyaotl's avatar
14 years ago

Free Marker: Any way to know if MyProfilePage was saved.

Hi There... I'm fairly sure I can do a lot of what I want using javascript. However, if possible I rather use Free Marker.

 

Is it possible to know that the MyProfilePage was saved (as when the Save Changes button is pressed)?

 

One we could be, if somehow by using, say page.content to know if the feedback-success element was printed on the page.

 

Is there any way in FreeMarker to know what HTML elements were printed?

 

Another way could be, and it depends a lot of what the scope of these are, to see if http.request has parameters or attrubutes set by the process in charge of saving the form?

 

Is there any way to list all the parameters and attributes in the http.request object if one doesn't know the names? (definitely showing my lack of experience with free marker)

 

Ultimately what I'm trying to know is if the 'Save Changes' button was pressed in MyProfilePage and the Save was succesful, from free marker.   Is there any way to know this?

 

Thanks a lot in advance!

  • AdamT's avatar
    AdamT
    14 years ago

    My apologies.

     

    You'll need to reference the results as so:

     

     

    <#if activity.results.name.UserUpdated??>
      ...
    </#if>

     Sorry for the confusion!

     

  • AdamT's avatar
    AdamT
    Lithium Alumni (Retired)

    Hi, telpochyaotl.

     

    As of version 9.14, there is a FreeMarker variable called "activity.results." This variable contains keys related to both user and message events. For instance, after updating a user's settings, you can check the activity.results variable like so:

     

     

    <#if activity.results.name.UserUpdated??>
      Success! Your settings have been updated.
    </#if>

     Hope that helps!

     

    Edit: I originally gave the wrong information in this reply, but have edited this post to correct the error.

    • Hi!

       

      Sorry it took me so long to get back to this.

       

      I am running 9.15.0, according to ${application.version.numbrer}

       

      I tried the code you offered but

       

      activity.results.UserUpdated

       

      is always undefined... I figure it may be a diferent method name or attribute that I need to use. I've tried a few, but I'm blindly trying...     Is there any way to explore the methods or properties available for activity and activity.results?

       

      This seems to be exactly what I need but I have not been able to make it work...

       

      Thanks!

      • AdamT's avatar
        AdamT
        Lithium Alumni (Retired)

        My apologies.

         

        You'll need to reference the results as so:

         

         

        <#if activity.results.name.UserUpdated??>
          ...
        </#if>

         Sorry for the confusion!

         

      • AdamN's avatar
        AdamN
        Khoros Oracle

        Hi Claudius,

         

        Here are the events currently supported:

         

        Event NameDescription
        UserCreated Sent when a user is first created.
        UserUpdated Sent when a user property changes.
        UserRegistered Sent when a user completes registration. In the case of an SSO community with a Complete SSO Registration page, this is only sent after the user completes the registration.
        UserSignedOn Sent when a user signs on.
        UserSignedOff Sent when a user signs off. 
        MessageCreated Sent when a message is first created. (Not when it is published in the case of drafts).
        MessageUpdated Sent when any message property changes.
        MessageMoved Sent when a message is moved.
        MessageDeleted Sent when a message is deleted.

         

        I've submitted an article for inclusion in our TKB. Once it is published, I'll reply back here with the link so you can see the full details.

         

        I hope this helps!