/ Forums / Advansys Formativ / Creating Solutions with Formativ / Filtering Task List / Reply To: Filtering Task List
The following version of your Portal code takes advantage of a DHTML component that you can download from here. To work with this applet, copy the file into your common Application Data folder, eg. C:Documents and SettingsAll UsersApplication Data.
For more information about this, see the article Fun with Tables.
I have used the _ operator to shorten source code lines in the VBScript code, to make it more readable.
In the HTML table, I have added tags
<thead>
,
<tbody>
and replaced the tag
<th>
by
<td>
in order to make the DHTML Behavior work.
Notice the Portal property .HTML is no longer used; .URL is used instead. I have done this to make the DHTML Behavior work correctly. You could still use the .HTML property, which requires embedding the JavaScript in the DHTML component into your source HTML – therefore also into your applet source code.
'------------------------------------------------------------------------------- Const LINK_START = "<A HREF=" Const UID_MARKER = "UID:" Const TABLE_END = "</table>" Const FONT_STYLE = "<FONT STYLE=""TEXT-DECORATION:NONE;FONT-FAMILY:ARIAL;COLOR:RED;FONT-SIZE=8PT"">" Const FONT_END = "</FONT>" Sub Main(Client, GWEvent) Dim iTABLE_BEGIN Dim iHRT Dim iMsg Dim iPortal Dim iPortals Dim iHTML dim iFilter dim iFileName dim oFileSystem dim oMessage dim oMessages iHRT = Chr(13) & Chr(10) Set iPortals = GroupWise.PortalManager.Portals Set iPortal = iPortals.Item("TaskManager") if iPortal is nothing then Set iPortal = iPortals.add iPortal.ID = "TaskManager" iPortal.OpenMessages = TRUE iPortal.NavigationControlsEnabled = FALSE end if iTABLE_BEGIN = "<table style=""behavior:url(sort.htc);"" border=""1"" cellpadding=""0"" cellspacing=""1"">" iHTML = iTABLE_BEGIN & "<thead><tr><td>Prio</td><td align=""left"">Subject</td></tr></thead>" iHTML = iHTML & iHRT & "<tbody>" iFilter = "(TASK AND NOT COMPLETED)" set oMessages = groupwise.account.calendar.messages.find(iFilter) for each oMessage in oMessages iHTML = iHTML & iHRT & "<tr><td align=""center"">" & _ FONT_STYLE & oMessage.TaskPriority & FONT_END & "</td><td>" & _ FONT_STYLE & " " & "<A HREF=UID:" & oMessage.MessageID & _ " STYLE=""TEXT-DECORATION:NONE"">" & oMessage.Subject & "</A>" & _ FONT_END & "</td></tr>" next set oMessages = nothing iHTML = iHTML & "</tbody>" & TABLE_END iHTML = "<HTML><BODY>" & iHTML & "</BODY></HTML>" set oFileSystem = Utilities.FileSystem call oFileSystem.CopyFile(oFileSystem.PathCommonAppData & "sort.htc", _ Utilities.TempFiles & "sort.htc", true) set oFileSystem = nothing iFileName = Utilities.TempFiles & "sort.htm" call Utilities.SaveStringToFile(iHTML, iFileName, true) iPortal.URL = iFileName iPortal.Show iPortals.ActivePortal = iPortal.ID End Sub
You can modify the JavaScript in the DHTML component to suit your needs, eg. sort by more than one table column.
I hope this helps.
Advansys Support