company logo

BrowseManyFiles - Browse many file for processing (Shift+Ctrl+B,M)

The action pops up with a file dialog for selecting any number of files from the file system. The intention of this dialog is using the file in read-only mode, i.e. one cannot enter a file name, which does not exist. Nevertheless, files can be opened later on by the application in write mode.

The results (file names) are stored one by one to the control, which is associated with the action. Since each iteration step will overwrite the previous file name in the control. Hence, the result should be evaluated in the doBeforeDataStore() event handler as shown in the example below. The handler will be called for each file name selected in the file dialog.

Since the action returns the file paths to the control's data area, the action should be called for text controls, only. When importing files into database collections or instances, a doBeforeDataStore() event handler has to be provided for processing the path. In this case, the event handler must terminate with error (true).

// OSI implementation

FUNCTION virtual int32 myClass :: doBeforeStoreData ( ) {

  if ( !text().isEmpty() )

    ; // do something with text()

  return(true); // do not process event further on

}

Notes:

When calling the action for a collection control (list, table, tree), the path for the currently selected file is also stored in text(). Creating instances in the collection, however, is a task of the event handler.