Binding a repeat region to a text area

Hello,

I’ve been struggling with this for a few hours and a research on the community hasn’t helped: I’m trying to bind a repeat region to a textarea, or, in other words, have a textarea display a repeat dataset.
How would one go about this?

Thanks for the help.

and what did you try so far?

It is actually very easy - just make the repeat region, give it an expression to repeat, place inside the textarea, add dynamic data binding to its value - and pick from the repeat regions data …

Yes, this is what I’ve been trying, but once inside the textarea, nothing is displayed. Would you be able to tell what I may be doing wrong based on the code below?

<textarea class="form-control" id="summernote_trail" name="es_body_trail" is="dmx-summernote"
															dmx-bind:toolbar="[['style',['style']],['font',['bold','underline','clear']],['fontname',['fontname']],['color',['color']],['para',['ul','ol','paragraph']],['table',['table']],['insert',['picture','link']],['view',['fullscreen','codeview','help']]]"><div dmx-repeat:repeat_es_trail="serverconnect_es_trail.data.ces_history_desc" dmx-html="es_body"></div></textarea>

No you can’t have HTML repeat within the texarea. You should assign a single value there only.

I’m sorry, I must be having a thick day - I’m not managing to get it to work. Is there a tutorial somewhere I can refer to, or would it be too much to ask for an example?

What is your goal actually with this?

I have a table where I store emails, a particular field of interest is a column called ‘body’.
Every time a user generates a new email, it adds a new row and therefore a new entry for the field body.
When they do this, they have a field to input the “new” body, and I want to give them a second field where all the previous body entries are listed in reverse so we can append a history of previous body entries to that particular email.
Ideally, but this is secondary, I’d like to give them the opportunity to edit the “trail”, as this field is saved with modifications in the a different column too, hence wanting to display it on a text area.

I am assuming you want a repeat in a form. I did an example in a horizontal form group and than it would look like this. It needs some styling though:

   <div class="form-group row">
            <label for="textarea1" class="col-sm-2 col-form-label">labelname</label>
            <div class="col-sm-10" dmx-repeat:rptform="sclist.data.qrydeelbedrijf.data">
                <textarea id="textarea1" class="form-control" dmx-bind:value="bedrijfsnaam"></textarea>
            </div>
        </div>
    </form>```

Hi Jacques,
thanks for the effort, however in your example you create as many text areas as entries in the repeat, I’m looking to do the opposite, have one textarea that contains and displays a repeat region.
I appreciate the help!

Ah, so you mean something like this?

Then select your form group row and add a horizontal forms > horizontal input form group.
Delete the input field and add Generators > Bootstrap 4 table generator in that location.

Not quite, something where your whole list would be inside the textarea.
In this mockup, the email trail textarea (2nd one) is what I’m trying to build - each line represent a different record:

I don’t that can be done in a textarea.

I think you find what you need in this post:

Tried it and it works in summer note to.

1 Like

That seems to be exactly what I’m looking for, thanks very much for pointing it out. My brain is too fried right now and I don’t see a full code excerpt there, but I’ll look into it tomorrow.
Thanks again.