Designer 10.7 | webMethods Mobile Development | Code Snippets | Configuring the SwipeButton Object
 
Configuring the SwipeButton Object
The ListView allows you to show a set of buttons when swiping left or right. You can define these buttons by adding a SwipeButton object to a TemplateAssignment object and defining properties for it as described in SwipeButton Properties. To define the action after clicking one of these buttons, you must implement the onActionButtonClicked() method in the [ViewName]ViewControllerImpl class as follows:
public void onActionButtonClicked(final int row, nUIActionButton button) {
switch (button.getId()) {
case TASK_COMPLETE_BUTTON_ID:
Toast.showToast("onActionButtonClicked: TASK_COMPLETE_BUTTON_ID");
break;
case TASK_CANCEL_BUTTON_ID:
Toast.showToast("onActionButtonClicked: TASK_CANCEL_BUTTON_ID");
break;
case PROCESS_EDIT_BUTTON_ID:
Toast.showToast("onActionButtonClicked: PROCESS_EDIT_BUTTON_ID");
break;
default:

break;
}
}
Related Topics