qListView and Lync Presence Indicator Question - SharePoint Customization - SharePoint for All - Dell Community

qListView and Lync Presence Indicator Question

qListView and Lync Presence Indicator Question

This question has been answered by Novafix

Essentially I have a qListView web part that I'm using a Custom Display for and the Lync presence indicator does not appear when it pulls a Name field (with presence indicator). 

If I don't use the Custom display and just stick with using 'Display Fields' and put the tick in the box for 'enable presence' then it works fine.

My question is do you know if adding the 'enable presence' bit of the normal display is available in the custom dosplay?

So in normal the field view is

<Field Name="Name" Presence="true" GroupExpanded="false" />

and in Custom Display I have something like this

<a href="mailto:<%EMail%>"><%Name%></a><br>

I'm hoping it's a quick fix..

Verified Answer
  • Hi Novafix,

     

    I am sorry, I missed the ID property, you must set the ID to “QAIMID<%ID%>”, the script will set the user’s status according to the ID. You can try the below script again:

    <span><img src="/_layouts/images/imnhdr.gif" onload="IMNRC('<%EMail%>')" id="QAIMID<%ID%>" name="imnmark<%ID%>" ShowofflinePawn = "1" border="0" height="12" valign="middle" /><a href="mailto:<%EMail%>"><%Name%></a></span>

    Kenny

  • Hi Novafix,

     

    No, the Custom Field is under the “Display Fields” setting. you can click “Add Field” button there, and then, you can edit this custom field, you can put this script into ‘Calculated Value’:

     

    <script>createMailField('<%Mail%>','<%People%>')</script>

     

    Kenny.

  • Never mind, I solved it by adding a 2,3 & 4 to the other QAIMID bits and now they all work great.

All Replies
  • Hi Novafix,

    The Presence setting is just for the ‘User’ type field. It cannot work in the normal field.

    But I may have a workaround for you by configuring the custom field, you can try to change the Calculated Value as below:

    <span><img src="/_layouts/images/imnhdr.gif" onload="IMNRC('<%EMail%>')" id="<%ID%>" name="imnmark<%ID%>" ShowofflinePawn = "1" border="0" height="12" valign="middle" /><a href="mailto:<%EMail%>"><%Name%></a></span>

    The <%Email%> field is referring to the email address.

    Kenny.

  • Hi Kenny, thanks for the reply.  That's got the indicator in place and hovering over it pulls the info and shows the presence accurately but unless you hover over it everyone looks offline...any ideas as to why?=

  • Hi Novafix,

     

    I am sorry, I missed the ID property, you must set the ID to “QAIMID<%ID%>”, the script will set the user’s status according to the ID. You can try the below script again:

    <span><img src="/_layouts/images/imnhdr.gif" onload="IMNRC('<%EMail%>')" id="QAIMID<%ID%>" name="imnmark<%ID%>" ShowofflinePawn = "1" border="0" height="12" valign="middle" /><a href="mailto:<%EMail%>"><%Name%></a></span>

    Kenny

  • Kenny

    Hi Novafix,

     

    I am sorry, I missed the ID property, you must set the ID to “QAIMID<%ID%>”, the script will set the user’s status according to the ID. You can try the below script again:

    <span><img src="/_layouts/images/imnhdr.gif" onload="IMNRC('<%EMail%>')" id="QAIMID<%ID%>" name="imnmark<%ID%>" ShowofflinePawn = "1" border="0" height="12" valign="middle" /><a href="mailto:<%EMail%>"><%Name%></a></span>

    Kenny

     
    THis worked like a charm!  Thanks so much for your help :)
  • I have a follow up question - I have one site where I have 2 quest parts using this feature but the Lync presence indicator shows as green in 1 and grey in the other where the names are duplicated.  If I hover over the grey icon it shows everything correctly.


    Do you know a way around this?

  • Hi Novafix,

     

    I think because you are putting the same ‘ID’ value into the script. You may noticed that this script is suing the “QAIMID<%ID%>” as the ID property, if you put two web parts into one page, the <%ID%> may be the same.

    I would like to wrap this script as a JavaScript to generate the ID property value. Please try the below steps:

    1. Add a HTML From Web Part into the page;
    2. Click the “Source Editor…” in the edit mode.
    3. Put the below script into the Text Editor and save:

    <script>

    function createMailField(mail,displayField){

    return "<span><img onload=\"IMNRC('"+mail+"')\" id=\"QAIMID"+(1+Math.random()*10000).toString(16)+"\" name=\"imnmark"+(1+Math.random()*10000).toString(16)+"\" ShowofflinePawn = \"1\" border=\"0\" height=\"12\" valign=\"middle\" class=\"presenceIndicator\" src=\"/_layouts/images/imnhdr.gif\"/><a href=\"mailto:"+mail+"\"></a>"+displayField+"<span>";

    }

    </script>

            4. Edit the Custom field in the qListView,put the below code into the “Calculated Value”:

    <script>createMailField('<%Mail%>','<%People%>')</script>

            5. Save all.

     

     Now two web parts should work in the same page.

     

    Kenny.

  • Hi Kenny, thanks for the reply.  Iäm not 100% sure where you mean with that Custom Field. Do you mean to create a new column in the referenced list and use that calculated value? If so what should I call it?  Sorry, I'm not a great programmer...

     

  • Hi Novafix,

     

    No, the Custom Field is under the “Display Fields” setting. you can click “Add Field” button there, and then, you can edit this custom field, you can put this script into ‘Calculated Value’:

     

    <script>createMailField('<%Mail%>','<%People%>')</script>

     

    Kenny.

  • Fantastic stuff.  This worked great.  I was in the right area but had left the tick in the check box so it was messing the display up.  It all works great now.

    Thanks again for your help! 

  • OK, a new problem has surfaced with this.  If I save everything and press refresh it stops working as the Custom1 Field blanks itself....if I put a tick in the box it doesn't blank itself and survives through refreshes.  Is there a way to force the custom field to retain that setting without me putting a tick in the box as this causes it to be shown above the rest of the web part.

  • Never mind, I solved it by adding a 2,3 & 4 to the other QAIMID bits and now they all work great.