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

Fix concatenation of string using 2 EL expressions in text widget

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.8.0-HF03
    • Fix Version/s: 6.0-HF03, 7.1
    • Component/s: Layouts & Widgets

      Description

      So I want to concatenate first/last name in a column of a content view:

      • I add Generic widget.
      • Of type is "text"
      • I add a field and put this expression:
      #{layoutValue.data.person.first_name} #{layoutValue.data.person.last_name}
      

      So, basically: one EL, a space, then another EL

      An error thrown on the server:

      Caused by: javax.el.ELException: Error Parsing: #{widget.properties.localize ? messages[layoutValue.data.person.firstName} #{layoutValue.data.person.lastName] : layoutValue.data.person.firstName} #{layoutValue.data.person.lastName}
      . . .
      Caused by: org.jboss.el.parser.ParseException: Encountered "}" at line 1, column 66.
      Was expecting one of:
      

      Workaround: use the Java concat() String method:

      #{layoutValue.data.person.first_name.concat(" ").concat(layoutValue.data.person.last_name)}
      

        Attachments

          Activity

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: