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 onsave handler not working?
buddyholly
Hi, I've started using FormAPI, but its not doing what I want. I've tested it with an alert("hello"); and it works fine. I am now trying to have some events occur when the js script detects the save DCR has been called. I'm using the onsave feature but no such luck, here is my code of my external js file:
function init() {
IWEventRegistry.addHandler("onSave", test);
}
function test() {
alert("Save has been detected - TEST");
return true;
}
Thanks in advance.
Find more posts tagged with
Comments
MattP
There is a little more to save events. Take a look at:
http://<your
iw server > /iw/help/tst/formapi/formapi_18.html#SEC18
Matt
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA
buddyholly
Matt,
I've already looked at this documentation, it was too brief to understand. I tried to incorporate everything that it was saying on that page.
MattP
I agree, the documentation isn't great. I put this code just below my <ruleset> and it worked after I named the file and the save was complete. Subsequent saves it seemed to be just before save completion.
<script>
<![CDATA[
IWEventRegistry.addFormHandler( "onSaveDone", matt );
function matt() {
alert("Got this on DevNet");
}
]]>
</script>
matt
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA
Migrateduser
If there are specific things you'd like to see in the FormAPI documentation, please add to this post, and I'll see that the information gets to our tech pubs team.
kjackson
I too have just started using FormAPI and I have to agree that the documentation is not very useful. It seems to have been written by someone who knows too much about it and then read by someone who knows too much about it so that the end result is that too much is assumed or skipped.
Perhaps some complete examples would also help, rather than just snippets of examples sprinkled throughout.
MattP
Lissa-
If you have multiple peopls saying that the documentation is confusing or not useful, it is probably worth it to have your Instructional Designers have a look at it. The formAPI documentation is in a very different format than all of the other documentation, and clearly half hearted. From the posts, you and the documentation folks should be able to figure out what's missing.
My issue with it, is that the "snippets" are incomplete and not really in context, which makes it hart to learn. My preference is the format that the presentation template docs use.
http://<iw
server name>/iw/help/tst/pt/
The examples are complete, in context and usable.
Matt
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA
Adam Stoller
FWIW: The person who wrote the on-line docs for the templating / presentation template functions was an engineer - but he had previously been a teacher (something which not very many other employees have as backgrounds) - which might explain, in part, why it was that well written... i.e. he had both technical knowledge of the internals and a history of teaching others.
This doesn't mean you should stop asking for improvements in the documentation - I just figured I'd provide a bit of background for the discrepancy.
I think the online docs for FormAPI (.../iw/help/tst/formapi) are a bit more complete than the printed/PDF version...
--fish
(Interwoven Senior Technical Consultant)
Vicki
Hi, I had the same problem. Looks like they withdrew the method addHandler and split up into two methods addFormHandler and addItemHandler but the formAPI developer's guide pdf documentation still has addHandler in some examples (although the equivalent html doco seemed corrected).
Try replacing addHandler with addFormHandler.. this worked for me although I took some time to figure out what was wrong!
kjackson
WHere did you get the FormAPI developer's guide pdf documentation? Is it any different from the html version that is in the /server/help/tst/formapi folder?
Kerryn