XPages Repeat control - Error getting property

I’m trying to do some basic XPages designs, and I’m getting a 500 Server error.

I’ve narrowed it down to the repeat control, as I now have nothing else on the page except a Header custom control which is just some static text right now. Here is the source for my XPage

<?xml version="1.0" encoding="UTF-8"?>

<xp:view xmlns:xp=“http://www.ibm.com/xsp/core

xmlns:xc="http://www.ibm.com/xsp/custom">

<xp:this.data>

	<xp:dominoView var="ams"

		viewName="Organizations">

	</xp:dominoView>

</xp:this.data>



<xc:Header></xc:Header>

<xp:repeat id="repeat1" rows="30" value="${ams.Org_Name}"

	repeatControls="true">

</xp:repeat>

</xp:view>

So on the domino server I’m getting this error message:

HTTP JVM: SEVERE: CLFAD####E: Error processing request

I turned on he default error page and I’m getting this:

Error source

Page Name:/AMSDashboard.xsp

Exception

Error getting property ‘Org_Name’ from bean of type lotus.domino.local.View

I have made this repeat control just as simple as I possibly can. The only thing I’m unsure of is that “Org_Name” is the column name of the view, but the dropdown only offers the column title of “Organization”. I have tried both with the same result.

I googled for XPages and “property not found” and the single result was from someone saying their JVM was somehow messed up and he changed development servers.

Does anyone have any insight here?

Subject: The Repeat control source needs to be a list or an array

The repeat control source needs to be a list…something that can be iterated through.

So you would just use “ams” and within the repeat you can add your controls and access the field you want as it iterates through the collection.

David Leedy just posted a nice tutorial video on this subject. Here’s a link: http://planetlotus.org/51b850

-John

Subject: The Repeat control source needs to be a list or an array

Alright, so I am just following along with the video. Everything works just fine with putting a view on the page. I then add a repeat control, a panel, and a computed field (with simple data binding) pointing to one of the fields in the view. This fails.

I don’t know why it would matter, but we are running the Domino server on an AS400.

Subject: can you post your new xpage source code?

I’ll test it here and let you know what I find.

-John

Subject: Re: can you post your new xpage source code?

I don’t really see much different from the first time. I did nothing different from the defaults shown on the video - even made a clean XPage.

1 - Connect page to view

2 - Drag repeat control

3 - Drag panel

4 - Drag computed field

5 - Choose the view column

It seems so basic…

<?xml version="1.0" encoding="UTF-8"?>

<xp:view xmlns:xp=“http://www.ibm.com/xsp/core”>

<xp:this.data>

	<xp:dominoView var="view1"

		viewName="AMS Contracts\Total Care">

	</xp:dominoView>

</xp:this.data>

<xp:repeat id="repeat1" rows="30" value="#{view1}">

	<xp:panel>

		<xp:text escape="true" id="computedField1" value="#{view1.Organization}"></xp:text></xp:panel></xp:repeat></xp:view>

Subject: Correction

Either I had forgotten to set the collection name for my Repeat control, or it somehow forgot that information. I corrected the issue and retested without any difference, but here is the corrected source code:

<?xml version="1.0" encoding="UTF-8"?>

<xp:view xmlns:xp=“http://www.ibm.com/xsp/core”>

<xp:this.data>

	<xp:dominoView var="view1"

		viewName="AMS Contracts\Total Care">

	</xp:dominoView>

</xp:this.data>

<xp:repeat id="repeat1" rows="30" value="#{view1}" var="dataRows">

	<xp:panel>

		<xp:text escape="true" id="computedField1" value="#{view1.Organization}"></xp:text></xp:panel></xp:repeat></xp:view>

Subject: minor change

Hi Gary,

I got it working by using a “Collection Name” for referencing the field value. You set the collection name on the repeat control properties panle to “rowData”. Then in your computed field, set the data source to use the rowData instead of view1. Here’s the modified source. Let me know if that fixes the problem:

<?xml version="1.0" encoding="UTF-8"?>

<xp:view xmlns:xp=“http://www.ibm.com/xsp/core”>

xp:this.data

<xp:dominoView var=“view1”

viewName=“AMS Contracts\Total Care”>

</xp:dominoView>

</xp:this.data>

<xp:repeat id=“repeat1” rows=“30” value=“#{view1}” var=“rowData”>

xp:panel

<xp:text escape=“true” id=“computedField1” value=“#{rowData.Organization}”></xp:text></xp:panel></xp:repeat></xp:view>

-John

Subject: That fixed it

We cross posted at the same time. I was onto it, but I was still referencing the view and not the rowData.

Thanks for the help.

Subject: Great!

Subject: So that’s what “default error page” does … Thanks Gary!!