This discussion is archived
3 Replies Latest reply: Apr 1, 2010 2:25 AM by 807574 RSS

rich:datascroller

807574 Newbie
Currently Being Moderated
I have included rich faces in myfaces-portlets its rendering properly but data scroller tag is not working when i click on next link its giving following exception :


Error rendering portlet.

javax.portlet.PortletException: Specified content type 'text/xml' is not supported.
     at org.apache.myfaces.portlet.MyFacesGenericPortlet.handleExceptionFromLifecycle(MyFacesGenericPortlet.java:310)
     at org.apache.myfaces.portlet.MyFacesGenericPortlet.facesRender(MyFacesGenericPortlet.java:502)
     at org.apache.myfaces.portlet.MyFacesGenericPortlet.doView(MyFacesGenericPortlet.java:323)
     at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:247)
     at javax.portlet.GenericPortlet.render(GenericPortlet.java:175)
     at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:208)
     at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:139)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

     Nested Exception is java.lang.IllegalArgumentException: Specified content type 'text/xml' is not supported.
     at org.apache.pluto.internal.impl.RenderResponseImpl.setContentType(RenderResponseImpl.java:126)
     at org.ajax4jsf.context.AjaxContextImpl.renderAjaxRegion(AjaxContextImpl.java:255)
     at org.ajax4jsf.context.AjaxContextImpl$2.invoke(AjaxContextImpl.java:201)
     at org.ajax4jsf.context.JsfOneOneInvoker.invokeOnComponent(JsfOneOneInvoker.java:78)
     at org.ajax4jsf.context.AjaxContextImpl.invokeOnComponent(AjaxContextImpl.java:157)
     
following is my jsp page:

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@ taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<%@ page import="javax.portlet.*" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>

<portlet:defineObjects/>

<div class="EUPortlet">

<f:view>

     <f:loadBundle basename="Language" var="msgs" />

     <h:form id="form1">
     
     <rich:column>
<h:outputText value="Shwetha"/>
</rich:column>



     <h1>
          <h:outputText id="o1" value="#{msgs.label_page_header}" /> -
          <h:outputText id="o2" value="#{msgs.label_simple_search_header}" />
     </h1>

     <div>
          <h:outputLabel id="ol3" for="input_debtor" value="#{msgs.label_debtor_parameter}" />
          <h:selectOneMenu id="input_debtor" required="true" value="#{translatorSearchBean.name}" >
               <f:selectItems id ="item001" value="#{translatorSearchBean.langs}"/>
          </h:selectOneMenu>
     </div>
     
     <div style="text-align: center">
          <h:commandButton id="c1" action="#{translatorSearchBean.clear}" value="#{msgs.button_clear}" />
          <a4j:commandButton id="c2" action="#{translatorSearchBean.search}" value="#{msgs.button_search}"/>
               
     </div>
     </h:form>

     <%@include file="/jsps/simpleSearchResult.jsp" %>
     

</f:view>

</div><!-- /EUPortlet -->

2 page:

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@ taglib prefix="a4j" uri="http://richfaces.org/a4j"%>

<div class="EUPortlet">

<h:form id="form">
     <rich:dataTable id="table"

styleClass="scrollerTable"
headerClass="standardTable_Header"
footerClass="standardTable_Header"
rowClasses="standardTable_Row1,standardTable_Row2"
columnClasses="standardTable_ColumnCentered,standardTable_ColumnCentered,standardTable_Column,standardTable_ColumnCentered"
align="center"
var="insolvency"
value="#{translatorSearchBean.translators}"
rendered="#{!empty(translatorSearchBean.translators)}"
rows="20">



<%/* Nr */%>
<rich:column id="a1" >
<f:facet name="header" >
<h:outputText id="b2" value="#{msgs.table_header_number}" />
</f:facet>
<h:outputText id="a2" value="#{insolvency.internalId}" />
</rich:column>
<%/* Nation */%>
<rich:column id="a3">
<f:facet name="header" >
<h:outputText id="a4" value="#{msgs.table_header_nation}" />
</f:facet>
<h:outputText id="a5" value="#{insolvency.nation}" />
</rich:column>
<%/* Debtor */%>
<rich:column id="a6">
<f:facet name="header" >
<h:outputText id="a7" value="#{msgs.table_header_debtor}" />
</f:facet>
     <h:outputText id="a8" value="#{insolvency.name}" rendered="false" />
     <h:commandLink id="link_detail_it" action="#{translatorSearchBean.transDetail}" >
     <f:verbatim id="v_11222">
          <h:outputText id="a22330" value="#{insolvency.name}" />
     </f:verbatim>
               </h:commandLink>

