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 callout
jups
I have a requirement where in I have to pre-populate field "A" with the value inserted in field "B". The field "B" gets populated using cgi-callout. So I am not able to use onItemChange event handler as the value in field "B" gets populated using cgi callout. Also if I use onCallout event handler and try to call callout using formapi then I see once callout get triggered after that I am not getting a control back from callout. The control after invoking callout moves one without waiting for callout return value.
I see FormApi is having a limitation of handling such cases where in a field value gets automatically set from a cgi-callout and based on this field value another field need to be populated.
Can anyone suggest any workarounds?
Thanks in advance.
Find more posts tagged with
Comments
jbonifaci
Have your cgi callout call a function in your formapi after it sets the value of field B. This function will copy the value from B to A. If your callout is a generic callout, just have it accept a parameter that contains the name of the formapi function to call on completion, if any.
~Jeff
jups
Thanks that works.
mkeller
Can someone show me an example of that? I'm having the same issue with a generic callout.
jbonifaci
It's fairly straight forward. Create a function called copyFromAtoB in your formapi that just copies item A to B. This is fairly simple (getItem, getValue, setValue, etc.). Then, just modify your cgi callout to call this function after you return/set the value in your callout, for example:
<code that sets the value>
opener.parent.getScriptFrame().copyFromAtoB()
~Jeff