Ben Langhinrichs

Photograph of Ben Langhinrichs

IBM Champion logo

E-mail address - Ben Langhinrichs







Recent posts

Wed 14 Nov 2018

Short agents



Tue 2 Oct 2018

No cookies for you



Fri 28 Sep 2018

We need more than baby steps


December, 2018
SMTWTFS
      01
02 03 04 05 06 07 08
09 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

Search the weblog





























Genii Weblog

Method of the day: AppendHotspot

Tue 15 Feb 2005, 10:41 PM



by Ben Langhinrichs
It may be just coincidence, but it feels like some days every person who calls or writes wants to hear about the same piece of Midas functionality.  Today was something unexpected for me, since it is usually HTML generation or MIME e-mails or dynamic tables.  Today, everybody wanted to know about the amazing AppendHotspot method.




Well, to be fair, nobody asked about the AppendHotspot method.  Nope, not one.  They just asked questions to which the AppendHotspot method was the answer.  

So, what is this method, and why should you care?  Part of the reason is that this is an "all purpose" method.  You can add action hotspots, buttons, computed text, text popups, file download hotspots, mosueovers, etc. etc., all with the same method.  Here is a brief sampling of the kinds or questions and answers (not just from today):

Q. Can I use create computed text on a page using Midas.
A. Sure.  Just use code such as:
Call rtitem.ConnectPageBody(db.Server, db.FilePath, pagename)
Set rtchunk = rtitem.DefineChunk("Everything")
Call rtchunk.AppendHotspot("ComputedText", |@If(@ClientType="Web"; "I'm a web browser"; "I'm a Notes client")|)

Q. Can I add a button to an e-mail message I am sending that will reply to me when the user presses it?
A. Sure.  Just use code such as:
Call rtitem.ConnectBackend(doc.Handle, "Body")
Set rtchunk = rtitem.DefineChunk("Everything")
Call rtchunk.AppendHotspot("Formula Button", |@MailSend("Joe Schmoe"; ""; ""; "I was pressed"; "Body")|, "", "Press me")

Q. Is it possible to insert a subform into a form using Midas?
A. Sure.   Just use code such as:
Call rtitem.ConnectFormBody(db.Server, db.FilePath, formname)
Set rtchunk = rtitem.DefineChunk("Inside Section 1")
Call rtchunk.AppendHotspot("Subform Formula", |@If(@ClientType="Web"; "WebSub"; "NotesSub")|)

Q. Can I add a JavaScript action hotspot inside a table cell of an existing document?
A. Sure.  Just use code such as:
Call rtitem.ConnectBackend(doc.Handle, "Body")
Set rtchunk = rtitem.DefineChunk("Table 1; Row 3; Column 2")
Call rtchunk.AppendHotspot("JavaScript Action", |alert('If I knew more JavaScript, this example would be better')|, "", "JavaScript example to press")

Q. Is it possible to add a file upload onto a form using Midas?
A. Sure.  Just use code such as:
Call rtitem.ConnectFormBody(db.Server, db.FilePath, formname)
Call rtitem.Everything.AppendHotspot("File Upload", "", "")

I could go on, but I bet you catch the drift.  Pretty slick method, eh?  Really makes you want ot go look at the Midas Help and see what else you can find (or even just read up on AppendHotspot), doesn't it?

Copyright © 2005 Genii Software Ltd.

What has been said:


300.1. Stan Rogers
(02/16/2005 06:31 AM)

That's a big 'un. The lack of a means to creates hotspots in LS natively was THE driving force behind my venture into DXL. While DXL does the job, it is by definition going to be slower, and a DOM parser has a lot of memory overhead. "Some day," he said wistfully, "I will work with a client who can grasp the benefit of Midas...."


300.2. Ashish Sidapara
(02/16/2005 08:36 AM)

Too good !!

I cannot think of any scenario which has been missed out .. keep it up :)


300.3. Bruce Elgort
(02/16/2005 11:53 AM)

@Ben,

Thanks for these great examples. It's amazing what you can do with your tools. I am blown away!

Bruce