myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fastbob <fast...@gmail.com>
Subject Dynamic panelGrid within dataTable
Date Tue, 13 Feb 2007 01:52:54 GMT

Howdy,
I'm trying to dynamically generate a panelGrid from within a dataTable (yes,
dynamic generation is required). The panelGrid will be displayed as details
when the user clicks on a row in the table, and each row in the table will
generate different contents for its panelGrid. This technique seems to fail
when the panelGrid is bound to the var of the dataTable, but not, for
instance, when accessing a panelGrid property of some other request or
session bean. The exception (below) seems to indicate that the dataTable var
is null when the panelGrid binding is evaluated.

Here's an extract of the tags:

            <h:form id="createReports">
            <t:dataTable id="reports" var="report"
                            value="#{ReportDefinitions.reportList}"
                             sortable="true"
                            preserveDataModel="false" [...]>

                  <t:column sortPropertyName="name">
                     <f:facet name="header">
                        <h:outputText value="REPORT NAME"/>
                     </f:facet>
                     <h:outputText value="#{report.name}"/>
                  </t:column>

                  <f:facet name="detailStamp">
                     <t:panelGrid >

      --->                   <t:panelGrid binding="#{report.formPanelGrid}"
/>

                     </t:panelGrid>
                  </f:facet>
               </t:dataTable>
            </h:form>


And the exception is:
17:45:30,171 ERROR [ApplicationImpl] Exception while creating component of
type [org.apache.myfaces.HtmlPanelGrid] for binding
[#{report.formPanelGrid}]
17:45:30,187 ERROR [Engine] ApplicationDispatcher[/reporter]
Servlet.service() for servlet jsp threw exception
Caused by: javax.faces.el.PropertyNotFoundException: Base is null: report
	at
org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueBindingImpl.java:460)
	at
org.apache.myfaces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:248)
	at
org.apache.myfaces.application.ApplicationImpl.createComponent(ApplicationImpl.java:449)
	at
javax.faces.webapp.UIComponentTag.createComponentInstance(UIComponentTag.java:709)
	at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:596)
	at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:312)
	at
org.apache.jsp.reports.reports_jsp._jspx_meth_t_panelGrid_0(reports_jsp.java:1728)
	at org.apache.jsp.reports.reports_jsp._jspService(reports_jsp.java:577)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
	at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
	at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
	... 42 more


I've searched the web for an answer, but I'm probably still missing
something. Suggestions? Do I need to introduce some sort of indirection
through another bean to make this work? Thanks.

fastbob
-- 
View this message in context: http://www.nabble.com/Dynamic-panelGrid-within-dataTable-tf3218128.html#a8937191
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message