Expand my Community achievements bar.

drop-down concatenated item text

Avatar

Level 2

My form is bound to an XSD datasource, containing a simple person dropdown.

The person first and last name is seperated, but i would like to concatenate both in the label of the dropdown list.

The sample XML:

...

<waarnemers>
     <id>380</id>
      <actief>true</actief>
     <persoon>
          <id>3030</id>
          <naam>Van Den Broeck</naam>
          <voornaam>Luc</voornaam>
     </persoon>
</waarnemers>

...

The list items binding:

Items = $record.waarnemers[*]

Item text = ?voornaam + naam?

Item value = id

I have tried

     concat(persoon.voornaam, " ", persoon.naam)

     persoon.voornaam + " " + persoon.naam

     persoon.voornaam persoon.naam

Resulting in either an invalid SOM expression error or an empty list.

How can I concatenate both fields in the item text binding property??

2 Replies

Avatar

Former Community Member

You will not be able to write an expression combining the two nodes of the xml together into a single bind expression. You will have to write javascript to populate the DDlist after adding those two names together without binding it directly.

Paul

Avatar

Level 2

Thanks Paul.

The thing I learned up to now is that it's better to adjust the XML source to the form and not the form to an existing data structure.