posted
What is the right syntax for writing event handlers for the webbrowser control? Can you give me an example?Posts:
5 | Registered: February 07, 2007
To write webbrowser event handler in Formativ, we will suggest you to see the Events tab in the Object Inspector. You can drop a EmbeddedWB from Additional tab into your Form then select the EmbeddedWB, click Events tab in the Object Inspector. Double click any of the event (i.e OnDownloadBegin, OnDownloadComplete, etc) to generate the code.
Hope this helps.
Regards, Advansys SupportPosts:
821 | Registered: February 19, 2006
posted
The instructions you've given - double-clicking on events in the Object Inspector - don't work for me. When I double-click on an event, nothing happens. I'm running Creator 2.0.1 with GroupWise 7.0.1 on Windows XP Professional with IE 7. Any idea what I'm doing wrong?Posts:
5 | Registered: February 07, 2007
posted
I am using Formativ Studio 2.0.1, GroupWise 7.0.1 (Build date: 14/12/2006) & IE 6. I will test with Creator and let you know the results. What is the build date of the GroupWise client (see Help - About GroupWise)?
Regards, Advansys SupportPosts:
821 | Registered: February 19, 2006
posted
I am trying to capture EmbeddedWB events but most of them I try never fire.
Am I missing anything that would make sure such events as OnNavigateError and OnNavigateComplete2 actually fire?
The only event I have been able to see fired is OnProgressChange.
Specifically, I am trying to create some code that will determine if the page I browsed using .Navigate was successful. i.e. not a page not found error.
[This message was edited by ctaleck on November 18, 2009 at 01:42 PM.]Posts:
78 | Registered: May 01, 2008
posted
Our engineers confirmed the behaviour, we also noticed few other events also not fire. We are not sure what cause this events not to fire, potentially a low level component integration.
Given OnProgressChange events work, you can use the following workaround to determine page loaded successfully.
dim gURLPrecossed
Sub Main(Client, GWEvent)
gURLPrecossed = false
Maindlg.embeddedWB.navigate("www.advansyscorp.com")
Maindlg.ShowModal
End Sub
Sub embeddedWBProgressChange(Sender, Progress, ProgressMax)
utilities.trace("-> embeddedWBProgressChange gURLPrecossed: " & gURLPrecossed)
utilities.doevents
' Event can fired more then once, we will skip if gURLPrecossed global variable
' is TRUE. Set gURLPrecossed to FALSE on loading page (i.e. Navigate() method).
if (not gURLPrecossed) then
' Skip if engaged in a navigation or downloading operation.
if (Maindlg.embeddedWB.Busy) then
utilities.trace("-> embeddedWBProgressChange embeddedWB.Busy")
exit sub
end if
dim oDocument
if Utilities.IHTMLDocumentFromViewHandle(Maindlg.Handle, oDocument) = 0 then
utilities.trace("-> embeddedWBProgressChange oDodument.title: " & oDocument.title)
if ((Instr(1, oDocument.title, "http 404 not found", vbTextCompare) > 0) or (Instr(1, oDocument.title, "cannot find server", vbTextCompare) > 0)) then
utilities.trace("-> embeddedWBProgressChange 'Page not found'")
else
utilities.trace("-> embeddedWBProgressChange Page loaded")
end if
gURLPrecossed = true
else
utilities.trace("-> embeddedWBProgressChange 'No handle'")
end if
set oDocument = nothing
end if
utilities.trace("<- embeddedWBProgressChange")
End Sub
Hope this helps.
Regards, Advansys SupportPosts:
821 | Registered: February 19, 2006