BBjHtmlView::setUrl

Description

In BBj 7.0 and higher, this method sets the URL associated with this BBjHtmlView.

Syntax

Return Value

Method

void

setUrl(string url)

void

setUrl(string url, boolean reload)

Parameters

Variable

Description

url

The URL the BBjHtmlView control will load.

reload

Boolean value specifying whether this URL should be reloaded. This may be necessary if this URL has been previously loaded with different content.

Return Value

None.

Remarks

Sets the name of current URL of the BBjHtmlView control.

Example

REM Add a html view control to a window

REM Obtain the instance of the BBjAPI object
LET myAPI!=BBjAPI()

REM Open the SysGui device
SYSGUI=UNT
OPEN (SYSGUI) "X0"

REM Obtain the instance of the BBjSysGui object
LET mySysGui!=myAPI!.getSysGui()

REM Set addWindow param values
X=10
Y=10
WIDTH=800
HEIGHT=600
TITLE$="BBj Window"

REM Set the current context
mySysGui!.setContext(0)

REM Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$)

REM Add a static text control on the window
myHtmlView! = myWindow!.addHtmlView(101,50,50,700,500,"<html><body>hello world!</body></html>",$0000$)

myHtmlView!.setUrl("http://www.google.com")
myMessage! = myWindow!.addStaticText(102,50,10,700,30,"messages")
REM Register the CALLBACK routines
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())
CALLBACK(ON_HYPERLINK_ENTER, HYPERLINK_ENTER, mySysGui!.getContext(), 101)
CALLBACK(ON_HYPERLINK_EXIT, HYPERLINK_EXIT, mySysGui!.getContext(), 101)
CALLBACK(ON_HYPERLINK_ACTIVATE, HYPERLINK_ACTIVATE, mySysGui!.getContext(), 101)

REM Process Events
PROCESS_EVENTS
HYPERLINK_ENTER:
myMessage!.setText("Enter " + mySysGui!.getLastEvent().getUrl())
return
HYPERLINK_EXIT:
myMessage!.setText("Exit " + mySysGui!.getLastEvent().getUrl())
return

HYPERLINK_ACTIVATE:
myMessage!.setText("Activate " + mySysGui!.getLastEvent().getUrl())
return
REM Callback routine called when the user closes the application window
APP_CLOSE:
RELEASE

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.