Installation Instructions

Apr 26, 2009 at 11:03 AM
Thank you, this column is exactly what im looking for. Can you please give me details on how to install this? I have downloaded and extracted the file but there is no .wsp file included.  
Coordinator
May 3, 2009 at 4:40 PM
There is a post build event that will either install the debug version or build a WSP for you. In Debug mode it installs the project, in Release mode it builds the wsp
May 13, 2009 at 11:28 AM

Thank you for the response Robert. I have installed the project and it is excellent. I have just one query. My users would like to have the item marked as read when they open the display form. I have shown them the option to click the tickbox to mark as read but they would prefer it to happen automatically. Is it possible for the item to be marked as read when it is displayed?

Coordinator
May 15, 2009 at 3:06 PM

Yes there is, actually it should happen by default. The column has a field associated with it, that when it renders on the read form it marks the item as read. How did you add the column ? Using the UI or in a template ?

May 17, 2009 at 11:30 AM

I added the column by clicking on create column in the list settings. I have tested the column on another list and it works fine on both edit and display forms. I think problem has to do with the fact that im using a custom list form for the display form. I have tested removing the custom list form and replacing it with the orignal display form and then the column works fine. Unfortunately I need to use the custom list form. Is there any way to work around this?

There is one strange thing though, I am also using a custom list form for the edit form and the column works fine.

I really appreciate your assistance with this. 

  

Coordinator
May 17, 2009 at 12:07 PM

That actually makes sense, the read mark for reading is hooked into the form display mode for the field control.  The control logic is in the CreateChildControls method in the ReadUnReadDataFieldControl. I have not tried this on a custom form but in Theory all you should have to do is add this control to your display form. The fully qualified name is Version3.SharePoint.ReadUnreadMarksDataFieldControl. If only problem may be with the VisibleOnForm function. If you look at the field configuration you will see the setting to make the field invisible. The way the logic works is that the SharePoint field setting for VisibleOnForm has to be set to true so that the field will render, which in turn marks the item as read whenever it is displayed. The control setting then renders JavaScript to remove the item from the display form. That JavaScript is coded specifically for the standard display form, and it might not act right on a custom form if the tags for the form are not the same.  Try simply adding the control to your custom display form. It should work, to get the invisible on form javascript to work, you will have to wrap it in a DIV tag with simple label in front of the control named labelReadUnreadMarksDataField.

 

If you post your custom form I should be able to help

 

-robert

May 18, 2009 at 6:55 AM
Edited May 18, 2009 at 7:02 AM
Hi Robert

Please see the form below. Thanks again for your assistance. It is highly appreciated. 

<%@ Page Language="C#" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" masterpagefile="~masterurl/default.master" title="|" meta:progid="SharePoint.WebPartPage.Document" %>
<%@ Register tagprefix="WebPartPages" namespace="Microsoft.SharePoint.WebPartPages" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content id="Content1" runat="Server" contentplaceholderid="PlaceHolderMain">
<WebPartPages:DataFormWebPart runat="server" IsIncluded="True" FrameType="None" NoDefaultStyle="TRUE" ViewFlag="0" Title="مراسلات" __markuptype="vsattributemarkup" __WebPartId="{C77CA6FD-F8A9-4C97-AF8D-BB05DD11667F}" id="g_60a57012_142b_4ed8_bd6e_9b8ed1933e64" __AllowXSLTEditing="true" WebPart="true" Height="" Width="">
<DataSources>
<SharePoint:SPDataSource runat="server" DataSourceMode="ListItem" UseInternalName="true" selectcommand="&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;ContentType&quot;/&gt;&lt;Value Type=&quot;Text&quot;&gt;رسالة&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;" id="_x0645__x0631__x0627__x0633__x0644__x0627__x062a_1"><SelectParameters><WebPartPages:DataFormParameter Name="ListItemId" ParameterKey="ListItemId" PropertyName="ParameterValues" DefaultValue="0"/><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{C85BBEB2-4136-4A18-826F-20437C75063D}"/></SelectParameters><DeleteParameters><WebPartPages:DataFormParameter Name="ListItemId" ParameterKey="ListItemId" PropertyName="ParameterValues" DefaultValue="0"/><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{C85BBEB2-4136-4A18-826F-20437C75063D}"/></DeleteParameters><InsertParameters><WebPartPages:DataFormParameter Name="ListItemId" ParameterKey="ListItemId" PropertyName="ParameterValues" DefaultValue="0"/><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{C85BBEB2-4136-4A18-826F-20437C75063D}"/></InsertParameters><UpdateParameters><WebPartPages:DataFormParameter Name="ListItemId" ParameterKey="ListItemId" PropertyName="ParameterValues" DefaultValue="0"/><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{C85BBEB2-4136-4A18-826F-20437C75063D}"/></UpdateParameters></SharePoint:SPDataSource>
</DataSources>
<ParameterBindings>
<ParameterBinding Name="ListItemId" Location="QueryString(ID)" DefaultValue="0"/>
<ParameterBinding Name="ListID" Location="None" DefaultValue="{C85BBEB2-4136-4A18-826F-20437C75063D}"/>
<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</ParameterBindings>
<datafields>@Title,الموضوع;@CorrRefNo,المرجع;@CorrForwardTo,إعادة أرسال;@CorrLink,أشاره;@CorrStatus,الحالة;@CorrAssignedTo,المكلف الى;@CorrTo,الى;@CorrDocDate,تاريخ الرسالة;@CorrDateDue,أتخاذ أجراء قبل;@CorrComments,تعليق;@CorrCategory,درجة الأهمية;@CorrFrom,من;@CorrCopyTo,نسخ الى;@Correspo,Correspondence Delegation;@Correspo0,Correspondence Forwarding;@Trackers,Trackers;@Read,Read;@Modified,تعديل;@ID,ID;@ContentType,Content Type;@Created,Created;@Author,Created By;@Editor,Modified By;@_UIVersionString,Version;@Attachments,Attachments;@File_x0020_Type,File Type;@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@_HasCopyDestinations,Has Copy Destinations;@_CopySource,Copy Source;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;</datafields>
<XSL>
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
<xsl:output method="html" indent="no"/>
<xsl:decimal-format NaN=""/>
<xsl:param name="dvt_apos">'</xsl:param>
<xsl:variable name="dvt_1_automode">0</xsl:variable>
<xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
<xsl:call-template name="dvt_1"/>
</xsl:template>
<xsl:template name="dvt_1">
<xsl:variable name="dvt_StyleName">ListForm</xsl:variable>
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
<table border="0" width="100%">
<xsl:call-template name="dvt_1.body">
<xsl:with-param name="Rows" select="$Rows"/>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template name="dvt_1.body">
<xsl:param name="Rows"/>
<tr>
<td class="ms-toolbar" nowrap="">
<table>
<tr>
<td width="99%" class="ms-toolbar" nowrap=""><IMG SRC="blank.gif" width="1" height="18"/></td>
<td class="ms-toolbar" nowrap="" align="right">
<SharePoint:GoBackButton runat="server" ControlMode="Display" id="gobackbutton1"/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="ms-toolbar" nowrap="">
<SharePoint:FormToolBar runat="server" ControlMode="Display"/>
</td>
</tr>
<xsl:for-each select="$Rows">
<xsl:call-template name="dvt_1.rowview">
<xsl:with-param name="Pos" select="concat('_', position())" />
</xsl:call-template>
</xsl:for-each>
<tr>
<td class="ms-toolbar" nowrap="">
<table>
<tr>
<td class="ms-descriptiontext" nowrap="">
<SharePoint:CreatedModifiedInfo ControlMode="Display" runat="server"/>
</td>
<td width="99%" class="ms-toolbar" nowrap=""><IMG SRC="blank.gif" width="1" height="18"/></td>
<td class="ms-toolbar" nowrap="" align="right">
<SharePoint:GoBackButton runat="server" ControlMode="Display" id="gobackbutton2"/>
</td>
</tr>
</table>
</td>
</tr>
</xsl:template>
<xsl:template name="dvt_1.rowview">
<xsl:param name="Pos" />
<tr>
<td>
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="190px" valign="top" class="ms-formlabel">المرفقات
<xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;</xsl:text>
</td>
<td width="400px" valign="top" class="ms-formbody"><SharePoint:AttachmentsField ControlMode="Display" FieldName="Attachments" runat="server" Visible="true"/>
<xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;</xsl:text>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>المرجع</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="@CorrRefNo"/>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>الموضوع</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="@Title"/>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>درجة الأهمية</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="@CorrCategory"/>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>الحالة</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="@CorrStatus"/>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>تاريخ الرسالة</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="ddwrt:FormatDate(string(@CorrDocDate), 1033, 5)"/>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>أتخاذ أجراء قبل</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="ddwrt:FormatDate(string(@CorrDateDue), 1033, 5)"/>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>من</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="@CorrFrom" disable-output-escaping="yes"/>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>الى</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="@CorrTo" disable-output-escaping="yes"/>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>نسخ الى</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="@CorrCopyTo" disable-output-escaping="yes"/>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>تعليق</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<SharePoint:AppendOnlyHistory runat="server" FieldName="CorrComments" ControlMode="Display"/>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>إعادة أرسال</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="@CorrForwardTo" disable-output-escaping="yes"/>
</td>
</tr><tr><td width="190px" valign="top" class="ms-formlabel"><H3 class="ms-standardheader"><nobr>أشاره</nobr></H3></td><td width="400px" valign="top" class="ms-formbody"><xsl:value-of select="@CorrLink" /></td></tr>
<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
<tr>
<td colspan="99" class="ms-vb">
<span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
</td>
</tr>
</xsl:if>
</table>
</td>
</tr>
</xsl:template>
</xsl:stylesheet> </XSL>
</WebPartPages:DataFormWebPart>
</asp:Content>
<asp:Content id="Content2" runat="server" contentplaceholderid="PlaceHolderSearchArea">

</asp:Content>
Coordinator
May 18, 2009 at 11:33 AM

Well it turns out that you cant just drop an edit control on the form as a standard asp.net web control.

We will need a simpler web control to drop on the page to mark read items from a custom display form.

 I should be able to get to adding it this week, if you want to try it yourself, all you need to do

is copy the logic from the field control, but substitue spcurrent context for the actual field rendering.

Coordinator
May 18, 2009 at 3:29 PM

I added a web control to the project to mark the current list and item (based on standard URL syntax) as read. To use it, on your custom display form

add the assembly and namspace to the form, add the new web control (ReadUnreadMarkITemAsRead) somplace on the form. If your item ID and

list context are non standard then you will need to set them as properties. You will also need to add the control namespace to safe controls if you have not

already done so.  Sample text is in the notes file.

 

May 19, 2009 at 11:48 AM

Its working!!!!!! :-) Thank you so much. I really appreciate you taking the time to help me with this.

The code you gave in the notes file was extremely useful. Since I am not a developer, I wouldn't have known where to start.  

Just for others reference, this is what i did.

  1. Retracted and deleted the readunread solution from sharepoint
  2. Built the solution in visual studio again
  3. Added and Deployed the wsp file to sharepoint
  4. Changed the display form to include the code as per the notes file
  5. Added the safe control to web.config

 

Coordinator
May 19, 2009 at 10:10 PM

Glad its working for you, out of curiosity what are you using it for ?

May 20, 2009 at 5:37 AM
I am using it for our internal correspondence system that is developed in Sharepoint. Your column has really improved the usability of the system. :-) 

On Wed, May 20, 2009 at 1:10 AM, robginsburg <notifications@codeplex.com> wrote:

From: robginsburg

Glad its working for you, out of curiosity what are you using it for ?

Read the full discussion online.

To add a post to this discussion, reply to this email (readunreadcolumn@discussions.codeplex.com)

To start a new discussion for this project, email readunreadcolumn@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com