-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ui:repeat clarification on attributes, such as offset and size #1713
Comments
Found some information here which I'll need to review:
Code |
HistoryInitially, ui:repeat had only
In JSF 2.2,
However, this was in hindsight not terribly well thought out. The primary mistake was that the Current spec
New spec proposalPrimary change:
Optional: support a negative Future spec proposalMerge TCK proposal
Thoughts? cc: @arjantijms and @tandraschko |
+1 for Faces 5 proposal with fusion of begin / end with offset / size Less things to learn, less obscure logic ... In this way it's straightforward like an old style loop with index ... |
@arjantijms @tandraschko @volosied +1 or -1 for 4.1 spec update proposal? And the support for a negative step? |
Improved spec wrt ui:repeat attributes
Fixed impl as per improved spec on ui:repeat attributes
Hi, a recent faces-dev email had discussions about changes between releases. The 4.1 proposal here for ui:repeat looks fine to me, but it would introduce breaking changes via the new behavior (exceptions), and I'm not sure if that should go into 4.1, per the guidelines set in the document:
Should this be pushed back into 5.0? @BalusC |
Ok sure. |
How about the support for a negative step?
This can be very useful at times. We now have the opportunity to implement it for 5.0. |
TODO: this isn't working, GlassFish 7 throws OSGI exception that Faces SPI cannot be higher than 5.0.0
change was projected for 4.1 but ultimately postponed to 5.0 because of the breaking nature; jakartaee/faces#1713
so whats left here? is just the backward -1 step left? |
Yes. |
@BalusC i don't see in your TCK examples above what is the expected if |
It currently throws It was just a proposal for a new feature because this was not formally/clearly supported by previous spec. See also #1713 (comment) Can we agree we should support a negative step? If so then we can adjust 5.0 spec on this and adjust TCK test to cover this. If not then we just leave it as is. Something like:
|
@melloware see above commits for example spec/impl/tck (although I think it's probably easier/clearer to say "reverse the collection" instead of "iterate backwards" and we also need to look closer at iteration status model and assert these as well in tck). If we all agree ui:repeat should support negative step then I'll go ahead and create PRs. |
There are behavior difference between Mojarra and MyFaces regarding ui:repeat.
The VLDDoc is vague, in my opinion. The main one I'm concerned about if
offset="1" size="2"
, but I would appreciate any feedback.For example:
These are just a few differences, but there are some more I've found (1). In general, the specification is vague and this has results in differences between the handling. I'm confused overall now in the proper behavior. In the simple cases of offset and size, things behave as expected. However, mixing the two produce different results.
Where does offset occur? From the begin value? From the first item in the collection? Should it be disregarded in some scenarios? What should occur if begin is a negative value?
I have similar questions for size. What does size mean? Is the simply the number of iterations to take? Or does it mean something else? Where does it start? Is size an index or a value? How does it relate to offset, begin, the first item in the collection, and the actual length of the collection? How is size different from end?
For size, the spec also mentions:
If this value is less than the actual size of the collection, a FacesException must be thrown.
but either implementation throws an exception?Thanks!
The text was updated successfully, but these errors were encountered: