myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Andraschko <andraschko.tho...@gmail.com>
Subject Re: c:forEach issue in JSF 2
Date Wed, 01 Jul 2015 07:56:39 GMT
Which version are u using? MyFaces 2.2 fixed many c:forEach issues.

Maybe you should try to use ui:repeat instead c:forEach, too. You can
google about the differences.

2015-07-01 9:42 GMT+02:00 khush N <kbnavlani@gmail.com>:

> Hi,
>
> I am upgrading my application from JSF 1.2 to JSF 2.
>
> I am trying a below simple forEach tag but it not showing anything inside
> the loop.
>
> <table
>     id="tab${sectionId}"
>   border="0"
>   cellpadding="0"
>   cellspacing="0"
>   width="100%"
>   class="listingTable"
> >
> <c:forEach
> var="row"
> rowStatus="index"
> items="#{bean.department.userActivities}"
> >
>             <tr>
>                 <td>
>                     test
>                  </td>
>              </tr>
> </c:forEach>
> </table>
>
> The value test is not showing up. Has the c:forEach implementaion changed?
>
> I tried replacing <c:forEach> with <t:dataList> but <t:dataList> has
some
> other issue. It is rendering the content inside it. But if I have a
> component inside <t:dataList>, I am not able to assign a backing bean value
> as ID of the component. Example is as below
>
> <table
> id="tab${sectionId}"
> border="0"
> cellpadding="0"
> cellspacing="0"
> width="100%"
> class="listingTable"
> >
> <t:dataList
> var="row"
> rowIndexVar="index"
> value="#{bean.department.userActivities}"
> >
> <h:column>
> <h:outputText id="#{row.activityCode}">test1</h:outputText>
> </h:column>
> </t:dataList>
> </table>
>
> So, with <t:dataList>. I am not able to assign backing bean property as ID
> of the component. I am receiving the error
> "java.lang.IllegalArgumentException: component identifier must not be a
> zero-length String "
>
> Can anyone please help me in understanding as to why the c:forEach tag is
> not working. I have huge code which is using forEach tag. With upgrade, I
> will have to remove every forEach if it is no more supported in JSF2 :(
>
> Thanks in advance!
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message