Friday, June 17, 2011

One editable area can be used multiple times in a Custom Control

Not sure how many now this, but an editable area (xp:callback) can be used multiple times inside a custom control.

If you have an editable area with fields, you can put the field several places in the custom control (same facetName). I'm currently working on a custom control that lets the user edit/add documents. Inside a repeat control, I show the existing documents. Below that, the user can add documents.

E.g.
..
<xp:repeat>
..
<!-- View and edit existing fields -->
<xp:callback facetName="fields" disableTheme="true" />
..
</xp:repeat>
..
<!-- Create new document -->
<xp:callback facetName="fields" disableTheme="true" />
..
I also discovered that currentDocument seems to point to the "closest" document data source.

0 comments: