Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Second Web Browser not Displaying
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00637335
Message ID:
00638536
Views:
22
>Nick,
>
>Are you getting an error? How are you creating oBrowser1 and 2? You should not call the Refresh() method of the browser control, and in fact you should put a NODEFAULT in the Refresh() method of the browser controls to prevent runtime errors.
>
>I dropped two browsers on a form, and set this as the BeforeNavigate2() method:
>
>
LPARAMETERS pdisp, url, flags, targetframename, postdata, headers, cancel
>
>thisform.oBrowser2.Navigate( url, flags )
>
>cancel = ! thisform.MaxButton && will cause the second and subsequent link clicks to open in the other browser only
>thisform.MaxButton = .f.
>
>
>I drop an html file onto oBrowser1 and then click the links in it and the oBrowser2 shows the other pages.
>
>>I have a form that has 2 web browsers (oBrowser1 and oBrowser2). First of all when I run my form, oBrowser2 doesn't showup on the screen. Second, I am running a code from oBrowser1.BeforeNavigate2 that will control what is displayed in oBrowser2. The code is as follows:
>>
>>
>>*oBrowser1.BeforeNavigate2
>>    With ThisForm.oBrowser2
>>      .Navigate2('file://'+sys(5)+curdir()+this.oBrowser2)
>>      .refresh()
>>    Endwith
>>
>>
>>
>>
>>Does anyone know if I can do the above where 2 browser can exist at same time and one browser can issue commands to another browser?

Thanks for replying back. Your Idea worked when I passed the path location of the jpg file, however when I pass a html file through the url it doesn't work. the jpg display to big so I am trying to pass html file using table formating (thanks to Cetin Basoz idea) to url as follows:
*obrowser1.beforenavigate2
    This.HTMLFile2 = sys(2015)+'.htm'

    Set textmerge on
    Set textmerge to (this.HTMLFile2) noshow
    * Initialize lcHTML
		\<HTML><BODY><TABLE border=1 width=50>
		\<TR>
		\<TD><A href="<<trans(recno())>>"><img border="0" src="<<trim(chrtran(ImagePath,'\','/'))>>" width=85 height=100></A></TD>
		\</TR>
		\</TABLE></BODY></HTML>
    Set textmerge to
    Set textmerge off
    lcHTML2=FileToStr(this.HTMLFile2)
      
	thisform.oBrowser2.Navigate( 'file://'+sys(5)+curdir()+this.HTMLFile2, flags )
I know this should work because I am basically doing the same in my form1.init to make picture come up on obrowser1 as follows:
LOCAL lk
WITH thisform
*by cetin bozin	
    Local lnImages, lnPerrow, lnCurrent
    lnImages = adir(arrImages,'myimages\*.jpg')
    *You'd use a table let's simulate it

    Create cursor myImages (ImagePath c(50),FirstName c(12), LastName c(12))

    For ix=1 to lnImages
      	Insert into myImages values ;
        	(CURDIR()+'myimages\'+arrImages[ix,1],'FirstName'+trans(ix),'LastName'+trans(ix))
    Endfor
    lnPerRow = 5 && How many would we show on a line
    lnCurrent = 0 && Do not use recno() thinking it might be ordered on an index
    This.HTMLFile = sys(2015)+'.htm'

    Set textmerge on
    Set textmerge to (this.HTMLFile) noshow
    * Initialize lcHTML
		\<HTML><BODY><TABLE border=1 width=100>
    Select myImages
    Scan
      lnCurrent = lnCurrent+1
      If (lnCurrent-1)%lnPerRow=0
        If lnCurrent>1
		\</TR>
        Endif
		\<TR>
      ENDIF
		\<TD><A href="<<trans(recno())>>"><img border="0" src="<<trim(chrtran(ImagePath,'\','/'))>>" width=85 height=100></A></TD>
    Endscan
		\</TR>
		\</TABLE></BODY></HTML>
    Set textmerge to
    Set textmerge off
    lcHTML=FileToStr(this.HTMLFile)
    With ThisForm.obrowser1
      .Navigate2('file://'+sys(5)+curdir()+this.HTMLFile)
      Do while .ReadyState # 4 && Wait for ready state
      Enddo
    ENDWITH
 ENDWITH
When They click on picture in obrowser1, I want that picture to show up in obrowser2 displaying a larger picture. Thanks for the input.



NIck Patel
Previous
Reply
Map
View

Click here to load this message in the networking platform