Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Scout/HowTo/3.9/Double click a table row to show a form"

< Scout‎ | HowTo‎ | 3.9
m
m (typo)
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
 
This how-to describes how to add a double click action to a table row.  
 
This how-to describes how to add a double click action to a table row.  
  
= Steps  =
+
== Using a default menu ==
 +
#Navigate to the table with the Scout SDK
 +
#Open the Default Menu dropdown at the Scout Object Properties and select the menu you'd like to have executed on a double click.<br>[[Image:DefaultMenu.png]] <br>
  
The Minicrm tutorial showed how to add menus to a table to edit existing entries. This how-to describes how a double click on a table row can be used to do the same.  
+
This is the recommended and easiest way to execute a menu action on a double click or enter key press. If you don't have a menu but would like to execute code on a double click, you may use the operation execRowAction instead, as described below.
  
#Select table  
+
== Using execRowAction ==
 +
#Navigate to the table with the Scout SDK
 
#In the Scout Object Properties under Operations add the following method execRowAction()<br>[[Image:ExecRowAction.png]] <br>
 
#In the Scout Object Properties under Operations add the following method execRowAction()<br>[[Image:ExecRowAction.png]] <br>
 
#Click on the newly added method to show the source code
 
#Click on the newly added method to show the source code
#Execute the edit menu action to show the form
+
#Implement your code
  
 
   @Override
 
   @Override
 
   protected void execRowAction(ITableRow row) throws ProcessingException {
 
   protected void execRowAction(ITableRow row) throws ProcessingException {
     getMenu(EditPersonMenu.class).doAction();
+
     //Do whatever you want
 
   }
 
   }

Latest revision as of 15:07, 21 January 2014

The Scout documentation has been moved to https://eclipsescout.github.io/.

This how-to describes how to add a double click action to a table row.

Using a default menu

  1. Navigate to the table with the Scout SDK
  2. Open the Default Menu dropdown at the Scout Object Properties and select the menu you'd like to have executed on a double click.
    DefaultMenu.png

This is the recommended and easiest way to execute a menu action on a double click or enter key press. If you don't have a menu but would like to execute code on a double click, you may use the operation execRowAction instead, as described below.

Using execRowAction

  1. Navigate to the table with the Scout SDK
  2. In the Scout Object Properties under Operations add the following method execRowAction()
    ExecRowAction.png
  3. Click on the newly added method to show the source code
  4. Implement your code
  @Override
  protected void execRowAction(ITableRow row) throws ProcessingException {
    //Do whatever you want
  }

Back to the top