myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shaun Campbell <campbell.sh...@gmail.com>
Subject Re: Accessing multi level data from within my backing bean.
Date Mon, 13 Jul 2009 14:32:35 GMT
Good catch Anton.  I commented out my data access code and hard code the
return of a list of op objects and it works.  Which proves that you can
access lists from within lists without backing beans which is where I
thought things were going wrong..

Now I've just got to work out why my data access code is failing given it's
the same as for the getJobs() in my outer loop!!!

Thanks
Shaun

2009/7/13 Anton Gavazuk <antongavazuk@gmail.com>

> Jacek,
>
> according to your error
>
> Caused by: java.lang.NullPointerException
>         at uk.co.apps2net.mfm.repository.
> JdbcJobDao.getOps(JdbcJobDao.java:273)
>
> something happens in your data layer, not in myfaces related classes
>
> 2009/7/13 Shaun Campbell <campbell.shaun@gmail.com>
>
> Jacek
>>
>> I've updated as you suggested:
>>
>>                       <t:dataTable value="#{jobsBean.jobs}" var="job"
>>                                      styleClass="jobs" cellspacing="0"
>> cellpadding="0" border="0"
>>                                      rowClasses="odd,even"
>> columnClasses="standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column">
>>
>>                              <f:facet name="caption"><h:outputText
>> value="Outstanding Jobs"/></f:facet>
>>
>>
>>                            <h:column>
>>                                 <f:facet name="header">
>>                                     <h:outputText value="Operations" />
>>                                 </f:facet>
>>
>>                                 <t:dataTable value="#{job.ops}" var="op"
>>                                       styleClass="jobs" cellspacing="0"
>> cellpadding="0" border="0"
>>                                      rowClasses="odd,even"
>> columnClasses="standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column">
>>
>>
>>                                 <h:column>
>>                                     <h:outputText value="#{op.opNum}"/>
>>                                 </h:column>
>>
>>                                 </t:dataTable>
>>                             </h:column>
>>
>>                     </t:dataTable>
>>
>> I get the error:
>>
>> 13-Jul-2009 14:26:03 com.sun.facelets.FaceletViewHandler
>> handleRenderException
>> SEVERE: Error Rendering View[/jobs.xhtml]
>> javax.el.ELException: /jobs.xhtml @93,202 value="#{job.ops}": Error
>> reading 'ops' on type uk.co.apps2net.mfm.repository.JdbcJobDao
>>         at
>> com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
>>         at javax.faces.component.UIData.getValue(UIData.java:976)
>>         at
>> org.apache.myfaces.component.html.ext.HtmlDataTableHack.createDataModel(HtmlDataTableHack.java:437)
>>         at
>> org.apache.myfaces.component.html.ext.HtmlDataTable.createDataModel(HtmlDataTable.java:847)
>>         at
>> org.apache.myfaces.component.html.ext.HtmlDataTableHack.getDataModel(HtmlDataTableHack.java:414)
>>         at
>> org.apache.myfaces.component.html.ext.HtmlDataTable.getDataModel(HtmlDataTable.java:839)
>>         at
>> org.apache.myfaces.component.html.ext.HtmlDataTableHack.getRowCount(HtmlDataTableHack.java:87)
>>         at
>> org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:221)
>>         at
>> org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:134)
>>         at
>> org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.encodeChildren(HtmlTableRenderer.java:187)
>>         at
>> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:543)
>>         at
>> org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChild(RendererUtils.java:414)
>>         at
>> org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChildren(RendererUtils.java:400)
>>         at
>> org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChild(RendererUtils.java:417)
>>         at
>> org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.renderColumnBody(HtmlTableRendererBase.java:337)
>>         at
>> org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.renderColumnBody(HtmlTableRenderer.java:613)
>>         at
>> org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.encodeColumnChild(HtmlTableRendererBase.java:306)
>>         at
>> org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.encodeColumnChild(HtmlTableRenderer.java:512)
>>         at
>> org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:282)
>>         at
>> org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:134)
>>         at
>> org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.encodeChildren(HtmlTableRenderer.java:187)
>>         at
>> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:543)
>>         at
>> javax.faces.component.UIComponent.encodeAll(UIComponent.java:239)
>>         at
>> javax.faces.component.UIComponent.encodeAll(UIComponent.java:246)
>>         at
>> javax.faces.component.UIComponent.encodeAll(UIComponent.java:246)
>>         at
>> com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:578)
>>         at
>> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
>>         at
>> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
>>         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>         at
>> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>         at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>         at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>         at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>         at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>         at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>         at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>>         at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
>>         at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>         at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>         at java.lang.Thread.run(Thread.java:619)
>> Caused by: java.lang.NullPointerException
>>         at
>> uk.co.apps2net.mfm.repository.JdbcJobDao.getOps(JdbcJobDao.java:273)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:597)
>>         at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
>>         at
>> javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
>>         at
>> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.access$301(FacesCompositeELResolver.java:46)
>>         at
>> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver$4.invoke(FacesCompositeELResolver.java:108)
>>         at
>> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.invoke(FacesCompositeELResolver.java:148)
>>         at
>> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:104)
>>         at org.apache.el.parser.AstValue.getValue(AstValue.java:118)
>>         at
>> org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
>>         at
>> com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
>>
>>
>>
>> 2009/7/13 Jacek Bilski <jacek.bilski@gmail.com>
>>
>> Hi Shaun,
>>>
>>> Shaun Campbell wrote:
>>>
>>>> I have a scenario which I would have thought would have been
>>>> straightforward.  I have a backing bean which provides a list of data which
>>>> I am able to display to my web page using:
>>>>
>>>>                       <h:dataTable value="#{jobsBean.jobs}" var="job"
>>>>                                   styleClass="jobs" cellspacing="0"
>>>> cellpadding="0" border="0"
>>>>                                     rowClasses="odd,even"
>>>> columnClasses="standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column">
>>>>
>>>>  This all works fine but what I want to do now is do the same thing from
>>>> the job variable to print out a sub list for each job.  My job class has
a
>>>> getOps() method which returns another list which I want to display.  No
>>>> matter what I try to do to access this list I get an error.
>>>>
>>>
>>> Can you paste here this error of yours?
>>>
>>> In your case I would use Tomahawks dataList for #{jobsBean.jobs}, and for
>>> every job I would put dataTable with value=#{job.ops}.
>>>
>>> Regards
>>>
>>> Jacek Bilski
>>>
>>
>>
>

Mime
View raw message