Edit in List Modification

This article contains the following topics:
casm1401
This article contains the following topics:
Several list forms, such as the Request and Issue lists, include an Edit in List button. When this button is available and a result set is displayed, the user can click Edit in List to replace the search filter with a small edit form. The edit form allows the user to update records directly on the list form. The user can even update everything selected in the list by placing the desired new data in the edit form and clicking Change All.
Editing list data involves no communication with the server until the user clicks Save. When the user clicks Save, all the updates (marked by yellow highlights on the form) are sent to the server, which applies all the changes in a single operation, returning a status message and redisplaying the list.
You can modify this feature by controlling whether the Edit in List button is available on a particular list form, and by controlling the fields that appear in the edit form displayed when the user clicks Edit in List.
To place an Edit in List button on a list form, including the following statement somewhere in the <HEAD> section of the form:
<SCRIPT LANGUAGE="JavaScript" SRC=$CAisd/CAisd/list_edit.js></SCRIPT>
Simply adding this statement puts the button on the form. However, the button is disabled unless JavaScript statements specifying the contents of the edit form are also included in the form. These statements must be placed immediately prior to the results set specification, and have the following format:
Statements
Comments
startListEdit(_search_filter);
Specify exactly as shown
listEditStartRow();
Specify exactly as shown
listEditField("attr"[, "hdr"]);
Specify zero or more
listEditReadonly("attr[", "hdr"]);
Specify zero or more
endListEdit();
Specify exactly as shown
The endListEdit() statement must be followed by the ResultSet() statement that begins the results set. You specify the fields in the edit form and their sequence on the form by coding one or more listEditReadonly() or listEditField() statements.
startListEdit( _search_filter )
This statement begins the list edit form. It must be coded exactly as
startListEdit( _search_filter );
.
listEditStartRow()
This statement begins a new row of fields on the list edit form. It must be coded exactly as
listEditStartRow();
. You must place a listEditStartRow() statement immediately after the startListEdit() statement. You can optionally include additional listEditStartRow() statements among the listEditField() and listEditReadonly() statements that specify the fields on the form.
listEditField(attr_name ,hdr )
This statement specifies an attribute to be included on the list edit form.
  • attr_name
    Specifies the name of the attribute to be included in the edit form (including dots, if appropriate). All attributes specified for a list edit form must also be in the results set. The
    attr_name
    specified must be identical to that specified in the IsWrite or IsCol macros that adds the attribute to the results set.
    The attribute appears on the edit form in the same format that it appears in the search filter. If the attribute is not in the search filter, it is edited in a 20-character text box.
    attr_name
    is a required argument.
  • hdr
    Specifies the text of the header on the field in the edit form. This argument is optional; if omitted, the header text is taken from the search filter. If hdr is omitted and the attribute is not in the search filter entry for attr_name, the header text defaults to the attribute name surrounded by question marks.
listEditReadonly(attr_name ,hdr )
This statement specifies a non-editable attribute to be included on the list edit form. Its arguments have the same significance as those for listEditField().
endListEdit()
This statement ends the list edit form. It must be coded exactly as
endListEdit();
.