eva/3 Application BuilderDeveloping Additional eva/3 ComponentsUser CommandsExamples for Tasks of an CommandExamples for database commands 

Put Data from a Form in a Dialog

The following example shows, how data can be read from a form into an array and after this be put in an opened dialog. The data is in three different SFormattedFields.

Example:

// Create a String [] of the size 3
String [] fields = new String[3]; 
// Gets the activeSWindow
SWindow window = EvaUtils.getActiveSWindow(); 
// Get the first SFormattedField
SFormattedField txt1 = (SFormattedField)window.getObject("txt1"); 
// Write the text of the SFormattedFields into the array
fields[0] = txt1.getText();        
// Get the second SFormattedField
SFormattedField txt2 = (SFormattedField)window.getObject("txt2"); fields[1] = txt2.getText();        
// Write the text of the SFormattedFields into the array
fields[1] = txt2.getText();        
// Get the third SFormattedField
SFormattedField txt3 = (SFormattedField)window.getObject("txt3"); 
// Write the text of the SFormattedFields into the array
fields[2] = txt3.getText(); 
try {
    // Load the Dialog
    SDialog dia = ObjectLoader.getSDialog((Window)window,String.valueOf(arg0[0]),true); 
    // Create the Dialog
    dia.afterLoading(); 
    // Get the first SFormattedField of the Dialogs
    SFormattedField field1 = (SFormattedField)dia.getObject("txt1"); 
    // Write the text from the array to the SFormattedField
    field1.setText(fields[0]); 
    // Get the second  SFormattedField of the Dialogs
    SFormattedField field2 = (SFormattedField)dia.getObject("txt2"); 
    // Write the text from the array to the SFormattedField
    field2.setText(fields[1]); 
    // Get the third SFormattedField of the Dialogs
    SFormattedField field3 = (SFormattedField)dia.getObject("txt3"); 
    // Write the text from the array to the SFormattedField
    field3.setText(fields[2]); 
    // Show the Dialog with the text set
    dia.show(); 
} catch (AccessDeniedException e) {
    e.printStackTrace();
}