Solved !

I was referring to the components parameter rather than the parameter
acquired from the context. Ouch !

On Wed, Feb 27, 2013 at 3:08 AM, Muhammad Gelbana <m.gelb...@gmail.com>wrote:

> I tried adding a t:formState to the loops, but it was no good. I even took
> the the whole loop outside of the form component and surprisingly, I'm
> still having the same error !!
>
>
> On Wed, Feb 27, 2013 at 2:31 AM, Muhammad Gelbana <m.gelb...@gmail.com>wrote:
>
>> I have a component that generates images based on multiple inputs. Lately
>> I increased the parameters for that component. The new parameters acquire
>> their primitive values during an iteration in 2 loops. So 2 loops are
>> eventually generated a set of images.
>>
>> The image-generating component generates images with a url that invokes
>> an event for the component and passes it's parameters as context. The
>> images URLs are generated as expected but right before using one of the new
>> primitive parameters (long) to generate the image, an error is thrown:
>>
>> Caused by: java.lang.NullPointerException: Property 'pieChartDetails'
>>> (within property expression 'pieChartDetails.id', of
>>> com.sc.ipk.portal.ixl.pages.IxlTrends@74a5eac1) is null.
>>
>>
>> Here is my TML
>>
>> <t:loop
>>> t:source="ixlDao.getCsvResultFiles(ixlTest?.getTestType().getId())"
>>> t:value="csvFileResults">
>>> <article t:type="if" t:test="displayPieCharts" class="module width_full"
>>> style="text-align: center;">
>>>  <div class="module_content" style="margin: 5px 5px;">
>>> <div class="pieChartImg" t:type="loop" t:source="availablePieCharts"
>>> t:value="pieChartDetails">
>>>  <img t:type="ixl/Chart" t:chartType="literal:pie" t:chartId="*
>>> pieChartDetails.id*" t:csvResultFileId="*csvFileResults.id*"
>>> t:requestId="ixlTest?.id"
>>>  t:from="formattedStartTime" t:to="formattedEndTime"
>>> t:interval="profile.timeInterval" t:width="300" t:height="300" />
>>>  </div>
>>> </div>
>>> </article>
>>> </t:loop>
>>
>>
>> So the error is thrown AFTER the image URL is correctly generated. I just
>> don't know why does it try to re-acquire the parameters value once again
>> from the page !
>>
>> When I debug through the component (*IxlChart i.e. ixl/Chart*) I find
>> that I'm about to generate an image, but I need the *chartId* parameter,
>> inspecting it using eclipse shows the expected value, but still that line
>> of code that uses that value, keeps throwing the following exception
>>
>>
>> Caused by: org.apache.tapestry5.ioc.internal.OperationException: Failure
>>> reading parameter 'chartId' of component ixl/Trends:chart: Property
>>> 'pieChartDetails' (within property expression 'pieChartDetails.id', of
>>> com.sc.ipk.portal.ixl.pages.ixlTrends@74a5eac1) is null. [at
>>> classpath:com/sc/ipk/portal/ixl/pages/ixlTrends.tml, line 100]
>>>  at
>>> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121)
>>> at
>>> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88)
>>>  at
>>> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
>>> at
>>> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124)
>>>  at
>>> org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl.invoke(ComponentPageElementResourcesImpl.java:146)
>>> at
>>> org.apache.tapestry5.internal.services.EventImpl.storeResult(EventImpl.java:84)
>>>  at
>>> com.sc.ipk.portal.ixl.components.TapestryImage.dispatchComponentEvent(TapestryImage.java)
>>> at
>>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:927)
>>>  at
>>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1112)
>>> ... 76 more
>>> Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException:
>>> Failure reading parameter 'chartId' of component ixl/Trends:chart: Property
>>> 'pieChartDetails' (within property expression 'pieChartDetails.id', of
>>> com.sc.ipk.portal.ixl.pages.ixlTrends@74a5eac1) is null. [at
>>> classpath:com/sc/ipk/portal/ixl/pages/ixlTrends.tml, line 100]
>>>  at
>>> org.apache.tapestry5.internal.transform.ParameterWorker$3$1.readFromBinding(ParameterWorker.java:268)
>>> at
>>> org.apache.tapestry5.internal.transform.ParameterWorker$3$1.get(ParameterWorker.java:381)
>>>  at
>>> com.sc.ipk.portal.ixl.components.TapestryImage.conduit_get_chartId(TapestryImage.java)
>>> at
>>> com.sc.ipk.portal.ixl.components.ixlChart.getPieChart(ixlChart.java:37)
>>>  at com.sc.ipk.portal.ixl.components.ixlChart.getImage(ixlChart.java:29)
>>> at
>>> com.sc.ipk.portal.ixl.components.TapestryImage$1.getStream(TapestryImage.java:125)
>>>  at
>>> org.apache.tapestry5.internal.services.StreamResponseResultProcessor.processResultValue(StreamResponseResultProcessor.java:52)
>>> at
>>> org.apache.tapestry5.internal.services.StreamResponseResultProcessor.processResultValue(StreamResponseResultProcessor.java:28)
>>>  at
>>> $ComponentEventResultProcessor_7bcda80107c9.processResultValue(Unknown
>>> Source)
>>> at
>>> $ComponentEventResultProcessor_7bcda8010785.processResultValue(Unknown
>>> Source)
>>>  at
>>> org.apache.tapestry5.internal.services.ComponentResultProcessorWrapper.handleResult(ComponentResultProcessorWrapper.java:47)
>>> at
>>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$6.handleResult(ComponentPageElementImpl.java:1084)
>>>  at
>>> org.apache.tapestry5.internal.services.EventImpl$1.invoke(EventImpl.java:89)
>>> at
>>> org.apache.tapestry5.internal.services.EventImpl$1.invoke(EventImpl.java:86)
>>>  at
>>> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
>>> ... 83 more
>>> Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException:
>>> Property 'pieChartDetails' (within property expression
>>> 'pieChartDetails.id', of com.sc.ipk.portal.ixl.pages.ixlTrends@74a5eac1)
>>> is null. [at classpath:com/sc/ipk/portal/ixl/pages/ixlTrends.tml, line 100]
>>>  at
>>> org.apache.tapestry5.internal.bindings.PropBinding.get(PropBinding.java:63)
>>> at
>>> org.apache.tapestry5.internal.transform.ParameterWorker$3$1.readFromBinding(ParameterWorker.java:263)
>>>  ... 97 more
>>> Caused by: java.lang.NullPointerException: Property 'pieChartDetails'
>>> (within property expression 'pieChartDetails.id', of
>>> com.sc.ipk.portal.ixl.pages.ixlTrends@74a5eac1) is null.
>>>  at
>>> org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.nullTerm(PropertyConduitSourceImpl.java:1495)
>>> at $InternalPropertyConduit_7bcda8010737.navigate(Unknown Source)
>>>  at $InternalPropertyConduit_7bcda8010737.get(Unknown Source)
>>> at
>>> org.apache.tapestry5.internal.bindings.PropBinding.get(PropBinding.java:59)
>>>  ... 98 more
>>
>>
>> Thank you for your time
>>
>
>

Reply via email to