You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Robert Zeigler <rd...@u.arizona.edu> on 2004/04/06 22:56:03 UTC

Embedded component causing class cast exception

I've got a page with three components: a form, a submit button, and a 
custom "LettersSelect" component.
The page renders fine initially, but when I go to submit, I'm getting a 
ClassCastException in resetParameter of
AbstractParameterConnector, line 148.  The line identified as having the 
problem is the
<page-specification> line, the very last column (ie, after />)
It seems to be due either to some inappropriate setup on my part with a 
nested component (details follow) which is
entirely possible, or an error within tapestry's handling of nested 
components.

The relevant portions of the specifications are as follows-

the page:
<property-specification name="selectedLetters" type="java.util.List"/>

(the page currently implements PageRenderListener and sets this property 
to a non-null value on render; I initially set an "initial-value" in the 
page specification with the same results)

<component id="SelectBox" type="LettersSelectBox">
  <binding name="selectedLetters" expression="selectedLetters"/>
</component>

the LettersSelectBox component:

<parameter name="selectedLetters" type="java.util.List" direction="form" 
required="yes"/>
<component id="LettersSelect" type="SelectMultiple">
   <binding name="Model" expression="letterSelectModel"/>
   <inherited-binding name="selectedList" parameter-name="selectedLetters"/>
</component>

(I've also tried <binding name="selectedList" 
expression="selectedLetters"/> with the same results)

The SelectMultiple's selectedList parameter is of type java.util.List.

If I specify the SelectMultiple directly in the page specification, 
everything works fine; any thoughts????
Thanks in advance,

Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Embedded component causing class cast exception

Posted by Robert Zeigler <rd...@u.arizona.edu>.
Please ignore... found a message in the archives that pretty much has my 
exact problem.
(The "bottom" level component (SelectMultiple) /does/ implement 
IFormComponent; but the "mid level" component
(the LettersSelect) does not; it's essentially just a wrapper around the 
bottom level component.

Robert

Robert Zeigler wrote:

> I've got a page with three components: a form, a submit button, and a 
> custom "LettersSelect" component.
> The page renders fine initially, but when I go to submit, I'm getting 
> a ClassCastException in resetParameter of
> AbstractParameterConnector, line 148.  The line identified as having 
> the problem is the
> <page-specification> line, the very last column (ie, after />)
> It seems to be due either to some inappropriate setup on my part with 
> a nested component (details follow) which is
> entirely possible, or an error within tapestry's handling of nested 
> components.
>
> The relevant portions of the specifications are as follows-
>
> the page:
> <property-specification name="selectedLetters" type="java.util.List"/>
>
> (the page currently implements PageRenderListener and sets this 
> property to a non-null value on render; I initially set an 
> "initial-value" in the page specification with the same results)
>
> <component id="SelectBox" type="LettersSelectBox">
>  <binding name="selectedLetters" expression="selectedLetters"/>
> </component>
>
> the LettersSelectBox component:
>
> <parameter name="selectedLetters" type="java.util.List" 
> direction="form" required="yes"/>
> <component id="LettersSelect" type="SelectMultiple">
>   <binding name="Model" expression="letterSelectModel"/>
>   <inherited-binding name="selectedList" 
> parameter-name="selectedLetters"/>
> </component>
>
> (I've also tried <binding name="selectedList" 
> expression="selectedLetters"/> with the same results)
>
> The SelectMultiple's selectedList parameter is of type java.util.List.
>
> If I specify the SelectMultiple directly in the page specification, 
> everything works fine; any thoughts????
> Thanks in advance,
>
> Robert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org