LotusScript: Export Contents of a View to .csv file
Yesterday I had a requirement to export a couple of views to csv files. We've done similar exports before, usually specific to the particular functions, so have used the traditional file handling functions that have been around for years - Open, Input (for reading), Write, Close. On this occasion, because I was exporting two views and to minimise the risk of columns being added to the export views but not included in the export agent, I wanted to build a more scalable solution. I knew that the NotesView class has a Columns property and from that I could get the column ...
Following on from BLUG last month, I'm attaching the slides and sample XPages database on my blog as well as on the BLUG site. A couple of things to note are: The dashboard will not work in Internet Explorer, because of the way I've constructed the chart. By using a repeat control, the javascript series is not available in time for Internet Explorer to use it. In Firefox it seems to be fine though. I used a repeat control merely to show how flexible repeat controls are. In reality, constructing the series in javascript as I showed in Part Two of ...
Today I picked up a query on the Notes and Domino 8.5 forum asking how to launch the first attachment on a document from a view panel in XPages. I had done something similar for BLUG in terms of adding content to a view panel and showing a thumbnail picture stored in a rich text field. I've done something similar in classic web development, using @AttachmentNames in a view and a quick look at the help confirmed that @AttachmentNames is one of the @Formulas available in XPages. I instantly offered a suggestion that included the following server-side javascript code to ...
Dojox Charting Tutorial – Part Three: Column and Bar Charts
In Part One I have given some background and generic code quired on any page showing a dojo chart. In Part Two I added a series using javascript onto my XPage and generated a pie chart. In Part Three I will cover the other two chart types shown on my first demo page, column charts and bar charts. Adding the Series If you try to apply the series we generated for the pie chart to a column or bar chart, you will find you get no data plotted. This is because of a limitation on the ...
Dojox Charting Tutorial – Part One: Background and Generic Code
At Intec we have a number of applications that have included charts for some time, whether for dashboards or other reporting. At the time the we used haneng charts, because we didn't have the expertise in house to develop anything as good or better. The product provided what we needed and still does. But as we included more dojo in our web-based products, the natural step was to consider dojox charting as a replacement, especially because of the ability to incorporate dojox charting in XPages or traditional web development, in the Notes Client or any browser, and without third-party ...
A couple of weeks ago I posted on my blog an Audit Comments Custom Control for XPages, which launches a dijit dialog for audit comments when editing a document, and passes the value of the field back to the underlying DominoDocument data element. This simulated finctionality I had previously used in the Notes client for logging a reason for editing - a screenshot of the dijit dialog (after validation has failed) is below: You will see that unlike the normal dijit.Dialog, this dialog does not have the "X" icon in the top right to allow ...
As part of a current XPages project we had the need to capture comments from the user when they edit certain documents. Similar functionality was developed for a Notes Client application before I joined Intec, using a dialog box in the PostOpen / QueryModeChange event to force the user to enter comments. My intention, therefore, was to reproduce the same process in XPages. Because I wanted the functionality in a number of XPages, and because it was functionality that could certainly be beneficial for other projects, I developed it deliberately to work as a standalone custom control. I also took ...
Option Four Option Four seems quite convoluted, but is essentially a simple principle. We use server-side javascript in the beforePageLoad event to set viewScope variables for each of the radio button, check box and list box mandatory questions we want to check against. We then use the onClick event to trigger a partial refresh and clear the viewScope variables. Our validation again uses server-side javascript to check the viewScope variable, and set a second viewScope variable if validation fails. We then set the styling of a div based on this second viewScope variable. A few basic points to note. The beforeRenderResponse event ...
Option Three is a modification of Option Two, which reproduced the client-side validation available for other XPages controls, with a javascript alert. At this point I should add some background to the application I was working on. The application in question is a major upgrade of our enterprise feedback tool, EFT, which added in Dojo styling, used NotesView2. I had already developed much of the application using classic notes web development and dojo before I attended an XPages course, but I took the opportunity to remove the agent that generated HTML on the fly for the survey response ...
Update I've now got everything working, got answers to my last blog post, and worked out the various Domino version differences affecting this all. So before I continue with Option 3 and Option 4, here's an update on where we are. Option 1 used the out-of-the-box server-side validation for radio buttons, check boxes and multi-value list boxes. This was ok, but in 8.5.0 any custom validation error message you entered for these controls was not rendered to the user. I'm pleased to say this is resolved for 8.5.1. Option 2 used an extension to the RequiredValidator function ...
Views Related to Current Date
One of the functions I found customers often requesting was a view where something in the view selection formula or column formula required comparison to today's date. But we all know @Today is not recommended in views because of the performance issues. This is a little agent I created to allow me to hard-code a date in a view's selection formula, but update it daily. The view selection formula is e.g. today:=[29/12/2009];SELECT Form="Document" & MarkForDeletion != "1" & LiveRefs = "" & ArchiveDueDate < today & Archived != "1" I use a list to hold the views - alternatively this could ...
XPages: Validation for Radio Buttons, Check Boxes and List Boxes: Part Two
In Part One we saw that the XSP.attachValidator function threw a javascript error, and that adding a required validator does not allow you to customise the message. However, with a little bit of scripting it is still possible to use XSP.attachValidator. Option Two: Add Scripted Validators First, a couple of basics. Whereas the required validator uses server-side javascript, XSP.attachValidator uses client-side javascript functions in xspClientDojo.js. You will find this as part of your installation in dominojsdojo-1.1.1ibmxspwidgetlayout. For more information on client dojo, see the Domino Designer wiki, which also taught me the techniques I use here to extend the functions. So our XPage ...
XPages: Validation for Radio Buttons, Check Boxes and List Boxes: Part One
I recently had the need to add validation to radio buttons, check boxes and list boxes for an XPages app. Sounds straightforward, surely it's just the same as for any other control. However, I was creating the Radio button group, Checkbox group and List Box controls for Domino documents in a repeat control. So for each document, the output might need to be a Radio button group, or a Checkbox group, or a List Box, or some other input control. And furthermore the control might be mandatory or not, and the validation message was also configurable. So within my repeat control ...






