Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-24002

Widgets cause data to be lost

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 7.10-HF35, 9.2, 9.3
    • Fix Version/s: QualifiedToSchedule
    • Component/s: Seam / JSF UI

      Description

      I have found an issue where multivalue complex fields may be completely erased under certain circumstances using JSF tabs and widgets.

      I have been able to replicate this behavior from 7.10 through 9.3

      Configuration:
      1. Document type Design with various fields in schema.
      1a. status - String, approvalComment - String, history - multivalue complex field (ex. history: comment-String, date-Date, user-String)
      1b. Document type extends Picture

      2. Edit Layout has all fields except for the multivalue complex field

      3. Create a new document tab , in activation set Current document has facet: Picture
      3a. In Definition, have a 2-column 1-row grid:
      3b. Insert a Container Widget with below settings:

      • Translated not checked
      • Handle Label is checked
      • Add surrounding form is not checked
      • Widget Type is container
      • Display: Block
      • Hide subwidgets labels: No
      • Foldable: Yes
      • Folded by Default: No
        3c. In the subwidgets of the container widget, there should be two rows.
      • The first is a layout widget with 'Add surrounding form' selected
      • Layout selected is a custom 'Status' layout (configuration below)
      • Layout mode: 'edit'
        3d. Second subwidget is a List widget, field is the multivalue complex field, display Table
      • all of the fields of the multivalue complex field are shown in the subwidget's subwidget

      4. Status Layout
      4a. only fill out the edit layout
      4b. Field for the status, approvalComment
      4c. Generic widget, edit the widget type to currentDocumentAction

      • Action of widget is 'ChangeStatus' user action (specified below)
      • Actions Display : Buttons
      • Add form, No
      • Use ajax actions: Not, edit the widget type to currentDocumentAction
      • Action of widget is 'ChangeStatus' user action (specified below)
      • Actions Display : Buttons
      • Add form, No
      • Use ajax actions: No

      5. Change Status User Action

      • calls automation chain ua_updateLicense which in turn calls a custom operation that adds the values from the status and approvalComment into history:status, history:comment List.

      6. Back in the document Tab, the other widget will be a Toggleable Document Form. This will display the document's Edit view which has all fields except for the history field (multivalue complex field).

      After all of this configuration, the end result is that the user can add history values using this custom form built with widgets. The issue is that when we edit metadata in the Toggleable Document Form (this contains all of the other metadata of the document), on save, everything in history is deleted. This is verifiable by inspecting the JSON of the document.

      Variations

      • If we change history to no longer be a multivalue field and only complex, when metadata is updated and saved, there are no observable issues
      • If we add the history field into the Status layout instead of as a separate widget in the Tab widget, there are no longer any observable issues.

      I know this is a lot of configuration up front and I am able to demo this behavior live if necessary.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jaldama Jackie Aldama
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: