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 from DCT
deeps
The calendar.ipl has a method called handle_selection.
This method refreshes the datacapture form whenever a selection is made.
Is there a way to bypass this call and still the value from callout window should be reflected to the DCT.
Find more posts tagged with
Comments
pflory
What do you mean? The picture you've painted is fuzzy to me.
Can you provide an example of what you are trying to accomplish?
Paul Flory
deeps
Hi
Please refer the handle_selection() code below.
There is a call to opener.top.datacapture.refreshForm() and after that self.close() is called so that the callout window is closed. so the callout window will get closed only after the DCT is refreshed. I am trying to implement the same functionality but in my case the dct is too big due to which the callout window doesnot close immediately even when selection is made. so is there a way that i can skip the call to refresh function but still the selected value is set to the dct item.
function handle_selection()
{
if (callback())
{
opener.top.datacapture.refreshForm();
self.close();
}
else
{
alert('Please make a selection.');
}
}
deeps
Hi
Please refer the handle_selection() code below.
There is a call to opener.top.datacapture.refreshForm() and after that self.close() is called so that the callout window is closed. so the callout window will get closed only after the DCT is refreshed. I am trying to implement the same functionality but in my case the dct is too big due to which the callout window doesnot close immediately even when selection is made. so is there a way that i can skip the call to refresh function but still the selected value is set to the dct item. Is there a way to refresh a single item of dct instead of the entire dct?
function handle_selection()
{
if (callback())
{
opener.top.datacapture.refreshForm();
self.close();
}
else
{
alert('Please make a selection.');
}
}
JonathonG
The callback() function is what actually updates the value on the form. But, until you call refreshForm, the user will not see the new value. So, yes, you can skip the call to refreshForm and still have the data make it, but it won't appear that way to the user. If that is unacceptable (and I suspect it is), then you may need to figure out why the DCT is taking so long to load and make some adjustments (break it into pages, etc.)
Jonathon
Independent Interwoven Contractor
deeps
Hi jonathan, you are right the callback() function sets the values only at the form level and not the datacapture level. the refreshForm() call sets it to the datacapture level. but for me its too costly as some of my dcrs are as big as 62K.
how can i know what all functions are present within opener.top.datacapture?? is there a list for the same?
JonathonG
I don't believe there is a list for opener.top.datacapture. However, you might want to look at FormAPI, whose documentation can be found at:
http://<yourTSserver>/iw/help/tst/formapi
As for your specific problem with huge DCRs, iIs all the data on a single page? I think the IWDatacapture.Refresh() FormAPI function will only refresh the current page, so that should help quite a bit if you can break your data into multiple pages.
Jonathon
Independent Interwoven Contractor
deeps
Hi jonathan,
I have come up with a work around solution where in the cgi script, i get handle to the dct and call a java script function in it. This function calls IWdatacapture.getItem(...).setValue(...) so that the value is set at datacapture level.
Please find the code below. can you review the same an let me know if thats fine and as per standards?
* refer call to refreshItem()
function set_datacapture_item_value( selectedValue )
{
if ((window.opener == null) ||
(window.opener.closed))
{
return false;
}
var calloutForm = eval($form_name);
if (!calloutForm)
{
return false;
}
var api;
api = opener.top.getScriptFrame();
var calloutElementFound = false;
for ( i = 0 ; i < calloutForm.elements.length ; i++ )
{
if (calloutForm.elements
.name == '$element_name')
{
calloutForm.elements
.value = selectedValue;
if(api)
{
api.refreshItem('$item_name', selectedValue);
}
calloutElementFound = true;
break;
}
}
if (!calloutElementFound)
{
return false;
}
return true;
}
JonathonG
You can probably eliminate the for loop altogether, and just make a call to api.refreshItem with the item name.
Otherwise, this looks good to me. However, I'm still not sure this will display the value to the user unless you call the FormAPI refresh method.
Jonathon
Independent Interwoven Contractor
deeps
yep you are right, i can eliminate the loop...and yes it does sets the value to the field w/o call to refresh and if I save the dcr the values getting stored.
deeps
one more question is it possible to get hold of the xpath name of the item in the cgi script.