I have an arraList inside a javascript
.I want to get that arrayList to iterate inside html
<c:forEach>
.How can I do this. I can get this arrayList to a <h:outputText>
but I want to iterate the list.
My javascript
arraList is like this
<script>
topCategory = new Array();
topCategory.push("one");
topCategory.push("two");
topCategory.push("threee");
topCategory.push("four");
</script>
I need to iterate this topCategory
inside a html
<c:forEach>
for ex:
<script>
topCategory = new Array();
topCategory.push("one");
topCategory.push("two");
topCategory.push("threee");
topCategory.push("four");
then this list should be iterated inside a
<table width="100%">
<tr>
<td rowspan="2" width="20%">
<c:forEach items="#{topCategory}" var="cat">
<p:commandButton value="#{cat}"/>
</c:forEach>
</td>
</tr>