13
rated 0 times
[
16]
[
3]
/ answers: 1 / hits: 20045
/ 14 Years ago, wed, december 22, 2010, 12:00:00
i have populate some values using c:forEach tag. I want to get those values in my javascript.
If I click GetCtag value button, then i want to read from (c:forEach) values in javascript.
Is any other-way to retrieve the c:forEach tag value
<%@page contentType=text/html pageEncoding=UTF-8%>
<%@ taglib uri=http://java.sun.com/jsf/html prefix=h %>
<%@ taglib uri=http://java.sun.com/jsf/core prefix=f %>
<%@ taglib uri=http://richfaces.org/a4j prefix=a4j%>
<%@taglib prefix=c uri=http://java.sun.com/jsp/jstl/core %>
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd>
<f:view>
<html>
<head>
<meta http-equiv=Content-Type content=text/html; charset=UTF-8>
<script type=text/javascript>
function getCTagValue(ctagObject)
{
alert(CFor Each Tag Object Value: + ctagObject);
// Here i want write code for retrieve the c:forEach tag value
}
</script>
</head>
<body>
<h:form id=cTagForm >
<c:forEach items=${cTagBean.tagList} var=ctag>
<c:out value=${ctag.name} : />
<c:out value=${ctag.age}/></br>
</c:forEach>
<a4j:commandButton id=GetCtagId value=GetCtag oncomplete=getCTagValue('#{cTagBean.tagList}')/>
</h:form>
</body>
</html>
Help me.
Thanks in advance.
More From » jsf