File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes ui:repeat or c:forEach problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "ui:repeat or c:forEach problem" Watch "ui:repeat or c:forEach problem" New topic

ui:repeat or c:forEach problem

dimka pimka

Joined: Dec 08, 2011
Posts: 1
I just started to learn jsf, so I might ask stupid questions or confuse with my explanations, but ... I have the problem with dynamic lists on the page. JSF v.1.2_15
I have dropdown list that have 2 options. Depends on the option it supposed to show the table with 24 or 27 rows. I would like to do some validation and highlight the exact element if the validation failed. As far as I understand, I need to generated the component with unique ID. For this purpose I used c:forEach

But the problem occurs when I am firstly selecting the table with 27 components and after that I am choosing the list with 24 components. I am getting something like:
/WEB-INF/content/customizedFieldsListContents.xhtml @78,79 value="#{customizedFields.width}": Target Unreachable, identifier 'customizedFields' resolved to null
I tried to put
but nothing changed.

After that I tried to use ui:repeat but the problem is that in JSF < v2 they do not have varStatus implementation.

Is there any proper way to solve my problem? Or any workaround?
I agree. Here's the link:
subject: ui:repeat or c:forEach problem
It's not a secret anymore!