Parameters for Adding RowsThese URL parameters are used:
The structure browser uses When creating a new row, if the attribute shown in a column has a schema-defined default value, that value is automatically populated in the column. However, if that column has the Default Program and Default Function settings defined, the value returned by the Default_AddNewRow or Default_ExistingRow key from the JPO overrides the schema-defined default value. The user has the option of adding the new row above or below a selected row. If the structure browser does not contain any rows, the user can still insert new rows:
See the Editing a Structured Data Page for details on how the user works with this tools. The display of these toolbar buttons is controlled by which URL parameters are passed to the structure browser:
If the indicated URL parameter is not passed, then that toolbar button does not display on the structure browser. Location of Inserted RowsWhen using
These menu commands do not work with a flat structure browser. When using these menu commands, only one row can be selected. If the user clicks the icon instead of the arrow, these rules apply:
The Column Settings for In-Line Creation/ConnectionTo enter data inline for a new object (see Add a Row for a New Object) or for connecting an existing object (see Connect an Existing Object (Lookup)), these settings for the column are used:
The Lookup Input Type and Add Input Type settings can take any of these values:
These input controls work the same as describe in In-cell Editing. As with other list boxes, if the user selects multiple values (using the control key), only one value is saved unless you define a custom JPO to process multiple values. If the autoNumber setting is defined for a column (usually a Name column), the user can select a series or manually enter a name. For structure browsers that may have different object types in a column, the OnChange Handler or OnFocus Handler settings must be used to select the appropriate autonumbering for the current row. If a column has different input controls defined for any combination of the Input Type, Add Input Type, or Lookup Input Type settings, then that column can not be used for mass update. If the input controls for these settings are all the same, then the column can be used for mass update. Add a Row for a New ObjectUsers can add a blank row to the structure browser to create a new object. This new row is equivalent to creating a new object using a create form. To support this function, the structure browser must display all columns that are defined as required on the equivalent create form. When the user adds a row, the structure browser automatically populates any fields defined with default values in the schema. In addition, the Default Program and Default Fucntion settings can be used to populate default values for new rows. The user can change any of these values as needed. After the user enters the data for the new object, the Apply button invokes the JPO:method specified by the connectionProgram URL parameter to create the object. The user can add any number of rows prior to clicking the Apply button. The page passes all newly-created rows to the JPO as input parameters.
The JPO returns a list of the created objects. If the data entered for
any row did not define a unique object (or another error occurs), the
JPO returns an error. The structure browser indicates the error (user
can see text of message by mousing over the See the JavaDocs for details of the JPO. Connect an Existing Object (Lookup)Users can also add a blank row used to load an existing object from the database. The user enters search criteria in the row, then clicks Lookup Entries. The system first validates the criteria (using the validation method defined by the OnChange Handler setting on the column), then invokes the JPO defined by the lookupJPO URL parameter passed to the structure browser. The OnChange Handler for the column is invoked with these parameters:
For the second parameter, Lookup is used for inserted rows and New is used for the normal apply function. The page passes the search criteria entered in the added rows to the
JPO as input parameters. The JPO returns the matching objects, or an
error message if more than one or no matching object was found. The structure
browser indicates the error (user can see text of message by mousing
over the If a column does not have the Lookup Input Type setting defined, the user may still enter a value although it is not used as search criteria. When the object is found, if the database value is different from the user-entered value, the cell shows as though the user edited the value: the original database value is shown in red, strikethrough text, with the value the user entered shown in bold italic text. This also applies for columns populated based on a relationship to the object (not as an attribute of that object). In addition, if a column does not have the Lookup Input Type setting defined but has the Default Program and Default Function settings defined, the value returned by the Default_AddNewRow or Default_ExistingRow key from the JPO shows as though the user had entered that value. That is, if the database value is different from the user-entered value, the database value is shown in red, strikethrough text and the user-entered value is shown in bold, italic text. Once all rows inserted using Apply Modifications to a Structure BrowserWhen the user clicks Lookup Entries, the JavaScript validation functions defined by the Validate setting is invoked with the cell value passed as the first parameter, and either lookup or new as the second parameter indicating the type of validation test -- looking for a match or creating a new object. When the user clicks the Apply button, the structure browser either:
For the applyURL, the URL can be any configurable component or custom JSP page. The newly-added and modified rows are submitted as an XML element with the parameter name data to the specified URL. The posted data can be accessed from the specified URL using request parameters. If the URL specifies a custom JSP page, that page should invoke the API emxEditableTable.refreshStructureWithOutSort() to refresh the view (see Appendix: JavaScript APIs). If an error occurs in the JSP page, the custom page should invoke the API emxEditableTable.displayValidationError(); with an XML containing the rowId and error message. See Displaying Validation Errors. When the applyURL parameter is passed, any URLs or JPOs defined by the postProcessURL or postProcessJPO URL parameters are not invoked. |