/ Forums / Advansys Formativ / Creating Solutions with Formativ / Filtering Task List
-
CreatorTopic
-
December 11, 2003 at 5:10 am #3995
Hi,
i want to display all tasks, which are not completed.
Two Problems:
1. I find a way to create a filter to find all tasks which are completed. But i need a filter to find all tasks which are NOT completed!
2. How can i display all the tasks?
My Applet:
Sub Main(Client, GWEvent)
dim iFilter
dim oMessages
dim iAllFindiFilter = “(TASK) AND (COMPLETED)”
set oMessages = groupwise.account.calendar.messages.find(iFilter)
iAllFind = oMessages.count
msgbox iAllFind
for i = 1 to iAllFind
msgbox oMessages.item(i)
nextset oMessages = nothing
End Sub
Thanks for assistance
Ralf
-
CreatorTopic
-
AuthorReplies
-
December 11, 2003 at 3:06 pm #6810
I recommend you look at Examples of Valid Filter Expressions. Unfortunately, Novell’s filter reference Filter Expression Syntax is not very helpful.
The filter for all tasks is:
iFilter = "(TASK)"
The filter for all uncompleted tasks is:
iFilter = "(TASK AND NOT COMPLETED)"
You can display tasks in one of the following user interfaces:
- a Formativ dialog (use a ListBoxControl, TabListBoxControl or StringGridControl);
- a HTML dialog, for which you build the HTML dynamically;
- a HTML portal, for which you build the HTML dynamically.
I hope this helps.
Advansys Support
[This message was edited by Support 3 on December 11, 2003 at 03:15 PM.]
December 15, 2003 at 7:59 am #6807Hi,
>I recommend you look at Examples of Valid Filter Expressions. Unfortunately, Novell’s filter reference Filter Expression Syntax is not very helpful.
I do this, but i cannot find a sample for this issue. Your are right with “is not very helpful”
>iFilter = “(TASK AND NOT COMPLETED)”
This works fine!>You can display tasks in one of the following user interfaces:
>a Formativ dialog (use a ListBoxControl, TabListBoxControl or StringGridControl);
>a HTML dialog, for which you build the HTML dynamically;
>a HTML portal, for which you build the HTML dynamically.
The final is to display the item as a HTML Portal. But first i triedset oMessages = groupwise.account.calendar.messages.find(iFilter)
iAllFind = oMessages.count
msgbox iAllFind
for i = 1 to iAllFind
msgbox oMessages.item(i)
nextIt applies the filter, count correct, Show the number of items,
but the loop doesn’t work.How can i access and display the subject of each item in the loop.
Thanks.
Ralf
December 15, 2003 at 3:22 pm #6812To access the subjects of messages via the GroupWise Object API, use something like the following code sample:
Sub Main(Client, GWEvent) dim iFilter dim oMessage dim oMessages iFilter = "(TASK AND NOT COMPLETED)" set oMessages = Groupwise.Account.Calendar.Messages.Find(iFilter) msgbox oMessages.Count ' The two following FOR statements are equivalent. for i = 1 to oMessages.Count msgbox oMessages.Item(i).Subject next 'for each oMessage in oMessages ' msgbox oMessage.Subject 'next set oMessage = nothing set oMessages = nothing End Sub
On choosing an appropriate user interface, note the significant difference between the HTML dialog and HTML portal. The dialog is modal while the portal is modeless. Be sure to read through the Formativ Programmer’s Guide, on the Portal Manager and/or HTML Dialogs. I suggest you study some example applets that use the Formativ Portal, and that generate HTML to be loaded into a Portal. A good one to start with is the Formativ Applet: Print Message. I hope this helps.
Advansys Support
December 16, 2003 at 12:35 am #6813Thanks a lot!
Yes i read the differences and i prefer the Portal to display my Tasklist.
Thanks for the Link to the other Applet.
Best Regards
Ralf
December 16, 2003 at 2:41 pm #6811No problems. Please let us know if you require any further assistance.
Advansys Support
December 17, 2003 at 1:12 pm #6805Ok, you say
>Please let us know if you require any further assistance
Yes, yes i need!i collect all infos to put the output into a portal.
———————————————%————————————————
Const LINK_START = "<A HREF=" Const UID_MARKER = "UID:" Const TABLE_BEGIN = "<table border=""1"" cellpadding=""0"" cellspacing=""1"">" 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 iHRT Dim iMsg Dim iPortal Dim iPortals Dim iHTML dim iFilter 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 iHTML = TABLE_BEGIN & "<tr><th>Prio</th><th align=""left"">Subject</th></tr>" iFilter = "(TASK AND NOT COMPLETED)" set oMessages = groupwise.account.calendar.messages.find(iFilter) for i = 1 to oMessages.count iHTML = iHTML & iHRT & "<tr><td align=""center"">" & _ FONT_STYLE & oMessages.Item(i).TaskPriority & FONT_END & "</td><td>" & _ FONT_STYLE & " " & "<A HREF=UID:" & oMessages.Item(i).MessageID & _ " STYLE=""TEXT-DECORATION:NONE"">" & oMessages.Item(i).Subject & "</A>" & _ FONT_END & "</td></tr>" next set oMessages = nothing iHTML = iHTML & TABLE_END iPortal.HTML = "<HTML><BODY>" & iHTML & "</BODY></HTML>" iPortal.Show iPortals.ActivePortal = iPortal.ID
———————————————%————————————————
Question:
How to sort the column.
Sample:
– Sort by Prio
– Sort by Subject
– Sort by Prio & Subjecti read about the Stringlist and look into the Sample Applet. With a single string i understand the way it works. But with MessageID & Prio & Subject i don’t know.
Best Regards
Ralf
[This message was edited by rfaude on December 17, 2003 at 01:28 PM.]
[This message was edited by Support 3 on December 17, 2003 at 04:33 PM.]
December 17, 2003 at 4:34 pm #6806The 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
December 18, 2003 at 1:11 pm #6808Yes the sample on the mickysoft site looks like what i want. But now i need time to learn how it works, because the “sort.htc” is not easy to understand, or do you have a simple sample?
Thanks
Ralf
December 18, 2003 at 2:20 pm #6809We do not have a sample of JavaScript that improves on sort.htc.
Another way to do this is to sort the tasks in the applet VBScript, rather than using dynamic HTML. You could use a StringList, which has a .Sorted property. In this case, add task data to the .Strings and .Objects properties as follows:
Sort by | String | Object ------------------------------------------------- Prio | .Priority | .Subject Subject | .Subject | .Priority Prio & Subject | .Priority + .Subject |
Once the StringList is filled, simply use it as your source data for the HTML table.
This approach is less interactive than DHTML; it requires re-executing the applet to see the tasks sorted in a different order.
Advansys Support
-
AuthorReplies
- You must be logged in to reply to this topic.