Using @Left in an XPage viewColumn

Let’s say I’ve got a View Control in a Custom Control that has been placed in an XPage.

The name of one column is CompanyName. Some of the data values are quite long. For example, we might have values like Jones Exploration and Production Company.

To truncate that value in a Notes Client view column, I would just apply @Left(CompanyName;12). Something that simple and straightforward doesn’t work in an XPage viewControl, however.

I know it has to be @Left(something,12);… but I don’t know what that something should be. Do I define a var and then pass that to the formula?

It seems absurd to be stuck at this elementary level, but – alas – that’s where I’m at for right now.

Your guidance is most welcome.

Cheers from Houston,

Steve Kobb

Subject: Three Steps

There are three steps you need to take if you want to include something other than an actual column value into a View Panel.1) On the View Panel itself, define the var (you’ll need to go to the All Properties tab). This allows you to get a handle on the underlying NotesViewEntry for the current row.

  1. On the View Column, ensure it is bound to an actual column in the view, but go to the Source Pane and add ‘value=“”’

  2. Add a Computed Field or whatever other control you wish within the xp:viewColumn. You can’t drag and drop directly there - the View Panel is a self-contained element, so you need to go to the Source Pane and copy and paste the Computed Field. You can then compute the output you require, getting a handle on the relevant NotesViewEntry using the variable defined on the ViewPanel

once you’ve done it once I am sure you’ll do it many times if you’re using a View Panel instead of a Repeat Control, even though the two are not that different from a conceptual point of view.

You can see a sample in the PostDemo_PeopleView XPage in the sample database I used for a session earlier this year at BLUG and NLLUG. The link is http://hermes.intec.co.uk/Intec/Blog.nsf/dx/12092010215736HERSL3.htm