Occurs when the user clicks a button inside a DataWindow object.
Argument |
Description |
---|---|
sender |
Object. The source of the event. |
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 DataWindow client control
There are no special outcomes for this event. The only code is:
0 Continue processing
In DataWindow Designer, you can add buttons to a DataWindow with either a predefined action, such as Update or Retrieve, or a user-defined action. If you use a predefined action, the code to perform the action is provided for you. If you select User-Defined (the default) from the Action list in the DataWindow painter, you need to code a ButtonClicked event for the button.
ButtonClicked fires only for buttons with the UserDefined action. Other buttons cause the page to be reloaded from the server.
The ButtonClicked event executes code after the action assigned to the button has occurred.
This event is fired only if you have not set SuppressEventProcessing to True for the button:
If SuppressEventProcessing is True, only the Clicked event and the action assigned to the button are executed when the button is clicked.
If SuppressEventProcessing is False, 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.
Suppose you add two buttons named b_button1 and b_button2 to a DataWindow object in the DataWindow painter. You can add a ButtonClicked event handler to the Web DataWindow client control in .NET to perform a different action depending on which button was clicked. In the Properties window for the WebDataWindow control, click on the ClientEventButtonClicked property, select Add a New Event Handler, and add some code:
if (buttonName=="b_button1"){ alert("Button 1 Clicked!"); } if (buttonName=="b_button2"){ alert("Button 2 Clicked!"); }