1
0
-1

Hi team,

 i have to feed value to text display from data field. data field will have multiple values, I need those values should display in the multiple lines, but when i am feeding the value from data field to text display its showing in the same line

Note:I tried to append "\n" while adding values to data field but that doesn't working in that scenario.Please help on this thanks

    CommentAdd your comment...

    4 answers

    1.  
      2
      1
      0

      Adding markup in the text value of the data field and then binding to it in doubly curly braces will not render it as HTML. However, you can use the whole power of Angular within the Source (markup) of the text display itself. So if your data field returns an array of strings, you can write markup in the text display like this:

       

      <div data-ng-repeat="line in data.myDataField">

        {{line}}

      </div>

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi,

        Following on from Tim's example, try these steps in your form:

        1. Add a Data Field - call it Lines
        2. Add a Form Load Rule - enter this code: 
          data.lines = ['One','Two','Three'];
        3. Add a Text Display field - enter this code in the content editor, making sure you are in 'Source' mode:
          <div data-ng-repeat="line in data.lines"><p>{{line}}</p></div>

        When you edit your Text Display content, you must be in Source mode, otherwise your HTML markup will be converted to text:

        (Access the Text Display field content editor by clicking the edit icon):

          CommentAdd your comment...
        1.  
          1
          0
          -1

          Just hit Enter or Shift-enter in the editor. No need to mark up.

            CommentAdd your comment...
          1.  
            1
            0
            -1

            Hi,

            If you bring up the editor for your Text Display field, enter some text using the return key to start additional lines, and click the 'Source' button, you can see the text editor uses HTML <p> elements for paragraphs.

            1. surendarvel

              Thanks for the answer, but my need is i have the values in Data field ex :{ one, two, three}, this need to display in a single text field as below

              one

              two

              three

               

              Thanks

              suren

            CommentAdd your comment...