</rich:column>
<%/* Date */%>
<rich:column id="b5">
<f:facet name="header" >
<h:outputText id="a11" value="#{msgs.table_header_attr}" />
</f:facet>
<h:outputText id="a12" value="#{insolvency.attr3}" />
</rich:column>

                    <f:facet name="footer">
          <rich:datascroller id="scroll_1"
rendered="#{!empty(translatorSearchBean.translators)}"
fastStep="5"
pageIndexVar="pageIndex"
styleClass="scroller">
</rich:datascroller>
               </f:facet>
               
</rich:dataTable>


</h:form>

</div>
am i supposed to chage any thing in the portlet.xml file or in any of the config file?
plz help out in solving this
  • 1. Re: rich:datascroller
    807574 Newbie
    Currently Being Moderated
    This is because u need to put text/xml in ur portlet.xml then only it will accept.
  • 2. Re: rich:datascroller
    807574 Newbie
    Currently Being Moderated
    I am facing an issue with the h:datascroller i have a dataTable which is displaying a list of userDetails as shown below:

    Code:

    <rich:dataTable id="groupDetails" columns="1" columnClasses="dataCol1" rowClasses="odd,even" styleClass="fullWidth noBorder" onRowMouseOut="this.style.backgroundColor='#FFFFFF'" onRowMouseOver="this.style.backgroundColor='#FFE69E'" headerClass="subHeaderBg" onRowClick="this.style.backgroundColor='#D6EEFB'" rows="5" value="#{LoginAction.userDetailsList[LoginAction.selectedGroup]}" var="data">
    <rich:column id="mainData">
    <h:graphicImage styleClass="transparentBg subMenu bolderFont" value="#{data.url}"/>
    <rich:spacer styleClass="transparentBg subMenu bolderFont" width="10px"/>
    <h:outputText styleClass="transparentBg subMenu bolderFont" value="#{data.userName}"/>
    </rich:column>
    </rich:dataTable>
    <rich:datascroller id="paginationData" for="groupDetails" reRender="groupDetails,mainData" maxPages="10" page="#{dataTableScrollerBean.scrollerPage}" limitToList="true">
    </rich:datascroller>

    when i click on the page 2 the list does not get refreshed.List still holds the 1 page data.
    I even tried using the a4j:support tag for reRendering.
    Please Help..
  • 3. Re: rich:datascroller
    807574 Newbie
    Currently Being Moderated
    I found a solution.
    I placed the rich:dataTable in a h:pnaelGrid and gave reRender as the id of the h:panelGrid.This resulted in the rendering of the list according to the page selected.Below is the code changes i made.

    <h:panelGrid id="contactsTanble" styleClass="fullWidth">

    <rich:dataTable id="groupDetails" columns="1" columnClasses="dataCol1" rowClasses="odd,even" styleClass="fullWidth noBorder" onRowMouseOut="this.style.backgroundColor='#FFFFFF'" onRowMouseOver="this.style.backgroundColor='#FFE69E'" headerClass="subHeaderBg" onRowClick="this.style.backgroundColor='#D6EEFB'" rows="5" value="#{LoginAction.userDetailsList[LoginAction.selectedGroup]}" var="data">

    <rich:column id="mainData">
    <h:graphicImage styleClass="transparentBg subMenu bolderFont" value="#{data.url}"/>
    <rich:spacer styleClass="transparentBg subMenu bolderFont" width="10px"/>
    <h:outputText styleClass="transparentBg subMenu bolderFont" value="#{data.userName}"/>
    </rich:column>
    </rich:dataTable>
    </h:panelGrid>
    <rich:datascroller id="paginationData" for="groupDetails" reRender="contactsTanble" limitToList="true">
    <a4j:support event="onpagechange" />
    </rich:datascroller>


    Can we implement server side pagination using rich:datacsroller.