To continue with this content, please log in with your Data Access ID or create a new account.
Cancel Data Access ID
You may not be authorized to see this content. Please contact Data Access Europe for more information.
Cancel Data Access Europe
You are not authorized to see this content.
Cancel Data Access Europe
Next lesson:
WebColumnCheckbox
Cancel

Getting to know the Web Controls

Lesson 6 - WebColumnButton

The WebColumnButton is an object, used to add a button in a WebiLst or WebGrid object. The easiest way to implement a WebColumnButton is adding a single static button. Implementing the Onclick event is the only thing you need to do, to make it work. It’s also possible to generate one or multiple buttons dynamically in the same column with the OnDefineButtons and AddButton procedures. Let me show you how this works in the next example.


DEMONSTRATION

  • This example demonstrates a web view containing a data dictionary and a WebList whose rows and columns are populated from the data dictionary.
  • The WebList is augmented with the OnLoad event to ‘seed’ the data when it is loaded for the first time.
  • First let me show you how to create a single button with only the OnClick event implemented. In this event the Field_Current_Value of the data dictionary can be used to get the data from any column in the current row.
  • Now let’s take a look at how to create buttons dynamically. 
  • In this case we implement the OnDefineButtons procedure.
  • In this procedure we can add a button with the AddButton procedure. We first create the edit button. This button is always visible. The first parameter of the AddButton procedure is the ID of the button. As you can see the Delete button is only added when the current customer is active and the activate button is only added when the customer is inactive.
  • In the OnClick event, in this case, we need to know which button is clicked. This can be done by checking the sButton parameter. This parameter is filled with the ID of the button. The edit button can navigate to a zoom view. The delete button can set the customer to deleted and the active button can activate the customer.
  • As you can see, adding buttons in a WebList or a WebGrid, with the the OnClick event is easy to implement.