Allowing 0 Rows in a Repeat

The Allow zero rows in repeat controls setting in XSP Properties can be used to cause a Repeat control not to display any rows, giving you the ability to compute the row count as desired, even when there is data that would otherwise have been displayed. In this post, I’ll show how to update the setting and describe its effect.

XSP Properties

In Notes 9, you can find the XSP properties under Application Configuration in the Applications view of Domino Designer.

ZeroRowsInRepeat-A

This UI gives you a nicer front end to modify a number of values in the xsp.properties file, which contains a lot of configuration information for the application.

There are 4 tabs, 3 of which contain several properties that you can modify and the fourth tab which displays the full source of the properties file.

There are many, many properties that can be set in the file, but there are only a few specified by default. The rest are treated as default values when not otherwise specified.

ZeroRowsInRepeat-B

As you change properties in the UI, they will be added to the source.

Allow zero rows in repeat controls

The Allow zero rows in repeat controls setting on the Page Generation tab is not selected (i.e. false) by default.

ZeroRowsInRepeat-C

The effect is that if you have a Repeat control where the rows property is computed to 0, it will revert to the default row count of 30.

If you select that option, it adds this line to xsp.properties:

xsp.repeat.allowZeroRowsPerPage=true

With this setting, you can compute a Repeat control’s row count to 0 and it will not show any rows. This effectively hides it from the UI, but still loads the repeat control into the JSF component tree so it can be modified programmatically, if necessary.

Applicability

The XPages Portable Command Guide says that this property applies to View Panel, Data Table, and Repeat controls.

It works as expected with a Repeat control, but did not work properly with a View Panel in my testing (with Notes 9).

With the property set to false, a View Panel with the rows property set to 0 would show 30 rows. With the property set to true, the View Panel throws a divide by zero error.

ZeroRowsInRepeat-D

Advertisements

One response to “Allowing 0 Rows in a Repeat”

  1. Hilda says :

    I read a lot of interesting articles here.
    Probably you spend a lot of time writing, i know how to save you a
    lot of work, there is an online tool that creates
    readable, google friendly posts in seconds, just search in google – laranita free content source

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: