Xpages: Accessing fields in a repeat panel

Hi all,

Been experimenting with repeat panels and I’ve run into a bit of a snag and for the life of me can’t quite figure this one out. I’m sure it’s something simple and hopefully someone can enlighten me.

I’ve followed this exercise (http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Tutorial-Introduction-to-XPages-Exercise-23) and it does pretty much what I need it to do. Only problem I’m having here is how do i reference to a specific field on a specific row that has been generated from a repeat panel.

For instance, using the exercise above I’ve created 3 rows and filled in all 9 fields that have been generated with some values(3 fields per row). Now if I want to store the 1st field’s value on the 2nd row, how do I reference to it? I figured I would need to do something along the lines of ‘viewscope.test = fieldGroup[0].rowindex[2]’ but that gives me the good old ambiguous and unhelpful error 500 message when trying to preview it on the browser.

Hope that makes sense and thanks in advance to anyone who can suggest anything.

Subject: Re: Xpages: Accessing fields in a repeat panel

I’m not sure what the exact answer is, but in the Application Properties, XPages tab, do you have “Display default error page” ticked? That should ensure you get a more meaningful error message ratherthan Error 500.You’ll only see the XPages tab if you open the Application Properties in Designer.

You may find there’s a server-side javascript error.

Subject: Thanks for the tip but didn’t help unfortunatly. Figured it out though!

Appreciate the help but unfortunately I’ve never been able to get the ‘display error page’ to actually work. I’ll start a different thread on that seeing as I’d love to have that working.

I have managed to figure out how to access the data though now, so I’d thought I would share it in case someone else runs into this problem like me or if someone know a more elegant way to do this.

If you have this server-sided JS in place:-

var rawValues:Array = getComponent(“fieldGroup”).getValue();

var noOfRows = getComponent(“fieldGroup”).getRowCount();

where fieldgroup is the ‘collection name’ in the repeat panel. With these 2 bits of information you can then use a for loop and an @explode command to get to the specific parts you need.