This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Oct 27, 2013, 10:22 PM
453 Posts

Getting values from a viewEntryCollection in a repeat control

  • Category: Other
  • Platform: All
  • Release: 9.0
  • Role: Developer
  • Tags: repeate control,viewEntryCollection
  • Replies: 3

K have a repeat control that has a second level repeat. The first level is a list of categories and the dataSource for that column (catData) is bound to a viewScope variable that is loaded on afterPageLoads. The second level is populated by a lookup using catData  --> database.getView("xpAutomation").getAllEntriesByKey(catData, true); <-- I need to use the getAllEntries rather than getAllDocs because I need to retain the sort order of the view. The view xpAutomation has a column called Sort and it shows in the Data panel. the problem is in my second level repeat if I use the formula

"Sort Order " + detailData.getColumnValues("Sort")

then I get the error :

Error while executing JavaScript computed expression
Script interpreter error, line=2, col=28: [TypeError] Method NotesViewEntry.getColumnValues(string) not found, or illegal parameters

but if I use :

"Sort Order " + detailData.getDocument().getItemValue("Sort")[0];

it works correctly, however, I believe the detailData.getDocument.getItemValue("Sort") is not as efficient as the getColumnValues but the value seems not to be available. detailData is clearly a NotesEntryCollection so I can not see why it can't find the Column Value for Sort.

Any Ideas?

Thanks

Oct 28, 2013, 12:55 AM
586 Posts
hmmm

Bill,

It's late on football sunday and I might have partaken in a few beers :-) so feel free to ignore if needed.

You say this doesn't work:

"Sort Order " + detailData.getColumnValues("Sort")

Assuming there's no typo here, I believe getColumnValueS returns an ARRAY of all the values.  What I usually use is getColumnValue(x) I think... where x is the number of the column.  I don't typically use the programmatic name of the column but that should work.  Just use the singlular value rather then valueS I THINK.

You then do this:

 

"Sort Order " + detailData.getDocument().getItemValue("Sort")[0];

This works because you get the document.  Keep in mind that unlike LotusScript there's a specific method we can use in XPages:

detailData.getDocument().getItemValueString("Sort");

Just another way to do that....

 

Yes...  if you're in a repeat control making a lot of calles to getDocumenr() that's going to be expensive.  It might work ok... but there are other ways to do that.  But most likely if you drop the s on the getColumnValues call it will work as expected.

 

Dave

 

 

Oct 28, 2013, 4:05 PM
453 Posts
Interesting but still does not work

detailData is a viewEntry so I selected the property getColumnValues from the reference for Domino/NotesViewEntry which is plural and there is no singular getColumnValue. In any case when I use the notation

"Sort Order " + detailData.getColumnValue(1)

to get the second column in the view I get the error:

Error while executing JavaScript computed expression
Script interpreter error, line=2, col=28: [TypeError] Error calling method 'getColumnValue(number)' on an object of type 'lotus.domino.local.ViewEntry [Static Java Interface Wrapper, lotus.domino.local.ViewEntry: lotus.domino.ViewEntry]'

JavaScript code

   1: //"Sort Order " + detailData.getDocument().getItemValue("Sort")[0];
   2: "Sort Order " + detailData.getColumnValue(1)

Referencing the column by name gets this error:

Error while executing JavaScript computed expression
Script interpreter error, line=2, col=28: [TypeError] Error calling method 'getColumnValue(string)' on an object of type 'lotus.domino.local.ViewEntry [Static Java Interface Wrapper, lotus.domino.local.ViewEntry: lotus.domino.ViewEntry]'

JavaScript code

   1: //"Sort Order " + detailData.getDocument().getItemValue("Sort")[0];
   2: "Sort Order " + detailData.getColumnValue("Sort")

Using the getColumnValues gets this:

Error while executing JavaScript computed expression
Script interpreter error, line=2, col=28: [TypeError] Error calling method 'getColumnValue(string)' on an object of type 'lotus.domino.local.ViewEntry [Static Java Interface Wrapper, lotus.domino.local.ViewEntry: lotus.domino.ViewEntry]'

JavaScript code

   1: //"Sort Order " + detailData.getDocument().getItemValue("Sort")[0];
   2: "Sort Order " + detailData.getColumnValue("Sort")

The view in question is dirt simple just three columns the first is a name, the second is the sort order and the third is just a description.

This is really perplexing.

Oct 29, 2013, 9:30 AM
54 Posts
ViewEntry

As shown in the error message: ther´s no funtion getColumnValue in viewEntry class.

Tra  detailRow.getColumnValues([0])


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal