Table Repeat Issue When Repeat Children on Table Body

Wappler Version : 5.1.3 (Noticed it since 5.1.2)
Operating System : Windows 11
Server Model: Node JS
Database Type: MySQL
Hosting Type: Docker

Expected behavior

Adding a repeat children on the body of the table should output all rows.

Actual behavior

On existing tables, everything works fine (I have a lot of tables and none of them have broken).

I do need to add, this is the third level of a nested repeat. Student > Enrolments > Weekly Charges. Weekly charges being the tables I’m referring to.

On new tables, the repeat children does not work. Pictured below is a table with repeat children on tbody which is blank, underneath, the same table with the repeat on the table row tr which does output the array.

To make matters even more confusing, one tbody repeat does work for one enrolment in the whole nest. As per below.

As you can see, the top tbody repeat table is working for this one enrolment only. All other students and their subsequent enrolments do not output. Under this repeat, I do have another set of nested repeats for an old charge breakdown which was created a while back that works without a hitch.

CODE:

<!-- Tbody repeat table code -->
<tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="items" id="rp_student_newenrolcharges">
    <tr>
        <td dmx-text="classdate.formatDate(appSettings.localization_puddle_dateformat)"></td>
    </tr>
</tbody>

<!-- TR repeat table code -->
<tbody>
    <tr dmx-repeat:repeat2="items">
        <td dmx-text="classdate.formatDate(appSettings.localization_puddle_dateformat)"></td>
    </tr>
</tbody>

<!-- TBODY repeat table code for existing tables "OLD CHARGE" -->
<tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="enrolment_charges" id="rp_studentenrolcharges">
    <tr>
        <td dmx-text="classDate.formatDate(appSettings.localization_puddle_dateformat)"></td>
        ......
    </tr>
</tbody>

I hope all of this makes sense.

Experimental features is also off.

Cheers all.

This sounds much the same as my problem

I also tried normal repeats instead of the form repeats. No go.

I’d like to bump this for @Teodor, @George or @Patrick to see.

I have just found that when I’m trying to get a value from an input in a repeat (when on the Table Body), there is no way of getting the value unless I move the repeat to the table row.

Sorry but i am not sure i understand what problem/issue are reporting here exactly. What exactly the problem reported here is? Your dynamic tables don’t show data, or is it something else?

Hi Teodor,

Correct, they don’t show data when the dmx repeat is attached to the tbody element inside the table. In this configuration, I have also found that I cannot point to inputs inside the table.

This is all fixed, however, when I attach the repeat to the tr table row itself.

I have a LOT of tables and I really don’t want to have to go through and change them all.

I’m not sure how better to explain than what I have written above.

Cheers
Michael

I can’t really recreate this issue.
I made two tests locally:

  1. Repeat children added to <tbody>

code:

    <table class="table">
        <thead>
            <tr>
                <th scope="col">#</th>
                <th scope="col">Name</th>
            </tr>
        </thead>
        <tbody is="dmx-repeat" id="repeat1" dmx-bind:repeat="5">
            <tr>
                <th scope="row">{{$index}}</th>
                <td>Name {{$index}}</td>
            </tr>
        </tbody>
    </table>
  1. Repeat added to <tr>

code:

    <table class="table">
        <thead>
            <tr>
                <th scope="col">#</th>
                <th scope="col">Name</th>
            </tr>
        </thead>
        <tbody>
            <tr dmx-repeat:repeat1="5">
                <th scope="row">{{$index}}</th>
                <td>Name {{$index}}</td>
            </tr>
        </tbody>
    </table>

as you can see everything works correctly. Maybe you are just picking wrong data from your data source, that’s why you don’t see anything in your table.

These tables (enrolments) are in a parent row repeat (students). As you can see in one of my examples in the original post, one of the enrolments tables (randomly) will actually show data, however, in a sister record on the parent repeat, the enrolments don’t show for any of the other students.

Also, the case of picking data from a tbody repeat children table, assume I have a date picker in one of the cells. Outside of the table, I cannot get the data from that input using, for example, table_repeat[$index].input.value. If I use the repeat on the table row, that same line of code works.

So you are nesting dynamic tables in a repeat region and they don’t work there?
Are you 100% sure the expressions you are using for your tables are correct?

Maybe provide a link to your page where we can check what’s going on. I can’t really debug by looking at your screenshots in your first post.

Hey @Teodor,

Sorry for the late reply.

Yes, I’m using tables in a repeat region and they don’t work there. Also, when the repeat is on the table body, you cannot point to inputs that may be in the cells. Everything only works when the repeat is set on the table row.

Unfortunately I don’t have a link to the page, it’s all currently local.

Cheers
Michael