Disclaimer: This posting might be more academic in nature than anything else, since it might not be a very practical solution. However, depending on your needs, this might be a neat little hack you can implement in your own application.
I was asked by a user if I could basically "freeze" a column, similar to the function available in Excel. If you do this in Excel, you can scroll horizontally while your frozen columns stay fixed in place. This is a great feature when you have information in many columns, but want to keep the key value in view as you scroll. Unfortunately, Notes does not offer this option in views. I thought it might be possible to simulate this using column hide-when properties. What I came up with was good enough to satisfy the users, so I thought I'd share with the rest of the class. Here's the low down:
I created a couple of action buttons that control the "scrolling". The actions are used to set an environment variable to either "True" or "False" and this environment variable is checked in the hide-when formula for the columns I want to hide. In the case of my application, I basically wanted the four columns to the right of my first column to disappear if the user "scrolled" right. I would reverse the procedure to allow them to "scroll" the other direction. Since hide-when formulas for a view are evaluated only when the view is initially rendered in the Notes client, you have to either close and reopen the view or rebuild it. Just because I hate trying to close and open elements within frames, I chose to rebuild the view. The code for the action button then is very simply:
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Call session.SetEnvironmentVar("ItemMasterScrollLeft", "True") 'set to false to reverse
provided by Julian Robichaux at nsftools.com.
And for each column that should be hidden when scrolled, the hide-when formula becomes:
@Environment("ItemMasterScrollLeft") = "True"
Simple as pie! :-)
The pic below shows the feature in action. The hide-when feature of columns can be pretty useful, so don't forget it when designing your UIs.
Have a great weekend everyone!