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

Fix complex widget template fields resolution when several fields are used in a subwidget

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.3 GA
    • Fix Version/s: 5.3.1
    • Component/s: None
    • Upgrade notes:
      Hide

      complex_list_item_widget_template.xhtml should be used instead of complex_widget_template.xhtml for list items.
      empty field definition can now be omitted when doing so.

      Show
      complex_list_item_widget_template.xhtml should be used instead of complex_widget_template.xhtml for list items. empty field definition can now be omitted when doing so.

      Description

      complex template currently uses "field_0" as a value for its subwidgets.
      this is making the resolution of a second field (field_1) fail as it tries to take it resolve it from the previous "field_0" value instead of the parent widget "field_0" value (the variables are updated in the widget context).
      Using "value" instead of "field_0" in the template solves the issue ("value" is also updated at each iteration over widgets) fixes the problem.
      It makes it also possible to not provide any field information to the widget definition (for now we have to add an empty field declaration for the match to be performed).

      sample error when running into this problem (where a complex defines a first field as a boolean and the second one as a string)
      javax.el.PropertyNotFoundException: /widgets/my_widget_template_with_two_fields.xhtml @32,59 value="#

      {field_1}

      ": /widgets/complex_widget_template.xhtml @34,58 value="#

      {field_0.second_field_name}

      ": Property 'second_field_name' not found on type java.lang.Boolean

        Attachments

          Activity

            People

            • Assignee:
              atchertchian Anahide Tchertchian
              Reporter:
              atchertchian Anahide Tchertchian
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: