Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
empty container breaks templating?
System
This DCT has an empty container that I use to control pagination:
<container name="paginate-1" hide-name="t" />
This generates the following DCR fragment:
<item name="paginate-1">
<value/>
</item>
When I open DCRs created with this DCT I get this error:
Templating Error Page
An exception was thrown: Content mismatch between data capture object "paginate-1" and DCR object "paginate-1".
WTF?
Find more posts tagged with
Comments
JonathonG
Well, according to the datacapture5.0.dtd, the container element cannot be empty. So, it sounds like a bug with the validation code for datacapture.cfg. You shouldn't have been allowed to bring up a DCT that isn't valid to the DTD.
A suggested workaround: stick one hidden item in that container.
Jonathon
Independent Interwoven Contractor
Migrateduser
I agree and this is the workaround I am looking into - it just seems pretty silly that you could create a but not edit a DCR with an invalid DCT.
AKB
John,
I tried that before and it is really bad. Infact I tried with hidden field the same problem was there. Then I had a field and made it invisible using formAPI...My DCT Was more like
<record name="empty" type="content">
<item name="paginate-1"><value>
<item name="Title"><value></value></item></value>
</item></record>
looks like atleast one item is required...
Migrateduser
I got this working with what I consider to be a lame hack, but it should be fine until 6.x which has better pagination control. The DCT code (can be repeated as long as the identifiers are sequential):
<container name="paginate-1" hide-name="t">
<item name="paginate-1">
<text />
</item>
</container>
Here is the FormAPI I put in the defaultInitialization function shared to all of my DCTs:
var i = 0;
do
{
i++;
var item = IWDatacapture.getItem( '/paginate-' + i );
if ( item != null )
{
item.setVisible( false );
}
else
{
i = 0;
}
}
while( i != 0 );