Skip to content

Commit

Permalink
Merge pull request #5168 from eclipse-ee4j/mojarra_issue_5150
Browse files Browse the repository at this point in the history
Mojarra issue 5150
  • Loading branch information
BalusC authored Nov 12, 2022
2 parents 31fc72a + 819dbf0 commit 53e1952
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions impl/src/main/java/com/sun/faces/facelets/component/UIRepeat.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public class UIRepeat extends UINamingContainer {

private int index = -1;

private Integer originalBegin;
private Integer originalEnd;

private Integer begin;
private Integer end;
private Integer step;
Expand Down Expand Up @@ -213,8 +216,15 @@ private DataModel getDataModel() {
if (this.model == null) {
Object val = this.getValue();
if (val == null) {
Integer begin = getBegin();
Integer end = getEnd();
if (originalBegin == null) {
originalBegin = getBegin();
}
if (originalEnd == null) {
originalEnd = getEnd();
}

Integer begin = originalBegin;
Integer end = originalEnd;

if (end == null) {
if (begin == null) {
Expand Down Expand Up @@ -1025,6 +1035,8 @@ public void restoreState(FacesContext faces, Object object) {
this.var = (String) state[5];
this.varStatus = (String) state[6];
this.value = state[7];
this.originalBegin = (Integer) state[8];
this.originalEnd = (Integer) state[9];
}

@Override
Expand All @@ -1034,7 +1046,7 @@ public Object saveState(FacesContext faces) {
if (faces == null) {
throw new NullPointerException();
}
Object[] state = new Object[8];
Object[] state = new Object[10];
state[0] = super.saveState(faces);
state[1] = this.childState;
state[2] = this.begin;
Expand All @@ -1043,6 +1055,8 @@ public Object saveState(FacesContext faces) {
state[5] = this.var;
state[6] = this.varStatus;
state[7] = this.value;
state[8] = this.originalBegin;
state[9] = this.originalEnd;
return state;
}

Expand Down

0 comments on commit 53e1952

Please sign in to comment.