199 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Importing CSV via Java to a Notes Database
Fri, Aug 11th 2017 15
HTML5 Canvas to PNG via RPC
Tue, Jun 21st 2016 8
Eternal fustrations with IBM "Help" - - this time trying to give them money
Mon, May 23rd 2016 5
Simple Example: Bootstrap
Tue, May 3rd 2016 2
Import CSVs into a Notes/XPage database
Thu, Mar 24th 2016 6
REST via Service Bean
Tue, Feb 16th 2016 4
Reversing the display order of a Multi-value field (XPages)
Wed, Jan 13th 2016 5
Top 10
Importing CSV via Java to a Notes Database
Fri, Aug 11th 2017 15
HTML5 Canvas to PNG via RPC
Tue, Jun 21st 2016 8
nhttp preview won't "switch ID"
Mon, Dec 7th 2015 7
Import CSVs into a Notes/XPage database
Thu, Mar 24th 2016 6
dataTable with Categories
Tue, Jul 14th 2015 5
Reversing the display order of a Multi-value field (XPages)
Wed, Jan 13th 2016 5
Eternal fustrations with IBM "Help" - - this time trying to give them money
Mon, May 23rd 2016 5
Bootstrap Progress Bars - sample database
Wed, Aug 12th 2015 4
REST via Service Bean
Tue, Feb 16th 2016 4
StartKeys for categorized viewPanel and number column
Sat, Jul 4th 2015 3


StartKeys for categorized viewPanel and number column
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
   

In case this helps someone:

I have a database shared by a couple of departments, I use a field to segregate them. Each document has a MemberKey with a number value.

The first column is the department, sorted but not categorized, then a view were the column is sorted on numbers. As numbers they don't sort in the "proper" order. So I created a new column that padded it with zeroes to for the sort to be correct:

@Right("00000" + @Text(MemberKey);5)

So the third column is just the number, so it appears properly.

So I want this in an XPage viewPanel and to use the startKeys to get the the number desired.

I set the viewPanel to filter by the department name, and don't display the padded view. But it doesn't work. It doesn't work if I use the padded column either. It's because I'm getting just one category, so it's not really "starting" there.

I noticed the startKeys element can take a Vector, so I tried that. And it works.

I have a view panel that does not

I have a field  where I populate a viewScope called vFilter. If that is null, it return just one element in the vector, the department. Otherwise it returns a two element vector, with the department and the number I want to go to.

Here is my code in the startKeys element. (I'm using part of Thomas Adrian's Intrapages).

var query = new java.util.Vector();
var v = database.getView("(LookupUsers)");
var userdoc:NotesDocument = v.getDocumentByKey("User_UNID_" + userid,true);
if(userdoc!=null){
    query.add(userdoc.getItemValueString('regDepartment'));
    } else {
    query.add("Department not found");
    }
if(viewScope.vFilter != null){
query.add(@Right('00000' +  viewScope.vFilter,5));
return query;
}
return query;


Cheers,
Brian

---------------------
http://dominoherald.blogspot.com/2015/07/startkeys-for-categorized-viewpanel-and.html
Jul 04, 2015
4 hits



Recent Blog Posts
15
Importing CSV via Java to a Notes Database
Fri, Aug 11th 2017 8:35p   Brian M. Moore
It's been longer than I intended since my last post, but here it is. One of the things I've posted has been importing to a Notes database. My first was using LotusScript to import from an Excel file, I've moved to using CSV which does not require an external program. This one uses a Java bean and HashMap to map the field names. As with the others, this takes two files. First is a simple where the you have the data. The column titles will match up with the same row in a title spreadsheet. Th




Created and Maintained by Yancy Lent - About - Planet Lotus Blog - Advertising - Mobile Edition