DWC logoBBjControl::setSlot

Description

In BBj 24.11 and higher, this method moves a child BBjControl into a parent BBjControl that's assumed to be a web component. If a non-blank slot name is specified, the child BBjControl is placed in the specified slot within the parent BBjControl.

Syntax

Return Value Method
void setSlot(BBjControl control)
void setSlot(String slot, BBjControl control)

Parameters

Parameter Description
control BBjControl to be added to this BBjControl.
slot Name of the slot within this BBjControl to place the BBjControl.

Return Value

None.

Remarks

This method is only meaningful in the DWC client; it's ignored in all other environments.

If no slot string is specified, or is specified as "", the specified control is added to the default slot.

When an absolutely positioned BBjControl is moved into a parent BBjControl, the following CSS properties are cleared from the child:

To have the top level component control its own sizing, you might also choose to clear the width and height values that were set in the BBjControl creation:

control!.setStyle("width","")

control!.setStyle("height","")

If an absolutely positioned BBjControl is created with the initially invisible flag ($0010$), the resulting CSS property of display:none is cleared when the BBjControl is added to a parent control.

Example

rem ' BBjControl::setSlot

rem ' https://dwc.style/docs/#/dwc/BBjButton

sysgui! = bbjapi().openSysGui("X0")
window! = sysgui!.addWindow(25,25,500,200,"BBjControl::setSlot",$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")

button! = window!.addButton(101,25,25,450,50,"",$$)
button!.setText(str(button!.getProperty("tagName")+" "+str(button!)))
icon! = window!.addWebComponent("dwc-icon")
icon!.setAttribute("name","bell")
button!.setSlot("prefix",icon!)

dwc_button! = window!.addWebComponent(103,25,100,450,50,"dwc-button")
dwc_button!.setText(str(dwc_button!.getProperty("tagName")+" "+str(dwc_button!)))
dwc_icon! = window!.addWebComponent("dwc-icon")
dwc_icon!.setAttribute("name","bell")
dwc_button!.setSlot("prefix",dwc_icon!)

process_events

eoj:
release

ClosedVersion History

  • BBj 24.11: BBjControl::setSlot added.

See Also

BBjWebcomponent::setSlot

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