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)
Change value for select option list
Freedom
Can option list be editable in a DCT?
The scenario is the user can select a value from a option list. However, if user wants to add a new value available, they want to enter a value into the field. Is it possible?
Thanks
Find more posts tagged with
Comments
nipper
Out of the box no.
With some (non trivial) custom coding, yes. You will need a callout button and some formapi code to do this.
BTW, what OS and TS level ?
jbonifaci
There are also a few different ways you could do it using 2 fields on the dct with some FormAPI instead of a callout. But yeah, as far as I know there is not a way to do it with only one field without a callout.
Freedom
Thanks for your reply.
TS 6.5
OS Windows 2003
I did use a callout button, but if I enter a value in the pop window which is not in the listed options, the DCT does not take it.
nipper
You must have some formapi to change the list real time.
Andy
jbonifaci
You need to use FormAPI to add the option to the option list for that element.
One thing to keep in mind is that if you don't update the dct or wherever the options are being read from with the new value/label, that the next time the dcr is loaded, the user will see the value instead of the label. If the value and label are the same, then it isn't an issue.
Freedom
Should I use onCallout event? Does anyone have a example?
Thanks advance
jbonifaci
You should be able to update it right from your CGI. Take a look in the manual at getOptions, addOption, setOptions and removeOption. You can probably just use addOption if you don't care about where in your option list it appears.
Freedom
I can't seem to get the item throuh the IWDatacapture.getItem fucntion.
Here is the DCt looks like:
<item name="itc_notices" colspan="2">
<label>ITC Notices
</label>
<replicant max="10" >
<container name="notice_info">
<label>Notice Information
</label>
<item name="notice_type" colspan="2" >
<label>Notices type
</label>
<database deploy-column="f" />
<select required="f">
<option value="Notice of Institution" label="Notice of Institution" />
<option value="Scheduling Notice" label="Scheduling Notice" />
<option value="Revised Scheduling Notice" label="Revised Scheduling Notice" />
<option value="Cancellation of Hearing" label="Cancellation of Hearing" />
<option value="Termination of Investigation" label="Termination of Investigation" />
<option value="Termination" label="Termination" />
</select>
</item>
<item name="notice_date" colspan="2" rowcontinue="t">
<label>Posted Date
</label>
<database data-type="VARCHAR(10)" />
<text size="10" maxlength="10"
validation-regex="((((01|03|05|07|08|10|12)-((0[1-9])|([12][0-9])|(3[01])))|((04|06|09|11)-((0[1-9])|([12][0-9])|(30)))|(02-((0[1-9])|(1[0-9])|(2[0-8]))))-(19|20)[0-9][0-9])|(02-29-(19|20)(((04|08))|((2|4|6|8)(0|4|8))|((1|3|5|7|9)(2|6))))"
/>
</item>
</container>
</replicant>
</item>
When I use IWDatacapture.getItem("/itc_notices/notice_info/notice_type") to get the item, it returns "null".
Any ideas?
Thanks
Adam Stoller
notice_info is a replicant - so you need to provide an index - i.e. [0], [1], etc. for it.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com