0

I am currently working on a timetable-software as a project at my university. We are working with JSF.

Our software has to be dynamic (specified by our teacher) in the terms of "how many days does a work-week have" and "how long is each of those days", so we have to be dynamic in our way we display things.

I wanted to use a ui:repeat-tag with a nested ui:repeat-tag, one for the days and one for the activities of each day.

The setup would have to look a bit like this:

<ui:repeat var="weekday" value="#{timetableBean.getWeekdays()}">
    <ui:repeat var="acitivity" value="#{timetableBean.getActivitiesForWeekday(PARAMETER WEEKDAY)}">
           // OUTPUT SOMETHING
    </ui:repeat>
</ui:repeat>

My actual problem is that the variable of the weekday from the outer ui:repeat can't be used in the nested ui:repeat. I googled a lot but I could not figure out how to pass the VAR of the outer ui:repeat-tag as a param to the nested one. The "PARAM WEEKDAY" should be the actual var of the outer ui:repeat.

Does anybody have an idea? Maybe I just don't know how to use the syntax correctly here, I am just getting started.

Thanks in advance!

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Tim Hansen
  • 84
  • 2
  • 14
  • Can you please elaborate "can't" a bit more? How exactly did it fail when you just use `weekday`, exactly as you declared in `var`? – BalusC Aug 17 '14 at 10:05
  • I actually get a Nullpointer-Exception. When I put the String in hardcoded (like this: #{timtableBean.getActivitiesForWeekday('Monday')} ) I get a result. The getWeekday() - methode used in the outer ui:repeat-element also returns the weekday as a String. Edit: When getting a Nullpointer-Exception, I tried it this way: #{timtableBean.getActivitiesForWeekday(weekday)} – Tim Hansen Aug 17 '14 at 12:02
  • Which JSF impl/version? Might as well just be a bug in JSF impl/version used (if it's not a bug in your own model, which you didn't show so far, so I tend to assume that your model is okay; I hopefully that you understand that the 1st line of NPE may hint if it's a bug in your own code or in JSF impl's code). – BalusC Aug 17 '14 at 12:04

0 Answers0