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)
FormAPI events
System
I am trying to fill replicants with <select> from a database. This works fine when operating on one item. But I cannot crack the nut on how to write a "new event" so that when adding a new replicant, this replicant will be filled with the <select>.
Does anyone have an idea on how to solve this?
/Per
Find more posts tagged with
Comments
Michael
Hi Per
This has come up a couple of times. If you search around the forum you should find more information. But in brief... there is no formAPI event which occurs when you add a replicant.
You may be able to achieve what you desire you an <inline> tag, unless you want a dynamically populated list based on other values on the form.
Cheers
Michael
SandeepMadan
Hi Per,
You can use the inline command to call an ipl. you can create the html code in IPL with database whichin turn will be displatyed in your DCT.
See if this code helps:
You can call the ipl from inline command as:
code in datacapture.cfg
<inline command="C:\iw-home\iw-perl\bin\iwperl C:\iw-home\custom\tmp_preview.ipl>
tmp_preview.ipl (IPL Code)
print "<?xml version='1.0' encoding='UTF-8'?>\n<substitution>\n";
if (! open(F, "< $file"))
{
print "<option value='' label='## ERROR ##'/>\n";
}
else
{
while ( my $elt = <F> )
{
chomp($elt);
if (not($elt =~ /$country:$type
[^:]*)/)) { next; }
print "<option value='$1' label='$1'/>\n";
}
}
print "</substitution>\n";
close F;
exit(0);
Cheers!!
Sandeep
Migrateduser
Hi Per,
U can register the onItem Add event for a replicant in following way:
parent.IWDCEventRegistry.addListener('onItemAdded',handleItemAdded);
This is not documented by the IW. So not sure whether the future TS versions would support this.
But its working fine both on TS 5 and 6.0
Regards,
Amit