BUI logoDWC logoBBjWebManager::setMeta

Description

In BBj 22.03 and higher, this method sets a metadata element in the header of the web page.

Note:

In BBj 22.03 and higher, BBjWebManager is an alias for BBjBuiManager.

Syntax

Return Value Method

void

setMeta(String name, String content)
void setMeta(String name, String content, String attributes)
void setMeta(String name, String content, HashMap attributes)

Parameters

Parameter Description
name Specifies the metadata name.
content Specifies the metadata content.
attributes A set of attributes to be added to the metadata element. Attributes can be specified either as a string in the format "attr=value,attr=value" or as a HashMap containing key/value pairs.

Return Value

None.

Example

rem ' BBjWebManager::setMeta

name$ = "viewport"
content$ = "width=device-width,initial-scale=1,user-scalable=no,minimal-ui"
attributes$ = ""

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()

title$ = "BBjWebManager::setMeta"
window! = sysgui!.addWindow(25,25,600,225,title$,$00090083$)
window!.setCallback(window!.ON_RESIZE,"resize")
window!.setCallback(window!.ON_CLOSE,"eoj")

window!.addStaticText(101,5,25,90,25,"Name:",$8000$)
name! = window!.addEditBox(102,100,25,475,25,name$,$$)

window!.addStaticText(103,5,75,90,25,"Content:",$8000$)
content! = window!.addEditBox(104,100,75,475,25,content$,$$)

window!.addStaticText(105,5,125,90,25,"Attributes:",$8000$)
attributes! = window!.addEditBox(106,100,125,475,25,attributes$,$$)

setMeta! = window!.addButton(1,100,175,475,25,"setMeta",$$)
setMeta!.setCallback(setMeta!.ON_BUTTON_PUSH,"setMeta")

browser! = bbjapi().getWebManager(err=oops)
browser!.getUrl(err=oops)

process_events

oops:
i = msgbox("This functionality is only supported in browser environments.")

eoj:
release

resize:
    event! = sysgui!.getLastEvent()
    width = event!.getWidth()
    height = event!.getHeight()
    name!.setSize(width-125,25)
    content!.setSize(width-125,25)
    attributes!.setSize(width-125,25)
    setMeta!.setSize(width-125,25)
return

setMeta:
    name$ = name!.getText()
    content$ = content!.getText()
    attributes$ = attributes!.getText()
    browser!.setMeta(name$, content$, attributes$)
return

See Also

BBjAPI

BBjSysGui

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