Tuesday, January 10, 2012

Smart Form with custom root element blank when editing (Version: 8.02)

When creating a SmartForm with a custom root element the SmartForm created correctly without a problem. When going to edit the SmartForm content it appears blank. However, the content is viewable (when not in edit mode), and renders properly.

Investigating the problem, it appears the xml is correctly there, it just won't let you edit it.

Credit for this solution goes entirely to EktronRashmi and was posted on the Ektron forum in his post Smart Form with Custom Root Element Doesn't Allow Editing.

This forum post contained the solution (Smart Form with Custom Root Element Doesn't Allow Editing):
Here's a fix for this issue
edit sitetroot\workrarea\java\ektron.xml.js
go to line # 299 and comment out following IF statement block (5 lines)
if ("<" == xml.substr(0, 1) && xml.substr(xml.length - 7) != "")
{
xml = "" + xml + "";
bRootTagAdded = true;
}

He actually puts a nice screenshot in there as well:

Based upon this article, I completed the following steps to fix the problem:
1. Checked the file out of source control
2. Applied the fix listed in the forum post
3. Checked the file in
4. Deployed to site

References:
Smart Form with Custom Root Element Doesn't Allow Editing
EktronRashmi Profile
Using a Tag Other Than Root

2 comments:

Andrew said...

Good post, thanks for formalizing and presenting this!

Joe said...

Great tip. Think I just ran into this on a client site. Will try it out.