Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Populate dropdown list dynamically
abhinav1
Hi all,
I want to populate a dropdown list dynamically in the DCT through a .txt file. I want this thing, when i open the form that is at the initialization of form not at any click event (Just like Callout). Can anyone tell me the solution.
Thanks
Abhinav
Find more posts tagged with
Comments
Migrateduser
This is a very common requirement. If you know FormAPI (for which there is documentation) and if you're familiar with generic Javascript, this can be accomplished very easily. I'm suggesting you Google "dynamically populating drop-down lists" and you'll find resources.
DevNet is great but it bugs me when people ask for / share code which one could do by himself with a little bit of effort. This might take a little while if you're not familiar with the syntax, etc. but if you don't know how to do something like that now, you should definitely learn.
Dave
Current Environments:
(1) TS 6.5 on W2K3 (x2 - diff. imp.)
(3) Vignette V7 Portal on Solaris 9
abhinav1
hello dev,
thanx for ur suggestion but the problem is that its very easy to populate dropdown list dynamically. It can be easily done with the FormApi but i want the options of that dropdownlist through the .txt file. and how can i read a .txt file through javascript or FormApi
thanx
Migrateduser
In that case, you'd be interested in doing a callServer in your form. What this does is invokes an external program or script and performs whatever you want it to. In this case, your callServer would be a script that will slurp in your text file and output the following:
<option value="1">item1</option>
<option value="2">item2</option>
, etc. It's very straight-forward is actually even faster to do versus dynamically changing your drop-down lists with Javascript!
Dave
Current Environments:
(1) TS 6.5 on W2K3 (x2 - diff. imp.)
(3) Vignette V7 Portal on Solaris 9
JonathonG
If I understand your question correctly, you want to populate a drop-down list with the contents of a text file at the time the DCT loads and not change it after that. If that is the case, you want to use an inline callout. something like:
<item name="blah">
<select>
<inline command="pathToSomeScriptToReadTextFile"/>
</select>
</item>
HTH
Jonathon
Interwoven Developer
Allstate, Inc.
page-break-test.doc
abhinav1
hi Jonathon,
Thanks, Jonathon. I got ur point. But we can't use the Javascript to read the content of the .txt file. Can i use the perlscript for that in the datacapture form. If yes, then how can i use that. Can u help me about that......
Thanks
Abhinav
iw_store
Hi,
You go through following concepts you will be able to do this :
1) in-line command.
2) cgi-callout.
3) callserver.
Thanks and Regards,
iw_store.