Try adding volatile="true" to your For .
On 2/24/07, Jean-Philippe Bouchard
<[EMAIL PROTECTED]> wrote:
The squeeze happens in
org.apache.tapestry.components.ForBean#getStringRepFromValue() which is
called from
org.apache.tapestry.components.ForBean.StoreSourceDataIterator#next()
which is called from the ForBean renderComponent() method.
Ciao
JPB
Jean-Philippe Bouchard wrote:
> Hi Howard,
>
> I don't need to squeeze it. I just happen to iterate a list ContextAsset
> in a "For" component rendered in a form. Tapestry tries to squeeze it by
> adding it to a form hidden component. When the component is not used in
> a form, it works perfectly.
>
> This is the HTML page for the component:
>
> <span jwcid="@Any" title="ognl:model.rating">
> <span jwcid="@For" source="ognl:model.stars" value="ognl:star"
> ><img border="0" jwcid="@Image" image="ognl:star"
> alt="star"/></span>
> </span>
>
> mode.stars is an array of IAsset objects which are taken from the jwc.
>
> This is the jwc:
>
> <component-specification allow-body="no" allow-informal-parameters="no">
> <asset name="star" path="images/pink-star.gif"/>
> <asset name="stardimmed" path="images/pink-star-dim.gif"/>
> <asset name="starhalf" path="images/pink-star-half.gif"/>
> <property name="star"/>
> </component-specification>
>
> Howard Lewis Ship wrote:
>> This is not a bug per-se, it could be an enhancement. There's nothing
>> in the description of ContextAsset to indicate that it is supposed to
>> be serializable and, generally, only serializable objects can be
>> "squeezed" into a URL.
>>
>> It's possible to extend the DataSqueezer, via HiveMind contributions,
>> to inform it about how to squeeze additonal types of objects, so you
>> could get it to squeeze assets (with just a bit of work).
>>
>> I do wonder why you needed to squeeze it? At most, you should be
>> squeezing the asset's id.
>>
>> On 2/22/07, Jean-Philippe Bouchard
>> <[EMAIL PROTECTED]> wrote:
>>> Hi,
>>>
>>> I have a component which iterates over an array of context assets
>>> (images) using the "For" component. This component works fine, except
>>> when put it in a form.
>>>
>>> In a form, it fails with "java.lang.IllegalArgumentException: Could not
>>> find a strategy instance for class
>>> org.apache.tapestry.asset.ContextAsset". The problem seems to be that
>>> when The ForBean renders, its StoreSourceDataIterator.next() is trying
>>> to insert a hidden value in the form. The method called is
>>> ForBean.getStringRepFromValue() which fails on DataSqueezer.squeeze()
>>> method with the exception previously mentioned. The reason for the
>>> failure is that no squeeze strategy can be found for the ContextAsset
>>> object.
>>>
>>> Here is the relevant part of the stackstrace:
>>>
>>> Caused by: java.lang.IllegalArgumentException: Could not find a strategy
>>> instance for class org.apache.tapestry.asset.ContextAsset.
>>> at
>>>
org.apache.hivemind.lib.util.StrategyRegistryImpl.searchForAdaptor(StrategyRegistryImpl.java:176)
>>>
>>> at
>>>
org.apache.hivemind.lib.util.StrategyRegistryImpl.getStrategy(StrategyRegistryImpl.java:74)
>>>
>>> at
>>>
org.apache.tapestry.util.io.DataSqueezerImpl.squeeze(DataSqueezerImpl.java:125)
>>>
>>> at
>>> $DataSqueezer_110eadc1cb3.squeeze($DataSqueezer_110eadc1cb3.java)
>>> at
>>>
org.apache.tapestry.components.ForBean.getStringRepFromValue(ForBean.java:397)
>>>
>>> at
>>>
org.apache.tapestry.components.ForBean$StoreSourceDataIterator.next(ForBean.java:365)
>>>
>>> at
>>> org.apache.tapestry.components.ForBean.renderComponent(ForBean.java:125)
>>>
>>> I'm not sure where the problem lies but I "fixed" it by unrolling my for
>>> loop (there are only and always 5 elements in it).
>>>
>>> Ciao
>>> JPB
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Jesse Kuhnert
Tapestry/Dojo team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]