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)
cgi-callout in replicant
System
I have a cgi-callout in a <select> in a replicant. When the button is clicked, the onCallout event is triggered and it calls a function to populate the <select>. My issue is how do I determine which button was clicked. If I’m in the third replicant how do I know to only populate the third <select>? I am using FormAPI.
This DCT works, but since I don’t know which button was clicked I populate all the replicants. This isn’t good since I wipe out previously selected choices.
Thanks for any help.
Here’s is the portion of my DCT:
<container name="mappings">
<container combination="and" location="" max="4" min="1" name="maprep">
<label>Source and Target Mapping</label>
<item name="source" rowcontinue="t">
<label>Source Path</label>
<description>Enter a source folder</description>
<select required="t">
<cgi-callout label="Get Folders"/>
<option value="Choose a source" label="Choose a source"/>
</select>
</item>
<item name="target" rowcontinue="f">
<label>Target Path</label>
<description>Enter a target folder</description>
<select required="t">
<option value="Choose a target" label="Choose a source"/>
</select>
</item>
</container>
</container>
Find more posts tagged with
Comments
Johnny
doesnt the cgi-callout post the actual element within the replicant?
my $form_name = $cgi->{'form'}{'iw_form_name'};
my $element_name = $cgi->{'form'}{'iw_callback_var'};
my $user_name = $cgi->{'form'}{'user_name'};
my $item_name = $cgi->{'form'}{'iw_item_name'};
my $item_description = $cgi->{'form'}{'iw_item_description'};
my $dcr_name = $cgi->{'form'}{'iw_object_name'};
iw_callback_var is supposed to point to the element in question.
But I have never used it on a replicant.
John Cuiuli
Migrateduser
Hello,
I am having a similar problem. Did you ever figure this out?
Migrateduser
My datacapture.cfg look like this:
<container name="map" location="map">
<container location="maprep" max="unbounded" min="1" default="1" name="maprep">
<label>Source and Target Mapping</label>
<item name="source" rowcontinue="t">
<label>Source Path</label>
<description>Enter a source folder</description>
<select required="t">
<cgi-callout label="Get Folders"/>
<option value="Choose a source" label="Choose a source"/>
</select>
</item>
.
.
.
My form aip file looks like this formapifile.js
IWEventRegistry.addItemHandler("/map/maprep/source", "onCallout", pop_folders);
function pop_folders(item) -- item is the item in the replicate you came from.
{
newOptions = new Array();
newOptions[0] = new Option("Choose a source","Choose a source",true,true);
for (idx=0,kdx=1;idx<folder_lst.length;idx++,kdx++) {
// alert("in for " + folder_lst[idx]);
newOptions[kdx] = new Option(folder_lst[idx],folder_lst[idx],false,false);
}
// IWDatacapture.getItem("/map/maprep[" + (j+1) + "]/source").setOptions(newOptions);
item.setOptions(newOptions);
IWDatacapture.redraw();
return false;
}