Advansys Home Page

Return to the Forum Home
 Post New TopicNote: Polls are considered new topics.  If you post a poll, it will be created as a new subject in this forum, not as a reply within this topic.Topic Replies: PopIt!Post A Reply
MyPop™ | register | search | faq | forum home


PreviousGo to the next oldest topic in this forum Go to the next newest topic in this forumNext
 Advansys Support Forums » Advansys Formativ » Creating Solutions with Formativ » Syntax for webbrowser events

Rating:   Not yet rated
Author Topic:   Syntax for webbrowser events
alivingston
Member
Describes the mood or content of the topic posted Click Here to See the Profile for alivingston   Reply With QuoteEdit or Delete MessageReport This Post
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
Support 3
Advansys Support Team
Describes the mood or content of the topic posted Click Here to See the Profile for Support 3   Reply With QuoteEdit or Delete MessageReport This Post
Formativ use the TWebBrowser. If you have Delphi available then see the EmbeddedWB in Internet palette. The URL below shows some common methods:
http://www.cryer.co.uk/brian/delphi/twebbrowser/twebbrowser_methods.htm

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 Support

Posts: 821 | Registered: February 19, 2006
alivingston
Member
Describes the mood or content of the topic posted Click Here to See the Profile for alivingston   Reply With QuoteEdit or Delete MessageReport This Post
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
Support 3
Advansys Support Team
Describes the mood or content of the topic posted Click Here to See the Profile for Support 3   Reply With QuoteEdit or Delete MessageReport This Post
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 Support

Posts: 821 | Registered: February 19, 2006
Support 3
Advansys Support Team
Describes the mood or content of the topic posted Click Here to See the Profile for Support 3   Reply With QuoteEdit or Delete MessageReport This Post
I have tested with Formativ Creator 2.0.1 and it works fine. We have sent you an example Applet directly.

Regards,
Advansys Support

Posts: 821 | Registered: February 19, 2006
ctaleck
Member
Describes the mood or content of the topic posted Click Here to See the Profile for ctaleck   Reply With QuoteEdit or Delete MessageReport This Post
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
Support 3
Advansys Support Team
Describes the mood or content of the topic posted Click Here to See the Profile for Support 3   Reply With QuoteEdit or Delete MessageReport This Post
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.

Note:
- Utilities.IHTMLDocumentFromViewHandle: See Formativ Language Guide for more information. This method return an instance of the IHTMLDocument2 interface obtained from the window.
- IHTMLDocument2 : http://msdn.microsoft.com/en-us/library/aa752574(VS.85).aspx
- Debugging Applet: http://advansys.atinfopop.com/4/OpenTopic?a=tpc&s=7534089931&f=5634089931&m=9151084651&r=9151084651#9151084651

  
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 Support

Posts: 821 | Registered: February 19, 2006

All times are
Post New TopicNote: Polls are considered new topics.  If you post a poll, it will be created as a new subject in this forum, not as a reply within this topic.Post A Reply
Print Page
Printable
Email a Friend
Email a Friend
Topic Replies: PopIt!
PopIt!
MyPop™
MyPop™
Contacts
Contacts
Administrative Links:
Close Topic
Close
Manage Topic
Manage
Delete Topic
Delete
Admin Options
PreviousGo to the next oldest topic in this forum Go to the next newest topic in this forumNext

Rate Topic:

Hop To:

© Advansys Pty Limited 2005.

OpenTopic 3.1.0