1. Paul Withers01/29/2010 04:21:07 AM
Homepage: http://hermes.intec.co.uk/intec/blog.nsf
One of my frustrations with XPages v classic notes-for-web development is that XPages is intended to separate data from presentation. With classic notes-for-web development, you can have one $$ViewTemplate (or one for multiple views). However, with XPages, if you're showing views with different columns or columns in a different order, you need separate custom controls. This is a great idea for allowing user flexibility but could also be extended to pull from a database config, one of the ideas I've not had a suitable project to pursue.
For sorting, can you use the sortColumn and sortOrder properties of the DominoView? The problem is I've never been able to work out or find examples to see what values these properties expect to receive. The other problem is I think you would need to enable sorting on all columns in your Notes View, which could have performance impacts.
An alternative would be to have copies of the views sorted on the different columns, and switch the view based upon which column they want to sort (e.g. if sort is City, switch to a view myViewCitySort instead of myView)
2. Steve Castledine01/29/2010 04:25:56 AM
Homepage: http://www.stevecastledine.com
I do have a custom control that you just give the viewname to and it builds the view ala $$ViewTemplate - just needs some finishing off which I will do very soon and then upload to OpenNTF. It uses existing view design properties as well to determine whether to show columns or not
3. John Turnbow01/29/2010 04:35:23 AM
Homepage: http://www.recondite2.com
Very nice.. I think there would be a need to choose where each field shows up in the view as well, not just select. I would like the Customer Name to be in the first column but could not move it there. Do that and you've got a great control.
4. John Mackey01/29/2010 05:07:00 AM
Thanks for your comments.
@3, that's just a limit on my demo and the checkbox selection I use. You actually list the fields in the order you want and pass them separated with ";". Example: customername;address;phone
@1, it does use the sorted order of the view you selected. I'd like to offer the user a clickable title. I guess to build on your point, I could switch views when the user clicks on a column.
@2, I am curious to see how you incorporate the $$ViewTemplate
5. Mark Hughes01/29/2010 08:13:52 AM
why not just have a computed view data source, and compute based on scope variables, column values, hide when and stuff like that? I guess that is in a sense what you are doing anyway.
6. John Mackey01/29/2010 09:59:57 AM
@5, Mark that's an interesting idea. Calculate all columns in a view plus the datasource. I guess I could set 10 columns and hide the additional ones that have no field assigned. I'll test that out...thanks!
John
7. Steve Smillie01/29/2010 12:54:46 PM
Just like @1, I had the same thought and I even asked that question on the 8.5 Beta forum long ago.
The answer was one XPages per view.
When converting existing Domino apps that used a $$ViewTemplate to XPages, you replaced one form with many XPages/Custom Controls.
I like the idea @1 of expanding that custom control by pulling from some database config.
I definitely would have interest in a custom control like your working on.
8. Martin Rowland02/12/2010 09:49:41 AM
It would be great if you could make that custom control available on openNTF
9. John Mackey02/13/2010 05:40:41 AM
@8. Martin, I'm almost done with it and will be posting it on OpenNTF soon.
-John