glassfish icon indicating copy to clipboard operation
glassfish copied to clipboard

Nested ui:repeat element miscounts

Open helper14 opened this issue 2 years ago • 9 comments

Nested ui:repeat element miscounts

Environment Details

  • GlassFish Version (and build number): glassfish-6.1.0
  • JDK version: openjdk-17.0.3+7
  • OS: Win10
  • Database:

Problem Description

A nested ui:repeat within another ui:repeat element does add 1 to the end at each loop.

Steps to reproduce

<div style="display: flex; flex-direction: row; flex-wrap: nowrap;">
    <ui:repeat begin="0" end="5" step="1" var="x">
        <div style="display: flex; flex-direction: column; flex-wrap: nowrap;">
            <ui:repeat begin="0" end="5" step="1" var="y">
                <div> [#{x}|#{y}] </div>
            </ui:repeat>
        </div>
    </ui:repeat>
</div>

output:

screenshot_nested_repeat

Minimal Example

uirepeat-example.zip

... a maven/netbeans-project. URL: http://localhost:8080/uirepeat-example/index.xhtml

Impact of Issue

helper14 avatar Jan 06 '23 08:01 helper14

Please prepare MCVE.

pzygielo avatar Jan 06 '23 10:01 pzygielo

I added a minimal example project to the bug-report. It is attached too.

Regards

On 06.01.23 11:24, Piotrek Żygieło wrote:

Please prepare MCVE https://stackoverflow.com/help/minimal-reproducible-example.

— Reply to this email directly, view it on GitHub https://github.com/eclipse-ee4j/glassfish/issues/24224#issuecomment-1373441602, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT3B7UE3UFNCZPHYHBZQM4DWQ7XF7ANCNFSM6AAAAAATS2QKYQ. You are receiving this because you authored the thread.Message ID: @.***>

helper14 avatar Jan 06 '23 10:01 helper14

I added a minimal example project

Reproduced the same with GF 7.0.0.

pzygielo avatar Jan 06 '23 11:01 pzygielo

For me it seems to be something around https://github.com/eclipse-ee4j/glassfish/blob/be8cf0734686a7f7023c4e9c4a373d341d809a1a/impl/src/main/java/com/sun/faces/facelets/component/UIRepeat.java#L99-L114

As GF integrates Mojarra - I think this issue should be transferred there, to continue discussion in the upstream. (@arjantijms @m0mus @edbratt - I'm not privileged to do that.)

pzygielo avatar Jan 06 '23 16:01 pzygielo

It looks that handling of begin, end (perhaps step as well) is incorrect.

MyFaces 3.0.2 implementation works with nested repeats with begins and ends just fine.

pzygielo avatar Jan 06 '23 17:01 pzygielo

As GF integrates Mojarra - I think this issue should be transferred there, to continue discussion in the upstream.

@arjantijms @m0mus @edbratt - maybe it was fixed in mojarra already?

pzygielo avatar Jun 10 '23 07:06 pzygielo

As GF integrates Mojarra - I think this issue should be transferred there, to continue discussion in the upstream.

@arjantijms @m0mus @edbratt - maybe it was fixed in mojarra already?

pzygielo avatar Jul 08 '23 18:07 pzygielo

I do remember something like this being addresses. @balusc

arjantijms avatar Jul 10 '23 15:07 arjantijms

Was you thinking of https://github.com/jakartaee/faces/issues/1713? Not sure if related but I haven't worked on anything else ui:repeat related recently.

BalusC avatar Jul 10 '23 16:07 BalusC

This issue has been marked as inactive and old and will be closed in 7 days if there is no further activity. If you want the issue to remain open please add a comment

github-actions[bot] avatar Jul 10 '24 00:07 github-actions[bot]

7.0.15 produces: image which I believe is fine. Magic.

pzygielo avatar Jul 10 '24 07:07 pzygielo