ButtonClicked – PB Docs 150

ButtonClicked event

Description

Occurs when the user clicks a button inside a DataWindow object.

PowerBuilder event information

Event ID: pbm_dwnbuttonclicked

Argument

Description

row

Long by value. The number of the row
the user clicked.

actionreturncode

Long by value. The value returned by
the action performed by the button.

For information about return values, see the Action DataWindow
object property.

dwo

DWObject by value. A reference to the
control within the DataWindow under the pointer when the user clicked.

Web DataWindow client control event information

Event name: ButtonClicked

Argument

Description

row

Number. The number of the row the user
clicked.

objectName

String. The name of the control within
the DataWindow under the pointer when the user clicked.

Web ActiveX event information

Event name: onButtonClick

Argument

Description

Row

Number. The number of the row the user
clicked.

ReturnCode

Number. The value returned by the action
performed by the button.

For information about return values, see the Action DataWindow
object property.

Name

String. The name of the control within
the DataWindow under the pointer when the user clicked.

Return Values

There are no special outcomes for this event. The only code
is:

  • 0 Continue processing

Usage

The ButtonClicked event executes code after the action assigned
to the button has occurred.

This event is fired only if you have not selected Suppress
Event Processing for the button.

If Suppress Event Processing is on, only the Clicked event
and the action assigned to the button are executed when the button
is clicked.

If Suppress Event Processing is off, the Clicked event and
the ButtonClicked event are fired. If the return code of the ButtonClicking
event is 0, the action assigned to the button is executed and the
ButtonClicked event is fired. If the return code of the ButtonClicking
event is 1, neither the action nor the ButtonClicked event are executed.

note.png Do not use a message box in the Clicked event

If you call the MessageBox function in
the Clicked event, the action assigned to the button is executed,
but the ButtonClicking and ButtonClicked events are not executed.

Web DataWindow

ButtonClicked fires only for buttons with the UserDefined action.
Other buttons cause the page to be reloaded from the server.

note.png Returning the row number

When you place a button in the DataWindow and use the window’s ButtonClicked
event to return the row number, you will get different results depending
on where you place the button. If the button is in the Detail band,
it returns the number of the row. If the button is in the Header
band, it returns the number of the first row displayed in the DataWindow
control. If the button is in the Summary band, it returns the number
of the final row in the list. If the button is in the Footer band,
it returns the number of the last row displayed in the DataWindow
control.

Examples

This statement in the ButtonClicked event displays
the value returned by the button’s action:

This statement in the ButtonClicked event displays
the value returned by the button’s action:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x