Monday, September 8, 2008

Fun with the WebBrowser Control - Making friends

The demoapp has gone through serious a serious rewrite to make the code more reusable/flexible. I've also worked a little bit on dynamically binding events through environment variables and execute. Sadly I haven't found a way of truly dynamically binding events (On Event..).

Some of the methods for the browser-class I use are now also chainable. E.g.
Dim browser As New Browser
Call browser.setSize(300, 400).openUrl("http://google.com")


Todays flash shows a little friend-making:



The document being edited has a hidden multi-value field that holds ID's to other "Discworld Characters". When a character is selected in the lookup, the id of that document is put inside a hidden field in the browser document.

When the browser is closed, the values is picked out of the browser document and added to the "friends-list". Then the document is refreshed/a lookup is run to update the list of friends (a computed for display field). This is achieved by binding a function-call to the windowclosing-event of the control.

I'm still not ready to release the demoapp. If I do that, I'm probably going to stop experimenting on the WebBrowser, and start mucking with XPages..

2 comments:

Tim Tripcony said...

Lookin' good, Tommy. Sadly, LotusScript only allows binding to events in product objects... so even if a COM object publishes events, we can't bind to them.

Tommy said...

I read that in the documentation. I guess I was(/am still) hoping for yet an undocumented feature.. :)