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)
Adding Item in Saved DCR
cheeku
Hi All,
I am facinig a problem. I have created a DCT which is having some items. I have saved some DCR using this DCT. Now i have added a new item CHECKBOX in which is by default selected. Problem is whenever i open already saved DCR, the new Item comes up but by default it is not selected. Following is the code.
<item name="item1">
<description>Test</description>
<label>Test Item</label>
<checkbox>
<option value="testitem1" label="Test Item 1" selected="t"/>
</checkbox>
</item>
Can anybody help me regarding this?
Find more posts tagged with
Comments
Adam Stoller
I'm not 100% sure about this - but I believe attributes like selected='t' only take effect when you are working with a brand-new DCR (one without a saved name) - and not with a pre-existing DCR which is what you are dealiing with here.
If you think about it a bit - it would make sense because otherwise you would have to keep un-checking the box in every DCR you edited where you didn't want it checked - every single time you edited the DCR -- which would be just as bad, if not worse, behavior than what you are experiencing now.
You might be able to handle this with FormAPI - but even that is potentially problematic.
About the only way I can think of to reliably handle the addition of an item like this, that you want to default to checked, would be to write some code to traverse through all the pre-existing DCRs of this DCT-type, and - if it doesn't already contain the item at all - modify the DCR to insert the item with a value of '1' (presumably meaning checked); if it does already contain the item, leave it alone and move on to the next DCR.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com