BBjPopupMenu::getUserData

Description

In BBj 3.01 and higher, this method retrieves user data associated with the BBjPopupMenu using the method setUserData(). If setUserData() was not previously called on the BBjPopupMenu, then getUserData returns null.

Syntax

Return Value

Method

Object

getUserData()

Parameters

None.

Return Value

Returns the object that was set with setUserData(), or null if setUserData() was not called.

Remarks

None.

Example

rem ' BBjPopupMenu::getUserData

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(100,100,200,200,"BBjPopupMenu",$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
button! = window!.addButton(1,50,50,100,25,"Button")
button!.setCallback(button!.ON_BUTTON_PUSH,"event")
PopupMenu! = Button!.addPopupMenu()
Item1! = PopupMenu!.addMenuItem(-201,"Item 1")
Item1!.setCallback(Item1!.ON_POPUP_ITEM_SELECT,"popup")
Item2! = PopupMenu!.addMenuItem(-202,"Item 2")
Item2!.setCallback(Item2!.ON_POPUP_ITEM_SELECT,"popup")
msg$ = "getUserData = "+str(PopupMenu!.getUserData())
hashMap! = new java.util.HashMap()
hashMap!.put("username","user")
hashMap!.put("password","xyzzy")
PopupMenu!.setUserData(hashMap!)
msg$ = msg$ + $0a$ + "getUserData = "+str(PopupMenu!.getUserData())
print msg$
i = msgbox(msg$,0,"getUserData")
process_events

eoj:
release

event:
    event! = sysgui!.getLastEvent()
    i = msgbox(event!.getControl().getText(),0,event!.getEventName())
return

popup:
    event! = sysgui!.getLastEvent()
    i = msgbox(event!.getMenuItem().getText(),0,event!.getEventName())
return

See Also

BBjAPI

BBjWindow Methods

Object Variables

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