DataTable with commandlink in JSF portlet
esraa Jun 28, 2006 12:20 PMHi all,
I've been trying to add the My faces(1.1.3) datatable in a JSF portlet in the JBoss portal(2.2.1 SP1 and I tried also 2.4 beta) , but when I add the comandLink component its action doesn't work.
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:view>
<h:form id="foo">
<%System.out.println("studies.jsp");%>
<h:dataTable id="data" var="study" value="#{studiesBack.allStudies}" preserveDataModel="true">
<h:column>
<f:facet name="header">
<h:outputText value="Code" />
</f:facet>
<h:form id="fd">
<h:commandLink id="selectedStudy" value="#{study.studieCode}" action="studyHome"
immediate="true">
<h:outputText value="#{study.studieCode}" />
</h:commandLink>
</h:form>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Titel" />
</f:facet>
<h:outputText value="#{study.titel}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Language" />
</f:facet>
<h:outputText value="#{study.sprache}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Release" />
</f:facet>
<h:outputText value="#{study.freigegeben}" />
</h:column>
</h:dataTable>
</h:form>
</f:view>
and also with tomahawk was the same result
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:view>
<h:form id="foo">
<%System.out.println("studies.jsp");%>
<t:dataTable id="data" var="study" value="#{studiesBack.allStudies}" preserveDataModel="true">
<h:column>
<f:facet name="header">
<h:outputText value="Code" />
</f:facet>
<h:form id="fd">
<t:commandLink id="selectedStudy" value="#{study.studieCode}" action="studyHome"
immediate="true">
<h:outputText value="#{study.studieCode}" />
</t:commandLink>
</h:form>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Titel" />
</f:facet>
<h:outputText value="#{study.titel}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Language" />
</f:facet>
<h:outputText value="#{study.sprache}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Release" />
</f:facet>
<h:outputText value="#{study.freigegeben}" />
</h:column>
</t:dataTable>
</h:form>
</f:view>
the result was the page redirect on itself,
I tried to add the commandLink (without dataTable) and it worked.
Note that I tried the comandLink with dataTable as a standalone webapplication and it worked fine (so it's not myfaces problem).
anyone has explaination??