Skip to main content link. Accesskey S
  • Translate Page ▼
  • Anonymous
  • Log on
  • Help
  • IBM logo
  • Lotus Notes and Domino Application Development wiki
  • All Wikis
  • Home
  • Community Articles
  • Product Documentation
  • Learning Center


Search

Advanced Search

Categories

Tag Cloud

  • 6.0
  • 6.5
  • 8.0
  • 8.5
  • 8.5.1
  • 8.5.2
  • 8.5.3
  • action bar
  • Agents
  • Ajax
  • app dev
  • beginner
  • C&S
  • calendaring and scheduling
  • client
  • composite applications
  • Controls
  • converters
  • css
  • Custom controls
  • Data Binding
  • db2
  • design elements
  • dialog boxes
  • Documents
  • Dojo
  • Domino
  • Domino Designer
  • Domino Designer 8.5
  • DXL
  • Eclipse
  • error handling
  • errors
  • extensions
  • FAQ
  • Forms
  • formulas
  • getting started
  • globalization
  • Help
  • html
  • Installation
  • interface
  • internationalization
  • Java
  • JavaScript
  • JSF
  • localization
  • Lotus Domino Designer
  • LotusScript
  • LotusSphere
  • LotusTechInfo
  • menu bar
  • Mobile
  • new user
  • Notes
  • Notes 8
  • notes.ini
  • NSD
  • OpenNTF
  • partial update
  • performance
  • Pickers
  • Portal
  • presentations
  • programming
  • Redbooks
  • Requested Articles
  • roadmap
  • rooms and resources
  • samples
  • Scripting
  • security
  • tabs
  • templates
  • themes
  • Tips
  • toolbar
  • troubleshooting
  • tutorials
  • validation
  • variables
  • video
  • VideoFest
  • View
  • view control
  • ViewPanel
  • Views
  • web
  • Web apps
  • Web services
  • webdev
  • x-pages
  • XML
  • Xpage
  • XPages
  • XPages Extensibility API
  • XPages Extension Library
  • xsp-config
  • データソース
InformationInformation
You are currently viewing machine translated content. IBM translation might be available. Click IBM Translated Product Documentation to see what is available.X


Home > Using Custom Controls > jancsibohóc 12345
Rate this article 1 starRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

jancsibohóc 12345 

expanded Abstract
collapsed Abstract
No abstract provided.

At first glance this seems like an exercise in can it be done versus should it be done.  So lets review our options for "dynamic" output of data on an XPage.  There are two controls you can use

  • View Control
  • Data Table Control

 Both of these controls use a repeat control to display the contents of a data source.  Using the View control for view data is a no brainer, but what about other data?  In one of my previous articles I demonstrated how to use XML as a data source and I used a Data Table control for the output.  One of my issues with using the data table control is that in version 8.5.0 there is no easy way to add column headers to the Data Table so your data is just listed there without the benefit of labels and sometimes formatting the elements of the data table can be challenging, for example you can not select a table row for formatting only the columns.

So wanting to have some more control I decided to see if I could combine an HTML Table with the Repeat control so that I could have a dynamic HTML table that could be used for view content or XML content or down the road "other" data sources.

The tricky part was that I only wanted to repeat the table row and there was no way to do that in the UI.  So I used the following steps to combined the two.

Create a new or modify an existing XPage.

Add a Table control to the XPage with at least two rows and however many columns you need to display your data.  The first table row will be used for the column headers and the second table row will be used to hold the repeated elements.

Next Add a Repeat control that uses the included Domino View as a Data source and sets a value for the collection name that we can use with the repeat control.


 

 Next add a computed field to the repeat control to repeat the view data for the first column.  For the value of the computed field use the variable name set in the repeat control which will allow you to choose one of the columns from the view source.  At this point the XPage Design mode will look like the following.

 

Now we need to combine the two elements so that the table row is repeated for every row in the view.

Switch from the Design mode to the Source mode.  The code should look like the following.


Here is the tricky part.  You need to edit the source code to surround the table row element with the repeat control and pace the computed field inside of the table data element.

The second table row is what we want to repeat so I manually edit the source code so it looks like the following.


The repeat control now surrounds the table row element to be repeated and the computed field resides in the table data element.

This is what it will look like in Design mode.


Now you can add the table header values and the additional computed fields to finish out the design so it looks like the following.


When it's rendered in the browser it will look like the following

 

A pager control can be added to page through multiple records.

The Pros of this technique are

You now have more control over the formatting and layout of the table

Works with view data or XML data

The only con is that once you modify the source code then the Repeat Control no longer is editable in the Properties tab of the designer UI and changes will need to be made via the source view.

I'm going to be using this technique as the basis of my next two articles so I wanted to lay it all out here for you.

As always the complete source code and example application can be downloaded from my website http://www.nnsu.com

Just click on the downloads link and download the XPages Playground applications


expanded Article information
collapsed Article information
Category:
Using Custom Controls
Tags:
XPages

This Version: Version 2 February 3, 2011 1:40:23 AM by istvan kovacs  
   
expanded Attachments (0)
collapsed Attachments (0)

 


expanded Versions (2)
collapsed Versions (2)
expanded Version Comparison
collapsed Version Comparison
     
Version Date Changed by               Summary of changes
This version (2) Feb 3, 2011 1:40:23 AM istvan kovacs  
1 Feb 23, 2010 12:29:24 PM Paul Calhoun  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Tip: When linking to articles use the original title, not the edited title. The alias for the link can be the edited title.
Go ElsewhereStay ConnectedSubscribe to RSSHelpAbout
  • All Lotus and WebSphere Portal wikis
  • IBM developerWorks
  • IBM Software support
  • Lotus Technical Information and Education Team Blog
  • Lotus Tech Info on Twitter
  • Lotus Tech Info on Facebook
  • Lotus product forums
  • Lotus Tech Info blog
  • IBM Collaboration Solutions
  • Recently added feedRecently added
  • Recently edited feedRecently edited
  • Recently added comments feedRecently Added Comments
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Contact IBM
  • IBM Terms of use
  • Wiki terms of use
Return to English
Arabic
Chinese Simplified
Chinese Traditional
French
German
Italian
Japanese
Korean
Portuguese
Russian
Spanish