NOTE: For Document Edit widgets on grid panes, see below.

The widget itself can have a title. At the right side of the title bar is the Upload button. It allows a document to be uploaded to the database to replace the current document, if any. Multiple files are not allowed. Files can also be dragged and dropped onto the widget to upload them.
NOTE: To permanently store the uploaded document, select at the top of the pane.
Button Visibility
•If the document is not read-only, the appropriate privileges are in place, and the current document revision is not locked, the Upload button is available. •If the widget is managing a related document, the Delete button is visible. •If the Delete button is visible, it is always disabled if more than one revision exists on the document. In this case, navigate to the document itself to delete it. In the body of the document edit widget, the document icon is followed by the Download button. The Download button downloads the specified file to the desired storage location as determined by browser settings. It is not available if no document has been uploaded.
If an upload has been done but the button has not yet been used to permanently store the document, some document edit widgets may display an error message saying that outstanding changes should be saved or discarded.
To the right of the Download button is the file name, which can be changed (256 characters maximum) if:
•The document is not read-only •The appropriate privileges are in place.
Last is the file extension, which cannot be changed here.
The document edit widget has a different appearance, depending on what is happening to the document with which it is associated. The following six different states can be encountered:
State 1. New document with nothing uploaded:

The state before a document exists. The Title (if configured) appears in the title bar, as does the Upload button. The Delete button, if applicable, is visible but is not available (there’s nothing to delete yet). Because there is no document, the thumbnail image and Download button are not displayed. The file name is not editable, and the file extension is not yet visible.
Selecting Upload opens the browser's standard File Open dialog, allowing a file to be uploaded.
When a file is chosen and OK is selected in the File Open dialog, the file name and file extension are validated (only certain file types are allowed). If they pass validation, they are placed into the appropriate places. Then the widget will enter State 2. If you cancel in the File Open window, nothing changes and you are back at the beginning.
State 2. Uploading the first new document:

In this example, the file name and the extension have been filled in by the File Open dialog. That file is currently being uploaded, as the progress bar and upload statistics indicate — they occupy the space where the thumbnail and Download button usually appear.
The file name can be modified during the upload, if necessary. The Upload (and, if applicable, Delete) buttons are not available while the upload is in progress.
If the upload succeeds, the widget enters State 3. If an error occurs during the upload, the widget is outlined in red and a pop-up message appears.
State 3. The first new document has been uploaded but not yet saved:

The upload of the new document has succeeded, and is now in the "holding" area, but it has not yet been saved to the database. The thumbnails and image information have been produced, so the thumbnail (or file extension icon) can be displayed instead of the progress bar. The Download button is available. As before, the file name can be modified.
Two options are available:
•Select Upload again to open the File Open dialog (just as in State 1) •Select OK to upload the new file. The displayed file name and extension are replaced with the name and extension of the new file.
If the upload succeeds, the previously uploaded document is discarded in favor of the new one. If the user cancels in the File Open dialog the originally uploaded document still exists in the holding area.
Select at the top of the pane. Standard Save processing occurs, and assuming the file name has not been removed, the document is created.
•If no valid file name has been entered, a numerical one is provided. •If no valid document has been provided, the widget is outlined in red and a pop-up error message appears. When the save operation completes successfully the widget enters State 4.
NOTE: Navigating away from this page before saving causes a warning that pending outstanding changes exist. Accept or discard an uploaded document as needed.
State 4. A saved document exists:

The document exists in the database. The appropriate thumbnail image appears at the left, followed by the Download button. If the widget is not read-only, the file name can be changed and the Upload button is available. The Delete button, if applicable, is available depending on security permissions).
The Download button presents a standard File Save dialog, where a file path can be chosen for the current version of the document to be saved to the local disk.
The Upload button performs the identical function that it did in State 1, except that the widget will enter State 5 instead of State 2 (and State 6 instead of State 3).
Selecting the Save button at the top of the presentation causes standard Save processing to occur. Assuming a valid file name has been provided, the document is updated with the new file name.
NOTE: Navigating away from this page before saving causes a warning that pending outstanding changes exist if the file name was changed. Accept or discard an uploaded document as needed.
The Delete button is used to delete the document. Selecting Delete causes the widget to enter State 1.
State 5. Uploading changes to an existing document:

The same as State 2 except that successful completion leads to State 6 rather than to State 3. The name taken from the file that is being uploaded replaces the existing base name and extension.
State 6. Uploaded changes to an existing document that have not been saved yet:

The same as State 3. Selecting Delete places this widget into State 1. NOTE: The file name and possibly the extension may have changed, as they were set to the file name chosen by the user in the File Open dialog in State 4. The Delete button (if applicable) is not available in the following situations:
•If there are multiple revisions of the document. •If security privileges to delete the document aren't in place. •If the widget is read-only.
When the Document Edit widget appears on a grid pane, it does not have a Delete button. That functionality is handled by deleting the row using the standard controls on the grid.
•The Upload button is only visible when the user is editing the row in-line (not in a pop-up edit window). •The Upload button is not available while the upload is occurring.
|