Java view iteration with multivalues, vector, columnvalues

What’s the proper way to iterate through a view that has multivalue fields as separate entries (in java)?

Vector values from vector.elementAt(0).toString() is ok when the entry does not have 2 rows for that one document.

When the entry displays twice, each entry will result in the first multivalue value in brackets… as if an array is returned, however the vector.elementAt(0).getClass().getName() returns java.util.Vector, although I can’t get another vector handle to that element. Tried from doc.ColumnValues and ViewEntry.ColumnValues.

result of element’s toString:

Entry 1 (1 row)

Entry 2 (1 row)

[Entry 3 (2 rows)]

[Entry 3 (2 rows)] * the view would show unique entry here

Entry 5 (1 row)

I’m certain this is easily answered somewhere…

Subject: Update:Java view iteration with multivalues, vector, columnvalues

The word from IBM is that this is still under debate as to whether or not it will be fixed in the 7.x codestream.The current IBM status is: “Open & Reproduced”

weight: “Proposed by Development & Would Like to Fix”

Subject: Java view iteration with multivalues, vector, columnvalues

OK i can get the handle to the child vector by typecasting the variable type… (Vector)

However, the size method v.size() always returns 1 regardless of whether or not the entry is in 2 rows. What’s the best way to retrieve the 2nd row instance of column value in the view for the same doc?

I guess the workaround for now would be to split the values on the same row using a delimeter, instead of displaying multivalue entries separately in the view.

Subject: Known issue not to be fixed within this codestream

IBM states that although this is a known problem, it is not going to be fixed within the 6.x codestream… I have not yet heard as to whether or not this will be fixed within the 7.x codestream, assuming it is still a problem (I haven’t tested it on 7 yet).

Subject: RE: Java view iteration with multivalues, vector, columnvalues

Mr. Gassie,

I was having the same problem with an agent of mine that was traversing the entries in a notes view and processing documents. Wherever multiple values were being displayed as separate entries, the code was failing. It might not be an elegant solution, but this is what I done to fix the problem.

if ( vector.elementAt(2).getClass().getName() != “java.util.Vector” ) {

//whatever processing

} else {

v = (Vector) vector.elementAt(2);

for (int i = 0; i < v.size(); i++) {

     	if (v.elementAt(i) != null) {

     		zValues = v.elementAt(i).toString();

	}

}

}

Thanks