BUI logo DWC logo BBjWebManager::removeAttribute

Description

In BBj 22.03 and higher, this method removes a specified attribute from the selected element.

Note:

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

Syntax

Return Value Method
Void removeAttribute(String attribute)
void removeAttribute(String attribute, String selector)

Parameters

Parameter Description
attribute Specifies an attribute to be removed from the selected element.
selector By default, removeAttribute applies to the document element on the web page. If a selector is specified, it selects a descendant element within the document to set this attribute. If a specified selector doesn't return any elements, the default document element is used.

Return Value

None.

Remarks

This functionality is primarily intended for setting low-level BUI element attributes or DWC component attributes. When running in GUI, the attributes do not affect the control itself, but may be used by the developer.

Example

rem ' BBjWebManager::removeAttribute

attribute$ = "lang"
value$ = "en-US"
selector$ = ""

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

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

status! = window!.addStatusBar(99)

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

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

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

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

getAttribute! = window!.addButton(2,100,225,475,25,"getAttribute",$$)
getAttribute!.setCallback(getAttribute!.ON_BUTTON_PUSH,"getAttribute")

hasAttribute! = window!.addButton(3,100,275,475,25,"hasAttribute",$$)
hasAttribute!.setCallback(hasAttribute!.ON_BUTTON_PUSH,"hasAttribute")

removeAttribute! = window!.addButton(4,100,325,475,25,"removeAttribute",$$)
removeAttribute!.setCallback(hasAttribute!.ON_BUTTON_PUSH,"removeAttribute")

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()
  attribute!.setSize(width-125,25)
  value!.setSize(width-125,25)
  selector!.setSize(width-125,25)
  setAttribute!.setSize(width-125,25)
  getAttribute!.setSize(width-125,25)
  hasAttribute!.setSize(width-125,25)
  removeAttribute!.setSize(width-125,25)
return

setAttribute:
  attribute$ = attribute!.getText()
  value$ = value!.getText()
  selector$ = selector!.getText()
  status$ = "setAttribute "+attribute$+" = "+value$
  browser!.setAttribute(attribute$, value$, selector$)
  status!.setText(status$)
return

getAttribute:
  attribute$ = attribute!.getText()
  selector$ = selector!.getText()
  value$ = browser!.getAttribute(attribute$, selector$)
  status$ = "getAttribute "+attribute$+" = "+value$
  status!.setText(status$)
return

hasAttribute:
  attribute$ = attribute!.getText()
  selector$ = selector!.getText()
  has! = browser!.hasAttribute(attribute$, selector$)
  status$ = "hasAttribute "+attribute$+" = "+Boolean.toString(has!)
  status!.setText(status$)
return

removeAttribute:
  attribute$ = attribute!.getText()
  selector$ = selector!.getText()
  status$ = "removeAttribute "+attribute$
  browser!.removeAttribute(attribute$, selector$)
  status!.setText(status$)
return

See Also

BBjAPI

BBjSysGui

BBjWindow

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