Hi sandeep,

The effekt that occurs is, that tapestry tries to provide a loop
context/state for the enclosing form. You need this if you have any fields
in your loop.

If you don¹t want/need to provide a context you may mark the loop as
voliatile. This looks like:

<t:loop source="mYlist" value="prop:MyDataObject" volatile=²true²> ...
</t:loop>
  
Otherwise you'll have to provide a form state. I guess it would look like

<t:loop source="mYlist" value="prop:MyDataObject"
volatile=²MyDataObject.someID²> ... </t:loop>

The tapestry error message in this case is - IMHO - improvable ;-)

Regards
Niclas


On 30.10.09 08:31, "sandeepraj singh" <sandeepraj.si...@atosorigin.com>
wrote:

> 
> 
> Hi All,
> I have the following
> 
> In MyComponent.tml
> <t:loop source="mYlist" value="prop:MyDataObject">
>        
>          ${MyDataObject.someothervariable} </li>
>                
> </t:loop>
> 
> Ofcourse there is supporting code for the same in MyComponent.java. ie.
> having an istance variable of MyDataObject etc.
> 
> In my Page, there are 2 cases
> 1) I use the component without an enclosing form. In this case the component
> works abs fine.
> 2) I use the component with an enclosing form. In such a case ,i recieve
> co-ercion error because of the context value that is being passed and is
> mapped to MyDataObject. The error is recieved only when the Enclosing FORM
> IS SUBMITTED.
> 
> For scenario 2, i make a contribution to TypeCoercer to force creation of
> MyDataObject so that the problem is solved. But can any one think of a
> better way. A way in which some code in My Component takes care of the
> problem rather than a contribution inthe service.
> 
> Thanks
> sandeep
> --
> View this message in context:
> http://old.nabble.com/How-to-avoid-contribution-to-TypeCoercer-in-my-case.-tp2
> 6126002p26126002.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to