Subject: RE: How do I run an Agent from JavaScript
Works for me, even with the button hidden. And please don’t call me Rogers.
Subject: RE: How do I run an Agent from JavaScript
Works for me, even with the button hidden. And please don’t call me Rogers.
Subject: RE: How do I run an Agent from JavaScript
I saw this (your) same tip in the Oct/04 issue of Lotus Advisor. Can’t get it to work.
On WinXP, Notes Client 6.5.3:
If the actual hotspot is marked as “Passthru HTML” is it not rendered in the HTML source.
HTML source: “AGENT”
If the “AGENT” hotspot is enclosed with passthru HTML comment tags (“”) the action hotspot is not rendered in the HTML source.
HTML source: “”
If the hotspot is not marked passthru HTML and also not enclosed by comment tags, it does get rendered in the HTML source with an “onclick” event that will call the agent.
HTML source: “AGENT”
I have not been able to figure out a way to both a) hide the action hotspot and b) have it still accessible to call from JavaScript.
Any suggestions? Anyone on Notes 6.5x been able to get this to work? Is this an OS-specific issue, or a Notes-version-specific issue, or both?
Can anyone confirm/deny if the Domino behavior towards HTML rendering of Action Hotspots changed from R5 to D6?
Subject: RE: How do I run an Agent from JavaScript
Hi Dave,
Let’s start from last part. Not marked passthru HTML and not enclosed by comment tag HREF works fine?! This mean that the problem is just to hide this link?! This what i’m trying with comments tag. It’s still available for javascript and hidden from the browser. It’s like create a hotspot with blank content. You can try something else:
1.Type some text
2.Select this text
3.Create Hotspot → Action Hotspot
4.Set command for current htospot
5.Delete text of hotspot
What you get?! Thin border without content. Try this. It’s still unvisible for browser and available for javascript. Check the source:
is the way to maintaine this hotspot in easy way, that's it.Hope this will resolve your problem
Best Regards,
Dima Pechersky
Subject: RE: How do I run an Agent from JavaScript
Good idea-- it seems to work fine. With no text in the hotspot, it is very thin, and thus a little tricky to reselect so you can modify it. But a very minor issue-- the tip itself is still valuable and now appears to work well in Notes 6.5.3 and WinXP.
Regards,
Dave Lehman
Subject: RE: How do I run an Agent from JavaScript
Thanks all for the tips. It works for me as well. Another tip I discovered, if you’d like to not remove all the text, is to make the text the same color as the background. Of course, this works better for solid backgrounds and not images. Another thing to keep in mind that might detract from this is that the spot is clickable if someone stumbled upon it. But, the letter i is also pretty small. It doesn’t seem to matter whether you show the boarder around the hotspot or not either. You can display the boarder if you like when the text color is the same.
Subject: RE: How do I run an Agent from JavaScript
HiI tried this and it works well. But how can I pass variables to the agent?
Subject: RE: How do I run an Agent from JavaScript
Hi Michael,
Your agent can get values of any items available on the form thru DocumentContext method of NotesDocument object.
Best Regards,
Dima Pechersky
Subject: RE: How do I run an Agent from JavaScript
WOW,
Dima this is the BEST!!!
Thank’s
Daniel
Subject: RE: How do I run an Agent from JavaScript
I can’t seem to get the initial click process to call my agent. I don’t get an error, the agent just does not run. If I click the created hotspot - it does run correctly. The programmatic click() doesn’t work.
I would appreciate any suggestions as to where I am going wrong.
Subject: RE: How do I run an Agent from JavaScript
Hi Carole,
I suggest to start from hotspot. Make hotspot visible and clickable and try to turn it on. After this step accomplished try to call this hotspot from another hotspot. You can send me the code i’ll glad to help you.
Best Regards,
Dima Pechersky
Subject: RE: How do I run an Agent from JavaScript
Thanks for your help - I found my error. The “OnChange” event did not run when I had the “Refresh fields on keyword change” tab selected. I now have the hidden button working correctly as you described.
Subject: it does not work in Firefox
Dima’s suggestions have been really useful - but it does not seem to work in Firefox. I’ve tried using “document.forms[0].elements[‘ButtonHTMLName’].click()” but this does not work either - any ideas for calling the agent that will work across all browsers?
Subject: RE: it does not work in Firefox
That syntax DEFINITELY works in Firefox (all versions), and everything else going back at least to NS3 (and probably NS2). Have you taken a look at the HTML source? Does the button you want to click appear in the source (uncommented)? Does it appear within the confines of document.forms[0] (the first form tag on the HTML document)? Is the button name spelled correctly (remembering that Javascript is case-sensitive)? Do you have more than one button with the same HTML name attribute (legal, but so very wrong inso very many ways)?
Subject: RE: it does not work in Firefox
Many thanks for the feedback Stan - I have it working now - I was actually using an action hotspot (text) and I changed this to a button and hid it using the “style” options described earlier and it all works in both IE and Firefox.