I have a callout that I use for adding an item to a text file that becomes an option list and refreshing the option list when I close it. It works fine on non-replicant items, but it's blowing up on replicants. The function that actually reloads the list is a formapi function that I call from this close function that fires when the user clicks the Close button on the callout:
function CloseWindow() {
opener.top.getScriptFrame().populateOptionList('$element_name','$file_path_rel','$add_value');
self.close();
}
$element_name is coming from the iw_callback_var that is implicitly passed to callouts, e.g.
my $element_name = $cgi->{'form'}{'iw_callback_var'};
In populateOptionList, I use it as the xpath for a call to IWDatacapture.getItem(). On a non-replicant this works, bc the iw_callback_var matches the pathing syntax used by formapi. It appears to be different for replicants, though. The first instance, which should be /object/association[1]/associations is being passed as object/associations/19/association.
I can add some code that is very specific to my current implementation to detect the issue and recompute the path, but is there a best-practice, generic solution to this problem?