You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jan Vissers <Ja...@cumquat.nl> on 2008/04/18 14:28:18 UTC

Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Hi,

Just to make sure I'm not missing something.

In T4 when I wrote a @For construct I could use value="..." as long as I
provided a setter|getter pair for the class involved - in this case
BreadcrumbBean. I want to iterate over a list of beans and use each
instance individually. Now T5 throws up on me with this nice coercion
message. Does this mean I need to contribute my own coercion - or is
there a more simple way? In my case BreadcrumbBean is a simple class
holding three String members.

Thanks (again :-))
-J.


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by nicholas Krul <ni...@gmail.com>.
_that sounds like a bug to me. It should stay as an Object, and since its
not rendered, shouldn't need to string-itised.

http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Loop.html
value type is Object

weird... so far I've only looped enums, so I wouldn't know.

perhaps someone who knows about the internals ?

On Fri, Apr 18, 2008 at 2:34 PM, Blower, Andy <An...@proquest.co.uk>
wrote:

> I think I encountered the same issue last week where I wanted to loop over
> a List of objects that were instances of one of my own classes. The loop
> component code finds it necessary to be able to convert the object into a
> string and then back again when populating your value property variable from
> the element of the list.
>
> The reason for this appears to be something to do with forms and
> volatility, but I really don't understand those issues at all. (Note: it
> would be *fantastic* if someone could explain the concepts behind forms and
> volatility because it's not clear to me from the T5 documentation)
>
> Instead of creating a coercer for my class, which I had no desire to do as
> this loop was not part of a form, I made my own component handle the
> looping/iteration. I could have made a non-coercing generic loop component,
> but as I was already creating a component whose template just needed a loop
> in, I just used that component.
>
> I don't know what the general thought is about the loop component, but
> having to coerce each element to a string for form support seems to me to be
> more applicable to a special case of loop than a generic loop. But I'm very
> new to Tapestry so I might be getting this all wrong.
>
> Does that make sense?
>
> Andy.
>
> > -----Original Message-----
> > From: Jan Vissers [mailto:Jan.Vissers@cumquat.nl]
> > Sent: 18 April 2008 13:28
> > To: Tapestry users
> > Subject: Could not find a coercion from type java.lang.String to type
> > com.****.lighting.guidecontrol.view.BreadcrumbBean
> >
> > Hi,
> >
> > Just to make sure I'm not missing something.
> >
> > In T4 when I wrote a @For construct I could use value="..." as long as
> > I
> > provided a setter|getter pair for the class involved - in this case
> > BreadcrumbBean. I want to iterate over a list of beans and use each
> > instance individually. Now T5 throws up on me with this nice coercion
> > message. Does this mean I need to contribute my own coercion - or is
> > there a more simple way? In my case BreadcrumbBean is a simple class
> > holding three String members.
> >
> > Thanks (again :-))
> > -J.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

RE: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by "Blower, Andy" <An...@proquest.co.uk>.
I think I encountered the same issue last week where I wanted to loop over a List of objects that were instances of one of my own classes. The loop component code finds it necessary to be able to convert the object into a string and then back again when populating your value property variable from the element of the list.

The reason for this appears to be something to do with forms and volatility, but I really don't understand those issues at all. (Note: it would be *fantastic* if someone could explain the concepts behind forms and volatility because it's not clear to me from the T5 documentation)

Instead of creating a coercer for my class, which I had no desire to do as this loop was not part of a form, I made my own component handle the looping/iteration. I could have made a non-coercing generic loop component, but as I was already creating a component whose template just needed a loop in, I just used that component.

I don't know what the general thought is about the loop component, but having to coerce each element to a string for form support seems to me to be more applicable to a special case of loop than a generic loop. But I'm very new to Tapestry so I might be getting this all wrong.

Does that make sense?

Andy.

> -----Original Message-----
> From: Jan Vissers [mailto:Jan.Vissers@cumquat.nl]
> Sent: 18 April 2008 13:28
> To: Tapestry users
> Subject: Could not find a coercion from type java.lang.String to type
> com.****.lighting.guidecontrol.view.BreadcrumbBean
>
> Hi,
>
> Just to make sure I'm not missing something.
>
> In T4 when I wrote a @For construct I could use value="..." as long as
> I
> provided a setter|getter pair for the class involved - in this case
> BreadcrumbBean. I want to iterate over a list of beans and use each
> instance individually. Now T5 throws up on me with this nice coercion
> message. Does this mean I need to contribute my own coercion - or is
> there a more simple way? In my case BreadcrumbBean is a simple class
> holding three String members.
>
> Thanks (again :-))
> -J.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Ted Steen <te...@gmail.com>.
Without having read this thread carefully I suggest that you try to add
volatile="true" to your loop.

2008/4/18, Jan Vissers <Ja...@cumquat.nl>:
> The problem is somehow related to the way my page and component are
>  hooked up/working.
>
>  For testing purposes I now create the Breadcrumb list in the component
>  itself, simply returning a created list on the fly whenever
>  getBreadCrumbs() is called. This works as expected!!!
>
>  Strange thing is that via passing the 'model' to the component via a
>  page binding the same thing doesn't work. This must be a bug?!
>
>
>  -J.
>
>
>  On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
>  > That looks good to me. I don't have an example I can look at with a
>  > loop, but I do have one with a t:grid in which I reference a bean
>  > property of a custom class. It's possible that the two are vastly
>  > different, but I wouldn't think that.
>  >
>  > Jan Vissers wrote:
>  > > On the component I have:
>  > >
>  > >     @Parameter
>  > >     private List<BreadcrumbBean> breadCrumbs;
>  > >
>  > > This is passed in via the containg (base)page.
>  > > And in the same component class I have:
>  > >
>  > >     private BreadcrumbBean crumb;
>  > >
>  > >     public BreadcrumbBean getCrumb() {
>  > >         return crumb;
>  > >     }
>  > >
>  > >     public void setCrumb(BreadcrumbBean crumb) {
>  > >         this.crumb = crumb;
>  > >     }
>  > >
>  > > This should be right, right?
>  > >
>  > > -J.
>  > >
>  > > On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
>  > >
>  > >> ? is your crumb property of type BreadCrumbBean, or is it type String?
>  > >> should be same as breadCrumbs<?TYPE>
>  > >>
>  > >> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
>  > >> wrote:
>  > >>
>  > >>
>  > >>> I can't speak about your t:if bit because I don't know what "LastCrumb"
>  > >>> would be, but assuming that your page class has getters/setters (or the
>  > >>> property is annotated with @Property) for the "crumb" property, a getter
>  > >>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
>  > >>> you *should* be good.
>  > >>>
>  > >>> It would be helpful if you can include the exception, specifically the
>  > >>> line it references, etc.
>  > >>>
>  > >>> chris
>  > >>>
>  > >>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
>  > >>> better ;-)
>  > >>>
>  > >>> Jan Vissers wrote:
>  > >>>
>  > >>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
>  > >>>>
>  > >>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
>  > >>>>     <t:if test="LastCrumb">
>  > >>>>        ${crumb.name}
>  > >>>>        <t:parameter name="else">
>  > >>>>            <a href="#"
>  > >>>> t:type="pageLink" ....>${crumb.name}</a>
>  > >>>>               >
>  > >>>>        </t:parameter>
>  > >>>>     </t:if>
>  > >>>> </t:loop>
>  > >>>>
>  > >>>> -J.
>  > >>>>
>  > >>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
>  > >>>>
>  > >>>>
>  > >>>>> Can you share some code? At least the relevant part from template would
>  > >>>>> be helpful.
>  > >>>>>
>  > >>>>> chris
>  > >>>>>
>  > >>>>> Jan Vissers wrote:
>  > >>>>>
>  > >>>>>
>  > >>>>>> Hi,
>  > >>>>>>
>  > >>>>>> Just to make sure I'm not missing something.
>  > >>>>>>
>  > >>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
>  > >>>>>>
>  > >>> I
>  > >>>
>  > >>>>>> provided a setter|getter pair for the class involved - in this case
>  > >>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
>  > >>>>>> instance individually. Now T5 throws up on me with this nice coercion
>  > >>>>>> message. Does this mean I need to contribute my own coercion - or is
>  > >>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
>  > >>>>>> holding three String members.
>  > >>>>>>
>  > >>>>>> Thanks (again :-))
>  > >>>>>> -J.
>  > >>>>>>
>  > >>>>>>
>  > >>>>>> ---------------------------------------------------------------------
>  > >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  > >>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>  > >>>>>>
>  > >>>>>>
>  > >>>>>>
>  > >>>>>>
>  > >>>>>>
>  > >>>> ---------------------------------------------------------------------
>  > >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  > >>>> For additional commands, e-mail: users-help@tapestry.apache.org
>  > >>>>
>  > >>>>
>  > >>>>
>  > >>>>
>  > >>> --
>  > >>> http://thegodcode.net
>  > >>>
>  > >>>
>  > >>>
>  > >
>  > >
>  > > ---------------------------------------------------------------------
>  > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  > > For additional commands, e-mail: users-help@tapestry.apache.org
>  > >
>  > >
>  > >
>  >
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Jan Vissers <Ja...@cumquat.nl>.
Filled with all kinds of 'debug' stuff'


<div id="heading"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
    <div id="bread">
        <ul id="breadcrumbs">
            <li class="prefix">${message:text-yourhere}</li>
            <t:if test="loginPage">
                <li>${message:text-loginpage}</li>
                <t:parameter name="else">
                    <t:loop source="breadCrumbs" value="crumb"
index="index" volatile="true">
                       <li>A</li>
                       <!-- 
                        <t:if test="LastCrumb">
                            ${crumb.title}
                            <t:parameter name="else">
                                <a href="#"
t:type="pageLink">${crumb.title}</a>
                                >
                            </t:parameter>
                        </t:if>
                         -->
                    </t:loop>
                </t:parameter>
            </t:if>
        </ul>
    </div>
    <div class="pagetitle" />
</div>

On Fri, 2008-04-18 at 16:43 +0200, Chris Lewis wrote:
> And that is the part I want to see, from the template code which you
> still haven't shared ;-). What I'm referring to is your .tml file where
> you use this component.
> 
> Jan Vissers wrote:
> > In the snippet below if I change:
> >     public List<BreadcrumbBean> getBreadCrumbs()
> >
> > and let it return a freshly created list. The loop construct works.
> > However via the @Parameter (passing it it) doesn't.
> >
> > -J.
> >
> >
> > On Fri, 2008-04-18 at 16:27 +0200, Jan Vissers wrote:
> >   
> >> Here it is:
> >>
> >> import java.util.List;
> >>
> >> import org.apache.log4j.Logger;
> >> import org.apache.tapestry.annotations.Parameter;
> >>
> >> import com.philips.lighting.guidecontrol.view.BreadcrumbBean;
> >>
> >> /**
> >>  * The heading component holds the following pieces of Heading
> >> information.
> >>  * 
> >>  * <pre>
> >>  *    &lt;div id=&quot;heading&quot;&gt;
> >>  *      &lt;ul id=&quot;breadcrumbs&quot;&gt;
> >>  *           &lt;li
> >> id=&quot;prefix&quot;&gt;[ &amp;aposyou-are-here&amp;apos ]&gt;/li&gt;
> >>  *           { when loginPage }
> >>  *               &lt;li&gt;&amp;aposlogin-page&amp;apos&lt;/li&gt;
> >>  *           { when not loginPage }
> >>  *               { for all crumbs }
> >>  *                   { if crumb is last }
> >>  *                       &lt;li&gt;[ crumb text ]&lt;/li&gt;
> >>  *                   { if crumb is not last }
> >>  *                       &lt;li&gt;&lt;a href=&quot;[ crumb
> >> link ]&quot;&gt;[ crumb text ]&lt;/a&gt; &gt; &lt;/li&gt;
> >>  *      &lt;/ul&gt;
> >>  *    &lt;/div&gt;
> >>  * </pre>
> >>  * 
> >>  * @author Cumquat Information Technology
> >>  * 
> >>  */
> >> public class Heading {
> >>     private static final Logger logger =
> >> Logger.getLogger(Heading.class);
> >>     
> >>     @Parameter
> >>     private boolean loginPage = false;
> >>
> >>     @Parameter
> >>     private List<BreadcrumbBean> breadCrumbs;
> >>
> >>     private int index;
> >>
> >>     private BreadcrumbBean crumb;
> >>
> >>     public boolean isLoginPage() {
> >>         return loginPage;
> >>     }
> >>
> >>     public List<BreadcrumbBean> getBreadCrumbs() {
> >>         return breadCrumbs;
> >>     }
> >>
> >>     public void setBreadCrumbs(List<BreadcrumbBean> breadCrumbs) {
> >>         logger.debug("Setting breadcrumbs: "+breadCrumbs);
> >>         this.breadCrumbs = breadCrumbs;
> >>     }
> >>
> >>     public int getIndex() {
> >>         return index;
> >>     }
> >>
> >>     public void setIndex(int index) {
> >>         this.index = index;
> >>     }
> >>
> >>     public BreadcrumbBean getCrumb() {
> >>         return crumb;
> >>     }
> >>
> >>     public void setCrumb(BreadcrumbBean crumb) {
> >>         this.crumb = crumb;
> >>     }
> >>
> >>     public boolean isLastCrumb() {
> >>         return (index == breadCrumbs.size() - 1);
> >>     }
> >>     
> >> }
> >>
> >> On Fri, 2008-04-18 at 16:22 +0200, Chris Lewis wrote:
> >>     
> >>> We still haven't seen your template code, where you declare this
> >>> component and pass it the model. I can't be sure but perhaps it will
> >>> shed some light...
> >>>
> >>> Jan Vissers wrote:
> >>>       
> >>>> The problem is somehow related to the way my page and component are
> >>>> hooked up/working.
> >>>>
> >>>> For testing purposes I now create the Breadcrumb list in the component
> >>>> itself, simply returning a created list on the fly whenever
> >>>> getBreadCrumbs() is called. This works as expected!!!
> >>>>
> >>>> Strange thing is that via passing the 'model' to the component via a
> >>>> page binding the same thing doesn't work. This must be a bug?!
> >>>>
> >>>> -J.
> >>>>
> >>>> On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
> >>>>   
> >>>>         
> >>>>> That looks good to me. I don't have an example I can look at with a
> >>>>> loop, but I do have one with a t:grid in which I reference a bean
> >>>>> property of a custom class. It's possible that the two are vastly
> >>>>> different, but I wouldn't think that.
> >>>>>
> >>>>> Jan Vissers wrote:
> >>>>>     
> >>>>>           
> >>>>>> On the component I have:
> >>>>>>
> >>>>>>     @Parameter
> >>>>>>     private List<BreadcrumbBean> breadCrumbs;
> >>>>>>
> >>>>>> This is passed in via the containg (base)page.
> >>>>>> And in the same component class I have:
> >>>>>>
> >>>>>>     private BreadcrumbBean crumb;
> >>>>>>
> >>>>>>     public BreadcrumbBean getCrumb() {
> >>>>>>         return crumb;
> >>>>>>     }
> >>>>>>
> >>>>>>     public void setCrumb(BreadcrumbBean crumb) {
> >>>>>>         this.crumb = crumb;
> >>>>>>     }
> >>>>>>
> >>>>>> This should be right, right?
> >>>>>>
> >>>>>> -J.
> >>>>>>
> >>>>>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
> >>>>>>   
> >>>>>>       
> >>>>>>             
> >>>>>>> ? is your crumb property of type BreadCrumbBean, or is it type String?
> >>>>>>> should be same as breadCrumbs<?TYPE>
> >>>>>>>
> >>>>>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
> >>>>>>> wrote:
> >>>>>>>
> >>>>>>>     
> >>>>>>>         
> >>>>>>>               
> >>>>>>>> I can't speak about your t:if bit because I don't know what "LastCrumb"
> >>>>>>>> would be, but assuming that your page class has getters/setters (or the
> >>>>>>>> property is annotated with @Property) for the "crumb" property, a getter
> >>>>>>>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
> >>>>>>>> you *should* be good.
> >>>>>>>>
> >>>>>>>> It would be helpful if you can include the exception, specifically the
> >>>>>>>> line it references, etc.
> >>>>>>>>
> >>>>>>>> chris
> >>>>>>>>
> >>>>>>>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
> >>>>>>>> better ;-)
> >>>>>>>>
> >>>>>>>> Jan Vissers wrote:
> >>>>>>>>       
> >>>>>>>>           
> >>>>>>>>                 
> >>>>>>>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
> >>>>>>>>>
> >>>>>>>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
> >>>>>>>>>     <t:if test="LastCrumb">
> >>>>>>>>>        ${crumb.name}
> >>>>>>>>>        <t:parameter name="else">
> >>>>>>>>>            <a href="#"
> >>>>>>>>> t:type="pageLink" ....>${crumb.name}</a>
> >>>>>>>>>               >
> >>>>>>>>>        </t:parameter>
> >>>>>>>>>     </t:if>
> >>>>>>>>> </t:loop>
> >>>>>>>>>
> >>>>>>>>> -J.
> >>>>>>>>>
> >>>>>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
> >>>>>>>>>
> >>>>>>>>>         
> >>>>>>>>>             
> >>>>>>>>>                   
> >>>>>>>>>> Can you share some code? At least the relevant part from template would
> >>>>>>>>>> be helpful.
> >>>>>>>>>>
> >>>>>>>>>> chris
> >>>>>>>>>>
> >>>>>>>>>> Jan Vissers wrote:
> >>>>>>>>>>
> >>>>>>>>>>           
> >>>>>>>>>>               
> >>>>>>>>>>                     
> >>>>>>>>>>> Hi,
> >>>>>>>>>>>
> >>>>>>>>>>> Just to make sure I'm not missing something.
> >>>>>>>>>>>
> >>>>>>>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
> >>>>>>>>>>>             
> >>>>>>>>>>>                 
> >>>>>>>>>>>                       
> >>>>>>>> I
> >>>>>>>>       
> >>>>>>>>           
> >>>>>>>>                 
> >>>>>>>>>>> provided a setter|getter pair for the class involved - in this case
> >>>>>>>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
> >>>>>>>>>>> instance individually. Now T5 throws up on me with this nice coercion
> >>>>>>>>>>> message. Does this mean I need to contribute my own coercion - or is
> >>>>>>>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
> >>>>>>>>>>> holding three String members.
> >>>>>>>>>>>
> >>>>>>>>>>> Thanks (again :-))
> >>>>>>>>>>> -J.
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>             
> >>>>>>>>>>>                 
> >>>>>>>>>>>                       
> >>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>         
> >>>>>>>>>             
> >>>>>>>>>                   
> >>>>>>>> --
> >>>>>>>> http://thegodcode.net
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>       
> >>>>>>>>           
> >>>>>>>>                 
> >>>>>> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>
> >>>>>>
> >>>>>>   
> >>>>>>       
> >>>>>>             
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>
> >>>>
> >>>>   
> >>>>         
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >>     
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >   
> 


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


RE: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by "Blower, Andy" <An...@proquest.co.uk>.
Me too Jan, thank you.

I was also passing a list via the template loop component attribute 'source' as well, and I was also wrapping it with ${} - I've obviously spent too long using the JSP EL! This would be a good gotcha to add to the wiki or even possibly the T5 documentation...?

Anyway it looks like I was completely wrong about the loop component then. I could still use an explanation of volatility & forms though if anyone can point me in the right direction.

> -----Original Message-----
> From: Jan Vissers [mailto:Jan.Vissers@cumquat.nl]
> Sent: 18 April 2008 16:06
> To: Tapestry users
> Subject: Re: Could not find a coercion from type java.lang.String to
> type com.****.lighting.guidecontrol.view.BreadcrumbBean
>
> Spot on! Now I also understand why the .tml passing didn't work. This
> is
> a great 'a-ha' moment for me!
>
> -J.
> On Fri, 2008-04-18 at 17:03 +0200, Chris Lewis wrote:
> > Ok I think I see the problem. In your layout replace this:
> >
> > t:breadCrumbs="${basePage.breadCrumbHolder.model}"
> >
> > with this:
> >
> > t:breadCrumbs="basePage.breadCrumbHolder.model"
> >
> > Notice the lack of ${}. ${} is trying to convert it to a string,
> which
> > it's not. When passing params to components you don't use expansions,
> > what you want is the object property from the class. The default
> binding
> > prefix for params is "prop" which is what you want in this case.
> >
> > Jan Vissers wrote:
> > > I think I'm getting a bit further now - sorry to spam this list by
> the
> > > way...
> > >
> > > If I pass the breadCrumb model in the Component class instead via
> the
> > > Component Template something is happening.
> > >
> > > So instead of:
> > > <t:heading t:id="heading"
> > > t:breadCrumbs="${basePage.breadCrumbHolder.model}" />
> > >
> > > I do in .java
> > > @Component(inheritInformalParameters = true, parameters =
> > > {
> "loginPage=inherit:loginPage","breadCrumbs=basePage.breadCrumbHolder.mo
> del" })
> > >
> > >
> > >
> > > On Fri, 2008-04-18 at 16:47 +0200, Jan Vissers wrote:
> > >
> > >> The layout component that passes in the 'breadCrumb' model to the
> > >> 'heading' component which should render the breadcrumbs...
> > >>
> > >>
> > >> <?xml version="1.0" encoding="utf-8"?>
> > >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> > >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> > >> <html xmlns="http://www.w3.org/1999/xhtml"
> > >> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> > >>     <head>
> > >>         <meta http-equiv="Content-Type"
> > >> content="text/html;charset=utf-8" />
> > >>         <link rel="shortcut icon" href="favicon.ico" />
> > >>         <title>${title}</title>
> > >>     </head>
> > >>     <body>
> > >>         <div id="container">
> > >>             <t:branding t:id="branding" />
> > >>             <t:heading t:id="heading"
> > >> t:breadCrumbs="${basePage.breadCrumbHolder.model}" />
> > >>             <t:body />
> > >>             <t:copyright t:id="copyright" />
> > >>         </div>
> > >>     </body>
> > >> </html>
> > >>
> > >> On Fri, 2008-04-18 at 16:43 +0200, Chris Lewis wrote:
> > >>
> > >>> And that is the part I want to see, from the template code which
> you
> > >>> still haven't shared ;-). What I'm referring to is your .tml file
> where
> > >>> you use this component.
> > >>>
> > >>> Jan Vissers wrote:
> > >>>
> > >>>> In the snippet below if I change:
> > >>>>     public List<BreadcrumbBean> getBreadCrumbs()
> > >>>>
> > >>>> and let it return a freshly created list. The loop construct
> works.
> > >>>> However via the @Parameter (passing it it) doesn't.
> > >>>>
> > >>>> -J.
> > >>>>
> > >>>>
> > >>>> On Fri, 2008-04-18 at 16:27 +0200, Jan Vissers wrote:
> > >>>>
> > >>>>
> > >>>>> Here it is:
> > >>>>>
> > >>>>> import java.util.List;
> > >>>>>
> > >>>>> import org.apache.log4j.Logger;
> > >>>>> import org.apache.tapestry.annotations.Parameter;
> > >>>>>
> > >>>>> import com.philips.lighting.guidecontrol.view.BreadcrumbBean;
> > >>>>>
> > >>>>> /**
> > >>>>>  * The heading component holds the following pieces of Heading
> > >>>>> information.
> > >>>>>  *
> > >>>>>  * <pre>
> > >>>>>  *    &lt;div id=&quot;heading&quot;&gt;
> > >>>>>  *      &lt;ul id=&quot;breadcrumbs&quot;&gt;
> > >>>>>  *           &lt;li
> > >>>>> id=&quot;prefix&quot;&gt;[ &amp;aposyou-are-here&amp;apos
> ]&gt;/li&gt;
> > >>>>>  *           { when loginPage }
> > >>>>>  *               &lt;li&gt;&amp;aposlogin-
> page&amp;apos&lt;/li&gt;
> > >>>>>  *           { when not loginPage }
> > >>>>>  *               { for all crumbs }
> > >>>>>  *                   { if crumb is last }
> > >>>>>  *                       &lt;li&gt;[ crumb text ]&lt;/li&gt;
> > >>>>>  *                   { if crumb is not last }
> > >>>>>  *                       &lt;li&gt;&lt;a href=&quot;[ crumb
> > >>>>> link ]&quot;&gt;[ crumb text ]&lt;/a&gt; &gt; &lt;/li&gt;
> > >>>>>  *      &lt;/ul&gt;
> > >>>>>  *    &lt;/div&gt;
> > >>>>>  * </pre>
> > >>>>>  *
> > >>>>>  * @author Cumquat Information Technology
> > >>>>>  *
> > >>>>>  */
> > >>>>> public class Heading {
> > >>>>>     private static final Logger logger =
> > >>>>> Logger.getLogger(Heading.class);
> > >>>>>
> > >>>>>     @Parameter
> > >>>>>     private boolean loginPage = false;
> > >>>>>
> > >>>>>     @Parameter
> > >>>>>     private List<BreadcrumbBean> breadCrumbs;
> > >>>>>
> > >>>>>     private int index;
> > >>>>>
> > >>>>>     private BreadcrumbBean crumb;
> > >>>>>
> > >>>>>     public boolean isLoginPage() {
> > >>>>>         return loginPage;
> > >>>>>     }
> > >>>>>
> > >>>>>     public List<BreadcrumbBean> getBreadCrumbs() {
> > >>>>>         return breadCrumbs;
> > >>>>>     }
> > >>>>>
> > >>>>>     public void setBreadCrumbs(List<BreadcrumbBean>
> breadCrumbs) {
> > >>>>>         logger.debug("Setting breadcrumbs: "+breadCrumbs);
> > >>>>>         this.breadCrumbs = breadCrumbs;
> > >>>>>     }
> > >>>>>
> > >>>>>     public int getIndex() {
> > >>>>>         return index;
> > >>>>>     }
> > >>>>>
> > >>>>>     public void setIndex(int index) {
> > >>>>>         this.index = index;
> > >>>>>     }
> > >>>>>
> > >>>>>     public BreadcrumbBean getCrumb() {
> > >>>>>         return crumb;
> > >>>>>     }
> > >>>>>
> > >>>>>     public void setCrumb(BreadcrumbBean crumb) {
> > >>>>>         this.crumb = crumb;
> > >>>>>     }
> > >>>>>
> > >>>>>     public boolean isLastCrumb() {
> > >>>>>         return (index == breadCrumbs.size() - 1);
> > >>>>>     }
> > >>>>>
> > >>>>> }
> > >>>>>
> > >>>>> On Fri, 2008-04-18 at 16:22 +0200, Chris Lewis wrote:
> > >>>>>
> > >>>>>
> > >>>>>> We still haven't seen your template code, where you declare
> this
> > >>>>>> component and pass it the model. I can't be sure but perhaps
> it will
> > >>>>>> shed some light...
> > >>>>>>
> > >>>>>> Jan Vissers wrote:
> > >>>>>>
> > >>>>>>
> > >>>>>>> The problem is somehow related to the way my page and
> component are
> > >>>>>>> hooked up/working.
> > >>>>>>>
> > >>>>>>> For testing purposes I now create the Breadcrumb list in the
> component
> > >>>>>>> itself, simply returning a created list on the fly whenever
> > >>>>>>> getBreadCrumbs() is called. This works as expected!!!
> > >>>>>>>
> > >>>>>>> Strange thing is that via passing the 'model' to the
> component via a
> > >>>>>>> page binding the same thing doesn't work. This must be a
> bug?!
> > >>>>>>>
> > >>>>>>> -J.
> > >>>>>>>
> > >>>>>>> On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>> That looks good to me. I don't have an example I can look at
> with a
> > >>>>>>>> loop, but I do have one with a t:grid in which I reference a
> bean
> > >>>>>>>> property of a custom class. It's possible that the two are
> vastly
> > >>>>>>>> different, but I wouldn't think that.
> > >>>>>>>>
> > >>>>>>>> Jan Vissers wrote:
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>> On the component I have:
> > >>>>>>>>>
> > >>>>>>>>>     @Parameter
> > >>>>>>>>>     private List<BreadcrumbBean> breadCrumbs;
> > >>>>>>>>>
> > >>>>>>>>> This is passed in via the containg (base)page.
> > >>>>>>>>> And in the same component class I have:
> > >>>>>>>>>
> > >>>>>>>>>     private BreadcrumbBean crumb;
> > >>>>>>>>>
> > >>>>>>>>>     public BreadcrumbBean getCrumb() {
> > >>>>>>>>>         return crumb;
> > >>>>>>>>>     }
> > >>>>>>>>>
> > >>>>>>>>>     public void setCrumb(BreadcrumbBean crumb) {
> > >>>>>>>>>         this.crumb = crumb;
> > >>>>>>>>>     }
> > >>>>>>>>>
> > >>>>>>>>> This should be right, right?
> > >>>>>>>>>
> > >>>>>>>>> -J.
> > >>>>>>>>>
> > >>>>>>>>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>> ? is your crumb property of type BreadCrumbBean, or is it
> type String?
> > >>>>>>>>>> should be same as breadCrumbs<?TYPE>
> > >>>>>>>>>>
> > >>>>>>>>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis
> <ch...@bellsouth.net>
> > >>>>>>>>>> wrote:
> > >>>>>>>>>>
> > >>>>>>>>>>
> > >>>>>>>>>>
> > >>>>>>>>>>
> > >>>>>>>>>>
> > >>>>>>>>>>> I can't speak about your t:if bit because I don't know
> what "LastCrumb"
> > >>>>>>>>>>> would be, but assuming that your page class has
> getters/setters (or the
> > >>>>>>>>>>> property is annotated with @Property) for the "crumb"
> property, a getter
> > >>>>>>>>>>> for your "breadCrumbs," and your crumb bean defines a
> "getName" method,
> > >>>>>>>>>>> you *should* be good.
> > >>>>>>>>>>>
> > >>>>>>>>>>> It would be helpful if you can include the exception,
> specifically the
> > >>>>>>>>>>> line it references, etc.
> > >>>>>>>>>>>
> > >>>>>>>>>>> chris
> > >>>>>>>>>>>
> > >>>>>>>>>>> PS the list is good, the IRC channel (irc.freenode.net
> #tapestry) is
> > >>>>>>>>>>> better ;-)
> > >>>>>>>>>>>
> > >>>>>>>>>>> Jan Vissers wrote:
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>> Yep, sure, I may I add - This mailing list is great and
> Tapestry rocks!
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>  <t:loop source="breadCrumbs" value="crumb"
> index="index">
> > >>>>>>>>>>>>     <t:if test="LastCrumb">
> > >>>>>>>>>>>>        ${crumb.name}
> > >>>>>>>>>>>>        <t:parameter name="else">
> > >>>>>>>>>>>>            <a href="#"
> > >>>>>>>>>>>> t:type="pageLink" ....>${crumb.name}</a>
> > >>>>>>>>>>>>               >
> > >>>>>>>>>>>>        </t:parameter>
> > >>>>>>>>>>>>     </t:if>
> > >>>>>>>>>>>> </t:loop>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> -J.
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>> Can you share some code? At least the relevant part
> from template would
> > >>>>>>>>>>>>> be helpful.
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>> chris
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>> Jan Vissers wrote:
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>> Hi,
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>> Just to make sure I'm not missing something.
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>> In T4 when I wrote a @For construct I could use
> value="..." as long as
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>> I
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>>>> provided a setter|getter pair for the class involved -
> in this case
> > >>>>>>>>>>>>>> BreadcrumbBean. I want to iterate over a list of beans
> and use each
> > >>>>>>>>>>>>>> instance individually. Now T5 throws up on me with
> this nice coercion
> > >>>>>>>>>>>>>> message. Does this mean I need to contribute my own
> coercion - or is
> > >>>>>>>>>>>>>> there a more simple way? In my case BreadcrumbBean is
> a simple class
> > >>>>>>>>>>>>>> holding three String members.
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>> Thanks (again :-))
> > >>>>>>>>>>>>>> -J.
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>> ------------------------------------------------------
> ---------------
> > >>>>>>>>>>>>>> To unsubscribe, e-mail: users-
> unsubscribe@tapestry.apache.org
> > >>>>>>>>>>>>>> For additional commands, e-mail: users-
> help@tapestry.apache.org
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>> --------------------------------------------------------
> -------------
> > >>>>>>>>>>>> To unsubscribe, e-mail: users-
> unsubscribe@tapestry.apache.org
> > >>>>>>>>>>>> For additional commands, e-mail: users-
> help@tapestry.apache.org
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>> --
> > >>>>>>>>>>> http://thegodcode.net
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>> -----------------------------------------------------------
> ----------
> > >>>>>>>>> To unsubscribe, e-mail: users-
> unsubscribe@tapestry.apache.org
> > >>>>>>>>> For additional commands, e-mail: users-
> help@tapestry.apache.org
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>> -------------------------------------------------------------
> --------
> > >>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>>>>>> For additional commands, e-mail: users-
> help@tapestry.apache.org
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>> ---------------------------------------------------------------
> ------
> > >>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>> ----------------------------------------------------------------
> -----
> > >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >> ------------------------------------------------------------------
> ---
> > >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>
> > >>
> > >>
> > >
> > >
> > > -------------------------------------------------------------------
> --
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> > >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Jan Vissers <Ja...@cumquat.nl>.
Spot on! Now I also understand why the .tml passing didn't work. This is
a great 'a-ha' moment for me!

-J.
On Fri, 2008-04-18 at 17:03 +0200, Chris Lewis wrote:
> Ok I think I see the problem. In your layout replace this:
> 
> t:breadCrumbs="${basePage.breadCrumbHolder.model}"
> 
> with this:
> 
> t:breadCrumbs="basePage.breadCrumbHolder.model"
> 
> Notice the lack of ${}. ${} is trying to convert it to a string, which
> it's not. When passing params to components you don't use expansions,
> what you want is the object property from the class. The default binding
> prefix for params is "prop" which is what you want in this case.
> 
> Jan Vissers wrote:
> > I think I'm getting a bit further now - sorry to spam this list by the
> > way...
> >
> > If I pass the breadCrumb model in the Component class instead via the
> > Component Template something is happening.
> >
> > So instead of:
> > <t:heading t:id="heading"
> > t:breadCrumbs="${basePage.breadCrumbHolder.model}" />
> >
> > I do in .java
> > @Component(inheritInformalParameters = true, parameters =
> > { "loginPage=inherit:loginPage","breadCrumbs=basePage.breadCrumbHolder.model" })
> >
> >
> >
> > On Fri, 2008-04-18 at 16:47 +0200, Jan Vissers wrote:
> >   
> >> The layout component that passes in the 'breadCrumb' model to the
> >> 'heading' component which should render the breadcrumbs...
> >>
> >>
> >> <?xml version="1.0" encoding="utf-8"?>
> >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> >> <html xmlns="http://www.w3.org/1999/xhtml"
> >> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> >>     <head>
> >>         <meta http-equiv="Content-Type"
> >> content="text/html;charset=utf-8" />
> >>         <link rel="shortcut icon" href="favicon.ico" />
> >>         <title>${title}</title>
> >>     </head>
> >>     <body>
> >>         <div id="container">
> >>             <t:branding t:id="branding" />
> >>             <t:heading t:id="heading"
> >> t:breadCrumbs="${basePage.breadCrumbHolder.model}" />
> >>             <t:body />
> >>             <t:copyright t:id="copyright" />
> >>         </div>
> >>     </body>
> >> </html>
> >>
> >> On Fri, 2008-04-18 at 16:43 +0200, Chris Lewis wrote:
> >>     
> >>> And that is the part I want to see, from the template code which you
> >>> still haven't shared ;-). What I'm referring to is your .tml file where
> >>> you use this component.
> >>>
> >>> Jan Vissers wrote:
> >>>       
> >>>> In the snippet below if I change:
> >>>>     public List<BreadcrumbBean> getBreadCrumbs()
> >>>>
> >>>> and let it return a freshly created list. The loop construct works.
> >>>> However via the @Parameter (passing it it) doesn't.
> >>>>
> >>>> -J.
> >>>>
> >>>>
> >>>> On Fri, 2008-04-18 at 16:27 +0200, Jan Vissers wrote:
> >>>>   
> >>>>         
> >>>>> Here it is:
> >>>>>
> >>>>> import java.util.List;
> >>>>>
> >>>>> import org.apache.log4j.Logger;
> >>>>> import org.apache.tapestry.annotations.Parameter;
> >>>>>
> >>>>> import com.philips.lighting.guidecontrol.view.BreadcrumbBean;
> >>>>>
> >>>>> /**
> >>>>>  * The heading component holds the following pieces of Heading
> >>>>> information.
> >>>>>  * 
> >>>>>  * <pre>
> >>>>>  *    &lt;div id=&quot;heading&quot;&gt;
> >>>>>  *      &lt;ul id=&quot;breadcrumbs&quot;&gt;
> >>>>>  *           &lt;li
> >>>>> id=&quot;prefix&quot;&gt;[ &amp;aposyou-are-here&amp;apos ]&gt;/li&gt;
> >>>>>  *           { when loginPage }
> >>>>>  *               &lt;li&gt;&amp;aposlogin-page&amp;apos&lt;/li&gt;
> >>>>>  *           { when not loginPage }
> >>>>>  *               { for all crumbs }
> >>>>>  *                   { if crumb is last }
> >>>>>  *                       &lt;li&gt;[ crumb text ]&lt;/li&gt;
> >>>>>  *                   { if crumb is not last }
> >>>>>  *                       &lt;li&gt;&lt;a href=&quot;[ crumb
> >>>>> link ]&quot;&gt;[ crumb text ]&lt;/a&gt; &gt; &lt;/li&gt;
> >>>>>  *      &lt;/ul&gt;
> >>>>>  *    &lt;/div&gt;
> >>>>>  * </pre>
> >>>>>  * 
> >>>>>  * @author Cumquat Information Technology
> >>>>>  * 
> >>>>>  */
> >>>>> public class Heading {
> >>>>>     private static final Logger logger =
> >>>>> Logger.getLogger(Heading.class);
> >>>>>     
> >>>>>     @Parameter
> >>>>>     private boolean loginPage = false;
> >>>>>
> >>>>>     @Parameter
> >>>>>     private List<BreadcrumbBean> breadCrumbs;
> >>>>>
> >>>>>     private int index;
> >>>>>
> >>>>>     private BreadcrumbBean crumb;
> >>>>>
> >>>>>     public boolean isLoginPage() {
> >>>>>         return loginPage;
> >>>>>     }
> >>>>>
> >>>>>     public List<BreadcrumbBean> getBreadCrumbs() {
> >>>>>         return breadCrumbs;
> >>>>>     }
> >>>>>
> >>>>>     public void setBreadCrumbs(List<BreadcrumbBean> breadCrumbs) {
> >>>>>         logger.debug("Setting breadcrumbs: "+breadCrumbs);
> >>>>>         this.breadCrumbs = breadCrumbs;
> >>>>>     }
> >>>>>
> >>>>>     public int getIndex() {
> >>>>>         return index;
> >>>>>     }
> >>>>>
> >>>>>     public void setIndex(int index) {
> >>>>>         this.index = index;
> >>>>>     }
> >>>>>
> >>>>>     public BreadcrumbBean getCrumb() {
> >>>>>         return crumb;
> >>>>>     }
> >>>>>
> >>>>>     public void setCrumb(BreadcrumbBean crumb) {
> >>>>>         this.crumb = crumb;
> >>>>>     }
> >>>>>
> >>>>>     public boolean isLastCrumb() {
> >>>>>         return (index == breadCrumbs.size() - 1);
> >>>>>     }
> >>>>>     
> >>>>> }
> >>>>>
> >>>>> On Fri, 2008-04-18 at 16:22 +0200, Chris Lewis wrote:
> >>>>>     
> >>>>>           
> >>>>>> We still haven't seen your template code, where you declare this
> >>>>>> component and pass it the model. I can't be sure but perhaps it will
> >>>>>> shed some light...
> >>>>>>
> >>>>>> Jan Vissers wrote:
> >>>>>>       
> >>>>>>             
> >>>>>>> The problem is somehow related to the way my page and component are
> >>>>>>> hooked up/working.
> >>>>>>>
> >>>>>>> For testing purposes I now create the Breadcrumb list in the component
> >>>>>>> itself, simply returning a created list on the fly whenever
> >>>>>>> getBreadCrumbs() is called. This works as expected!!!
> >>>>>>>
> >>>>>>> Strange thing is that via passing the 'model' to the component via a
> >>>>>>> page binding the same thing doesn't work. This must be a bug?!
> >>>>>>>
> >>>>>>> -J.
> >>>>>>>
> >>>>>>> On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
> >>>>>>>   
> >>>>>>>         
> >>>>>>>               
> >>>>>>>> That looks good to me. I don't have an example I can look at with a
> >>>>>>>> loop, but I do have one with a t:grid in which I reference a bean
> >>>>>>>> property of a custom class. It's possible that the two are vastly
> >>>>>>>> different, but I wouldn't think that.
> >>>>>>>>
> >>>>>>>> Jan Vissers wrote:
> >>>>>>>>     
> >>>>>>>>           
> >>>>>>>>                 
> >>>>>>>>> On the component I have:
> >>>>>>>>>
> >>>>>>>>>     @Parameter
> >>>>>>>>>     private List<BreadcrumbBean> breadCrumbs;
> >>>>>>>>>
> >>>>>>>>> This is passed in via the containg (base)page.
> >>>>>>>>> And in the same component class I have:
> >>>>>>>>>
> >>>>>>>>>     private BreadcrumbBean crumb;
> >>>>>>>>>
> >>>>>>>>>     public BreadcrumbBean getCrumb() {
> >>>>>>>>>         return crumb;
> >>>>>>>>>     }
> >>>>>>>>>
> >>>>>>>>>     public void setCrumb(BreadcrumbBean crumb) {
> >>>>>>>>>         this.crumb = crumb;
> >>>>>>>>>     }
> >>>>>>>>>
> >>>>>>>>> This should be right, right?
> >>>>>>>>>
> >>>>>>>>> -J.
> >>>>>>>>>
> >>>>>>>>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
> >>>>>>>>>   
> >>>>>>>>>       
> >>>>>>>>>             
> >>>>>>>>>                   
> >>>>>>>>>> ? is your crumb property of type BreadCrumbBean, or is it type String?
> >>>>>>>>>> should be same as breadCrumbs<?TYPE>
> >>>>>>>>>>
> >>>>>>>>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
> >>>>>>>>>> wrote:
> >>>>>>>>>>
> >>>>>>>>>>     
> >>>>>>>>>>         
> >>>>>>>>>>               
> >>>>>>>>>>                     
> >>>>>>>>>>> I can't speak about your t:if bit because I don't know what "LastCrumb"
> >>>>>>>>>>> would be, but assuming that your page class has getters/setters (or the
> >>>>>>>>>>> property is annotated with @Property) for the "crumb" property, a getter
> >>>>>>>>>>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
> >>>>>>>>>>> you *should* be good.
> >>>>>>>>>>>
> >>>>>>>>>>> It would be helpful if you can include the exception, specifically the
> >>>>>>>>>>> line it references, etc.
> >>>>>>>>>>>
> >>>>>>>>>>> chris
> >>>>>>>>>>>
> >>>>>>>>>>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
> >>>>>>>>>>> better ;-)
> >>>>>>>>>>>
> >>>>>>>>>>> Jan Vissers wrote:
> >>>>>>>>>>>       
> >>>>>>>>>>>           
> >>>>>>>>>>>                 
> >>>>>>>>>>>                       
> >>>>>>>>>>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
> >>>>>>>>>>>>
> >>>>>>>>>>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
> >>>>>>>>>>>>     <t:if test="LastCrumb">
> >>>>>>>>>>>>        ${crumb.name}
> >>>>>>>>>>>>        <t:parameter name="else">
> >>>>>>>>>>>>            <a href="#"
> >>>>>>>>>>>> t:type="pageLink" ....>${crumb.name}</a>
> >>>>>>>>>>>>               >
> >>>>>>>>>>>>        </t:parameter>
> >>>>>>>>>>>>     </t:if>
> >>>>>>>>>>>> </t:loop>
> >>>>>>>>>>>>
> >>>>>>>>>>>> -J.
> >>>>>>>>>>>>
> >>>>>>>>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
> >>>>>>>>>>>>
> >>>>>>>>>>>>         
> >>>>>>>>>>>>             
> >>>>>>>>>>>>                   
> >>>>>>>>>>>>                         
> >>>>>>>>>>>>> Can you share some code? At least the relevant part from template would
> >>>>>>>>>>>>> be helpful.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> chris
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Jan Vissers wrote:
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>           
> >>>>>>>>>>>>>               
> >>>>>>>>>>>>>                     
> >>>>>>>>>>>>>                           
> >>>>>>>>>>>>>> Hi,
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Just to make sure I'm not missing something.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
> >>>>>>>>>>>>>>             
> >>>>>>>>>>>>>>                 
> >>>>>>>>>>>>>>                       
> >>>>>>>>>>>>>>                             
> >>>>>>>>>>> I
> >>>>>>>>>>>       
> >>>>>>>>>>>           
> >>>>>>>>>>>                 
> >>>>>>>>>>>                       
> >>>>>>>>>>>>>> provided a setter|getter pair for the class involved - in this case
> >>>>>>>>>>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
> >>>>>>>>>>>>>> instance individually. Now T5 throws up on me with this nice coercion
> >>>>>>>>>>>>>> message. Does this mean I need to contribute my own coercion - or is
> >>>>>>>>>>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
> >>>>>>>>>>>>>> holding three String members.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Thanks (again :-))
> >>>>>>>>>>>>>> -J.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>             
> >>>>>>>>>>>>>>                 
> >>>>>>>>>>>>>>                       
> >>>>>>>>>>>>>>                             
> >>>>>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>         
> >>>>>>>>>>>>             
> >>>>>>>>>>>>                   
> >>>>>>>>>>>>                         
> >>>>>>>>>>> --
> >>>>>>>>>>> http://thegodcode.net
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>       
> >>>>>>>>>>>           
> >>>>>>>>>>>                 
> >>>>>>>>>>>                       
> >>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>   
> >>>>>>>>>       
> >>>>>>>>>             
> >>>>>>>>>                   
> >>>>>>> ---------------------------------------------------------------------
> >>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>
> >>>>>>>
> >>>>>>>   
> >>>>>>>         
> >>>>>>>               
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>
> >>>>>
> >>>>>     
> >>>>>           
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>
> >>>>
> >>>>   
> >>>>         
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >>     
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >   
> 


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Chris Lewis <ch...@bellsouth.net>.
Ok I think I see the problem. In your layout replace this:

t:breadCrumbs="${basePage.breadCrumbHolder.model}"

with this:

t:breadCrumbs="basePage.breadCrumbHolder.model"

Notice the lack of ${}. ${} is trying to convert it to a string, which
it's not. When passing params to components you don't use expansions,
what you want is the object property from the class. The default binding
prefix for params is "prop" which is what you want in this case.

Jan Vissers wrote:
> I think I'm getting a bit further now - sorry to spam this list by the
> way...
>
> If I pass the breadCrumb model in the Component class instead via the
> Component Template something is happening.
>
> So instead of:
> <t:heading t:id="heading"
> t:breadCrumbs="${basePage.breadCrumbHolder.model}" />
>
> I do in .java
> @Component(inheritInformalParameters = true, parameters =
> { "loginPage=inherit:loginPage","breadCrumbs=basePage.breadCrumbHolder.model" })
>
>
>
> On Fri, 2008-04-18 at 16:47 +0200, Jan Vissers wrote:
>   
>> The layout component that passes in the 'breadCrumb' model to the
>> 'heading' component which should render the breadcrumbs...
>>
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>> <html xmlns="http://www.w3.org/1999/xhtml"
>> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>>     <head>
>>         <meta http-equiv="Content-Type"
>> content="text/html;charset=utf-8" />
>>         <link rel="shortcut icon" href="favicon.ico" />
>>         <title>${title}</title>
>>     </head>
>>     <body>
>>         <div id="container">
>>             <t:branding t:id="branding" />
>>             <t:heading t:id="heading"
>> t:breadCrumbs="${basePage.breadCrumbHolder.model}" />
>>             <t:body />
>>             <t:copyright t:id="copyright" />
>>         </div>
>>     </body>
>> </html>
>>
>> On Fri, 2008-04-18 at 16:43 +0200, Chris Lewis wrote:
>>     
>>> And that is the part I want to see, from the template code which you
>>> still haven't shared ;-). What I'm referring to is your .tml file where
>>> you use this component.
>>>
>>> Jan Vissers wrote:
>>>       
>>>> In the snippet below if I change:
>>>>     public List<BreadcrumbBean> getBreadCrumbs()
>>>>
>>>> and let it return a freshly created list. The loop construct works.
>>>> However via the @Parameter (passing it it) doesn't.
>>>>
>>>> -J.
>>>>
>>>>
>>>> On Fri, 2008-04-18 at 16:27 +0200, Jan Vissers wrote:
>>>>   
>>>>         
>>>>> Here it is:
>>>>>
>>>>> import java.util.List;
>>>>>
>>>>> import org.apache.log4j.Logger;
>>>>> import org.apache.tapestry.annotations.Parameter;
>>>>>
>>>>> import com.philips.lighting.guidecontrol.view.BreadcrumbBean;
>>>>>
>>>>> /**
>>>>>  * The heading component holds the following pieces of Heading
>>>>> information.
>>>>>  * 
>>>>>  * <pre>
>>>>>  *    &lt;div id=&quot;heading&quot;&gt;
>>>>>  *      &lt;ul id=&quot;breadcrumbs&quot;&gt;
>>>>>  *           &lt;li
>>>>> id=&quot;prefix&quot;&gt;[ &amp;aposyou-are-here&amp;apos ]&gt;/li&gt;
>>>>>  *           { when loginPage }
>>>>>  *               &lt;li&gt;&amp;aposlogin-page&amp;apos&lt;/li&gt;
>>>>>  *           { when not loginPage }
>>>>>  *               { for all crumbs }
>>>>>  *                   { if crumb is last }
>>>>>  *                       &lt;li&gt;[ crumb text ]&lt;/li&gt;
>>>>>  *                   { if crumb is not last }
>>>>>  *                       &lt;li&gt;&lt;a href=&quot;[ crumb
>>>>> link ]&quot;&gt;[ crumb text ]&lt;/a&gt; &gt; &lt;/li&gt;
>>>>>  *      &lt;/ul&gt;
>>>>>  *    &lt;/div&gt;
>>>>>  * </pre>
>>>>>  * 
>>>>>  * @author Cumquat Information Technology
>>>>>  * 
>>>>>  */
>>>>> public class Heading {
>>>>>     private static final Logger logger =
>>>>> Logger.getLogger(Heading.class);
>>>>>     
>>>>>     @Parameter
>>>>>     private boolean loginPage = false;
>>>>>
>>>>>     @Parameter
>>>>>     private List<BreadcrumbBean> breadCrumbs;
>>>>>
>>>>>     private int index;
>>>>>
>>>>>     private BreadcrumbBean crumb;
>>>>>
>>>>>     public boolean isLoginPage() {
>>>>>         return loginPage;
>>>>>     }
>>>>>
>>>>>     public List<BreadcrumbBean> getBreadCrumbs() {
>>>>>         return breadCrumbs;
>>>>>     }
>>>>>
>>>>>     public void setBreadCrumbs(List<BreadcrumbBean> breadCrumbs) {
>>>>>         logger.debug("Setting breadcrumbs: "+breadCrumbs);
>>>>>         this.breadCrumbs = breadCrumbs;
>>>>>     }
>>>>>
>>>>>     public int getIndex() {
>>>>>         return index;
>>>>>     }
>>>>>
>>>>>     public void setIndex(int index) {
>>>>>         this.index = index;
>>>>>     }
>>>>>
>>>>>     public BreadcrumbBean getCrumb() {
>>>>>         return crumb;
>>>>>     }
>>>>>
>>>>>     public void setCrumb(BreadcrumbBean crumb) {
>>>>>         this.crumb = crumb;
>>>>>     }
>>>>>
>>>>>     public boolean isLastCrumb() {
>>>>>         return (index == breadCrumbs.size() - 1);
>>>>>     }
>>>>>     
>>>>> }
>>>>>
>>>>> On Fri, 2008-04-18 at 16:22 +0200, Chris Lewis wrote:
>>>>>     
>>>>>           
>>>>>> We still haven't seen your template code, where you declare this
>>>>>> component and pass it the model. I can't be sure but perhaps it will
>>>>>> shed some light...
>>>>>>
>>>>>> Jan Vissers wrote:
>>>>>>       
>>>>>>             
>>>>>>> The problem is somehow related to the way my page and component are
>>>>>>> hooked up/working.
>>>>>>>
>>>>>>> For testing purposes I now create the Breadcrumb list in the component
>>>>>>> itself, simply returning a created list on the fly whenever
>>>>>>> getBreadCrumbs() is called. This works as expected!!!
>>>>>>>
>>>>>>> Strange thing is that via passing the 'model' to the component via a
>>>>>>> page binding the same thing doesn't work. This must be a bug?!
>>>>>>>
>>>>>>> -J.
>>>>>>>
>>>>>>> On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
>>>>>>>   
>>>>>>>         
>>>>>>>               
>>>>>>>> That looks good to me. I don't have an example I can look at with a
>>>>>>>> loop, but I do have one with a t:grid in which I reference a bean
>>>>>>>> property of a custom class. It's possible that the two are vastly
>>>>>>>> different, but I wouldn't think that.
>>>>>>>>
>>>>>>>> Jan Vissers wrote:
>>>>>>>>     
>>>>>>>>           
>>>>>>>>                 
>>>>>>>>> On the component I have:
>>>>>>>>>
>>>>>>>>>     @Parameter
>>>>>>>>>     private List<BreadcrumbBean> breadCrumbs;
>>>>>>>>>
>>>>>>>>> This is passed in via the containg (base)page.
>>>>>>>>> And in the same component class I have:
>>>>>>>>>
>>>>>>>>>     private BreadcrumbBean crumb;
>>>>>>>>>
>>>>>>>>>     public BreadcrumbBean getCrumb() {
>>>>>>>>>         return crumb;
>>>>>>>>>     }
>>>>>>>>>
>>>>>>>>>     public void setCrumb(BreadcrumbBean crumb) {
>>>>>>>>>         this.crumb = crumb;
>>>>>>>>>     }
>>>>>>>>>
>>>>>>>>> This should be right, right?
>>>>>>>>>
>>>>>>>>> -J.
>>>>>>>>>
>>>>>>>>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
>>>>>>>>>   
>>>>>>>>>       
>>>>>>>>>             
>>>>>>>>>                   
>>>>>>>>>> ? is your crumb property of type BreadCrumbBean, or is it type String?
>>>>>>>>>> should be same as breadCrumbs<?TYPE>
>>>>>>>>>>
>>>>>>>>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>     
>>>>>>>>>>         
>>>>>>>>>>               
>>>>>>>>>>                     
>>>>>>>>>>> I can't speak about your t:if bit because I don't know what "LastCrumb"
>>>>>>>>>>> would be, but assuming that your page class has getters/setters (or the
>>>>>>>>>>> property is annotated with @Property) for the "crumb" property, a getter
>>>>>>>>>>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
>>>>>>>>>>> you *should* be good.
>>>>>>>>>>>
>>>>>>>>>>> It would be helpful if you can include the exception, specifically the
>>>>>>>>>>> line it references, etc.
>>>>>>>>>>>
>>>>>>>>>>> chris
>>>>>>>>>>>
>>>>>>>>>>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
>>>>>>>>>>> better ;-)
>>>>>>>>>>>
>>>>>>>>>>> Jan Vissers wrote:
>>>>>>>>>>>       
>>>>>>>>>>>           
>>>>>>>>>>>                 
>>>>>>>>>>>                       
>>>>>>>>>>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
>>>>>>>>>>>>
>>>>>>>>>>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
>>>>>>>>>>>>     <t:if test="LastCrumb">
>>>>>>>>>>>>        ${crumb.name}
>>>>>>>>>>>>        <t:parameter name="else">
>>>>>>>>>>>>            <a href="#"
>>>>>>>>>>>> t:type="pageLink" ....>${crumb.name}</a>
>>>>>>>>>>>>               >
>>>>>>>>>>>>        </t:parameter>
>>>>>>>>>>>>     </t:if>
>>>>>>>>>>>> </t:loop>
>>>>>>>>>>>>
>>>>>>>>>>>> -J.
>>>>>>>>>>>>
>>>>>>>>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>         
>>>>>>>>>>>>             
>>>>>>>>>>>>                   
>>>>>>>>>>>>                         
>>>>>>>>>>>>> Can you share some code? At least the relevant part from template would
>>>>>>>>>>>>> be helpful.
>>>>>>>>>>>>>
>>>>>>>>>>>>> chris
>>>>>>>>>>>>>
>>>>>>>>>>>>> Jan Vissers wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>           
>>>>>>>>>>>>>               
>>>>>>>>>>>>>                     
>>>>>>>>>>>>>                           
>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Just to make sure I'm not missing something.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
>>>>>>>>>>>>>>             
>>>>>>>>>>>>>>                 
>>>>>>>>>>>>>>                       
>>>>>>>>>>>>>>                             
>>>>>>>>>>> I
>>>>>>>>>>>       
>>>>>>>>>>>           
>>>>>>>>>>>                 
>>>>>>>>>>>                       
>>>>>>>>>>>>>> provided a setter|getter pair for the class involved - in this case
>>>>>>>>>>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
>>>>>>>>>>>>>> instance individually. Now T5 throws up on me with this nice coercion
>>>>>>>>>>>>>> message. Does this mean I need to contribute my own coercion - or is
>>>>>>>>>>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
>>>>>>>>>>>>>> holding three String members.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks (again :-))
>>>>>>>>>>>>>> -J.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>             
>>>>>>>>>>>>>>                 
>>>>>>>>>>>>>>                       
>>>>>>>>>>>>>>                             
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>         
>>>>>>>>>>>>             
>>>>>>>>>>>>                   
>>>>>>>>>>>>                         
>>>>>>>>>>> --
>>>>>>>>>>> http://thegodcode.net
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>       
>>>>>>>>>>>           
>>>>>>>>>>>                 
>>>>>>>>>>>                       
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   
>>>>>>>>>       
>>>>>>>>>             
>>>>>>>>>                   
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>>   
>>>>>>>         
>>>>>>>               
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>     
>>>>>           
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>   
>>>>         
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

-- 
http://thegodcode.net


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Robert Zeigler <ro...@scazdl.org>.
On Apr 18, 2008, at 4/189:56 AM , Jan Vissers wrote:
> I think I'm getting a bit further now - sorry to spam this list by the
> way...
>
> If I pass the breadCrumb model in the Component class instead via the
> Component Template something is happening.
>
> So instead of:
> <t:heading t:id="heading"
> t:breadCrumbs="${basePage.breadCrumbHolder.model}" />
>
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Using the default @Parameter, this should just be:
t:breadCrumbs="basePage.breadCrumbHolder.model".

Default binding type is "prop", so the ${} bit is unneeded.

If your loop is in a form, then you should  pass "volatile=true".

Cheers,

Robert

> I do in .java
> @Component(inheritInformalParameters = true, parameters =
> { "loginPage
> =inherit:loginPage","breadCrumbs=basePage.breadCrumbHolder.model" })
>
>
>
> On Fri, 2008-04-18 at 16:47 +0200, Jan Vissers wrote:
>> The layout component that passes in the 'breadCrumb' model to the
>> 'heading' component which should render the breadcrumbs...
>>
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>> <html xmlns="http://www.w3.org/1999/xhtml"
>> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>>    <head>
>>        <meta http-equiv="Content-Type"
>> content="text/html;charset=utf-8" />
>>        <link rel="shortcut icon" href="favicon.ico" />
>>        <title>${title}</title>
>>    </head>
>>    <body>
>>        <div id="container">
>>            <t:branding t:id="branding" />
>>            <t:heading t:id="heading"
>> t:breadCrumbs="${basePage.breadCrumbHolder.model}" />
>>            <t:body />
>>            <t:copyright t:id="copyright" />
>>        </div>
>>    </body>
>> </html>
>>
>> On Fri, 2008-04-18 at 16:43 +0200, Chris Lewis wrote:
>>> And that is the part I want to see, from the template code which you
>>> still haven't shared ;-). What I'm referring to is your .tml file  
>>> where
>>> you use this component.
>>>
>>> Jan Vissers wrote:
>>>> In the snippet below if I change:
>>>>    public List<BreadcrumbBean> getBreadCrumbs()
>>>>
>>>> and let it return a freshly created list. The loop construct works.
>>>> However via the @Parameter (passing it it) doesn't.
>>>>
>>>> -J.
>>>>
>>>>
>>>> On Fri, 2008-04-18 at 16:27 +0200, Jan Vissers wrote:
>>>>
>>>>> Here it is:
>>>>>
>>>>> import java.util.List;
>>>>>
>>>>> import org.apache.log4j.Logger;
>>>>> import org.apache.tapestry.annotations.Parameter;
>>>>>
>>>>> import com.philips.lighting.guidecontrol.view.BreadcrumbBean;
>>>>>
>>>>> /**
>>>>> * The heading component holds the following pieces of Heading
>>>>> information.
>>>>> *
>>>>> * <pre>
>>>>> *    &lt;div id=&quot;heading&quot;&gt;
>>>>> *      &lt;ul id=&quot;breadcrumbs&quot;&gt;
>>>>> *           &lt;li
>>>>> id=&quot;prefix&quot;&gt;[ &amp;aposyou-are-here&amp;apos ]&gt;/ 
>>>>> li&gt;
>>>>> *           { when loginPage }
>>>>> *               &lt;li&gt;&amp;aposlogin-page&amp;apos&lt;/li&gt;
>>>>> *           { when not loginPage }
>>>>> *               { for all crumbs }
>>>>> *                   { if crumb is last }
>>>>> *                       &lt;li&gt;[ crumb text ]&lt;/li&gt;
>>>>> *                   { if crumb is not last }
>>>>> *                       &lt;li&gt;&lt;a href=&quot;[ crumb
>>>>> link ]&quot;&gt;[ crumb text ]&lt;/a&gt; &gt; &lt;/li&gt;
>>>>> *      &lt;/ul&gt;
>>>>> *    &lt;/div&gt;
>>>>> * </pre>
>>>>> *
>>>>> * @author Cumquat Information Technology
>>>>> *
>>>>> */
>>>>> public class Heading {
>>>>>    private static final Logger logger =
>>>>> Logger.getLogger(Heading.class);
>>>>>
>>>>>    @Parameter
>>>>>    private boolean loginPage = false;
>>>>>
>>>>>    @Parameter
>>>>>    private List<BreadcrumbBean> breadCrumbs;
>>>>>
>>>>>    private int index;
>>>>>
>>>>>    private BreadcrumbBean crumb;
>>>>>
>>>>>    public boolean isLoginPage() {
>>>>>        return loginPage;
>>>>>    }
>>>>>
>>>>>    public List<BreadcrumbBean> getBreadCrumbs() {
>>>>>        return breadCrumbs;
>>>>>    }
>>>>>
>>>>>    public void setBreadCrumbs(List<BreadcrumbBean> breadCrumbs) {
>>>>>        logger.debug("Setting breadcrumbs: "+breadCrumbs);
>>>>>        this.breadCrumbs = breadCrumbs;
>>>>>    }
>>>>>
>>>>>    public int getIndex() {
>>>>>        return index;
>>>>>    }
>>>>>
>>>>>    public void setIndex(int index) {
>>>>>        this.index = index;
>>>>>    }
>>>>>
>>>>>    public BreadcrumbBean getCrumb() {
>>>>>        return crumb;
>>>>>    }
>>>>>
>>>>>    public void setCrumb(BreadcrumbBean crumb) {
>>>>>        this.crumb = crumb;
>>>>>    }
>>>>>
>>>>>    public boolean isLastCrumb() {
>>>>>        return (index == breadCrumbs.size() - 1);
>>>>>    }
>>>>>
>>>>> }
>>>>>
>>>>> On Fri, 2008-04-18 at 16:22 +0200, Chris Lewis wrote:
>>>>>
>>>>>> We still haven't seen your template code, where you declare this
>>>>>> component and pass it the model. I can't be sure but perhaps it  
>>>>>> will
>>>>>> shed some light...
>>>>>>
>>>>>> Jan Vissers wrote:
>>>>>>
>>>>>>> The problem is somehow related to the way my page and  
>>>>>>> component are
>>>>>>> hooked up/working.
>>>>>>>
>>>>>>> For testing purposes I now create the Breadcrumb list in the  
>>>>>>> component
>>>>>>> itself, simply returning a created list on the fly whenever
>>>>>>> getBreadCrumbs() is called. This works as expected!!!
>>>>>>>
>>>>>>> Strange thing is that via passing the 'model' to the component  
>>>>>>> via a
>>>>>>> page binding the same thing doesn't work. This must be a bug?!
>>>>>>>
>>>>>>> -J.
>>>>>>>
>>>>>>> On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
>>>>>>>
>>>>>>>
>>>>>>>> That looks good to me. I don't have an example I can look at  
>>>>>>>> with a
>>>>>>>> loop, but I do have one with a t:grid in which I reference a  
>>>>>>>> bean
>>>>>>>> property of a custom class. It's possible that the two are  
>>>>>>>> vastly
>>>>>>>> different, but I wouldn't think that.
>>>>>>>>
>>>>>>>> Jan Vissers wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>> On the component I have:
>>>>>>>>>
>>>>>>>>>    @Parameter
>>>>>>>>>    private List<BreadcrumbBean> breadCrumbs;
>>>>>>>>>
>>>>>>>>> This is passed in via the containg (base)page.
>>>>>>>>> And in the same component class I have:
>>>>>>>>>
>>>>>>>>>    private BreadcrumbBean crumb;
>>>>>>>>>
>>>>>>>>>    public BreadcrumbBean getCrumb() {
>>>>>>>>>        return crumb;
>>>>>>>>>    }
>>>>>>>>>
>>>>>>>>>    public void setCrumb(BreadcrumbBean crumb) {
>>>>>>>>>        this.crumb = crumb;
>>>>>>>>>    }
>>>>>>>>>
>>>>>>>>> This should be right, right?
>>>>>>>>>
>>>>>>>>> -J.
>>>>>>>>>
>>>>>>>>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> ? is your crumb property of type BreadCrumbBean, or is it  
>>>>>>>>>> type String?
>>>>>>>>>> should be same as breadCrumbs<?TYPE>
>>>>>>>>>>
>>>>>>>>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <chris_lewis@bellsouth.net 
>>>>>>>>>> >
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> I can't speak about your t:if bit because I don't know  
>>>>>>>>>>> what "LastCrumb"
>>>>>>>>>>> would be, but assuming that your page class has getters/ 
>>>>>>>>>>> setters (or the
>>>>>>>>>>> property is annotated with @Property) for the "crumb"  
>>>>>>>>>>> property, a getter
>>>>>>>>>>> for your "breadCrumbs," and your crumb bean defines a  
>>>>>>>>>>> "getName" method,
>>>>>>>>>>> you *should* be good.
>>>>>>>>>>>
>>>>>>>>>>> It would be helpful if you can include the exception,  
>>>>>>>>>>> specifically the
>>>>>>>>>>> line it references, etc.
>>>>>>>>>>>
>>>>>>>>>>> chris
>>>>>>>>>>>
>>>>>>>>>>> PS the list is good, the IRC channel (irc.freenode.net  
>>>>>>>>>>> #tapestry) is
>>>>>>>>>>> better ;-)
>>>>>>>>>>>
>>>>>>>>>>> Jan Vissers wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> Yep, sure, I may I add - This mailing list is great and  
>>>>>>>>>>>> Tapestry rocks!
>>>>>>>>>>>>
>>>>>>>>>>>> <t:loop source="breadCrumbs" value="crumb" index="index">
>>>>>>>>>>>>    <t:if test="LastCrumb">
>>>>>>>>>>>>       ${crumb.name}
>>>>>>>>>>>>       <t:parameter name="else">
>>>>>>>>>>>>           <a href="#"
>>>>>>>>>>>> t:type="pageLink" ....>${crumb.name}</a>
>>>>>>>>>>>>>
>>>>>>>>>>>>       </t:parameter>
>>>>>>>>>>>>    </t:if>
>>>>>>>>>>>> </t:loop>
>>>>>>>>>>>>
>>>>>>>>>>>> -J.
>>>>>>>>>>>>
>>>>>>>>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> Can you share some code? At least the relevant part from  
>>>>>>>>>>>>> template would
>>>>>>>>>>>>> be helpful.
>>>>>>>>>>>>>
>>>>>>>>>>>>> chris
>>>>>>>>>>>>>
>>>>>>>>>>>>> Jan Vissers wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Just to make sure I'm not missing something.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> In T4 when I wrote a @For construct I could use  
>>>>>>>>>>>>>> value="..." as long as
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>> I
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>>> provided a setter|getter pair for the class involved -  
>>>>>>>>>>>>>> in this case
>>>>>>>>>>>>>> BreadcrumbBean. I want to iterate over a list of beans  
>>>>>>>>>>>>>> and use each
>>>>>>>>>>>>>> instance individually. Now T5 throws up on me with this  
>>>>>>>>>>>>>> nice coercion
>>>>>>>>>>>>>> message. Does this mean I need to contribute my own  
>>>>>>>>>>>>>> coercion - or is
>>>>>>>>>>>>>> there a more simple way? In my case BreadcrumbBean is a  
>>>>>>>>>>>>>> simple class
>>>>>>>>>>>>>> holding three String members.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks (again :-))
>>>>>>>>>>>>>> -J.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> http://thegodcode.net
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users- 
>>>>>>>>> help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Jan Vissers <Ja...@cumquat.nl>.
I think I'm getting a bit further now - sorry to spam this list by the
way...

If I pass the breadCrumb model in the Component class instead via the
Component Template something is happening.

So instead of:
<t:heading t:id="heading"
t:breadCrumbs="${basePage.breadCrumbHolder.model}" />

I do in .java
@Component(inheritInformalParameters = true, parameters =
{ "loginPage=inherit:loginPage","breadCrumbs=basePage.breadCrumbHolder.model" })



On Fri, 2008-04-18 at 16:47 +0200, Jan Vissers wrote:
> The layout component that passes in the 'breadCrumb' model to the
> 'heading' component which should render the breadcrumbs...
> 
> 
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>     <head>
>         <meta http-equiv="Content-Type"
> content="text/html;charset=utf-8" />
>         <link rel="shortcut icon" href="favicon.ico" />
>         <title>${title}</title>
>     </head>
>     <body>
>         <div id="container">
>             <t:branding t:id="branding" />
>             <t:heading t:id="heading"
> t:breadCrumbs="${basePage.breadCrumbHolder.model}" />
>             <t:body />
>             <t:copyright t:id="copyright" />
>         </div>
>     </body>
> </html>
> 
> On Fri, 2008-04-18 at 16:43 +0200, Chris Lewis wrote:
> > And that is the part I want to see, from the template code which you
> > still haven't shared ;-). What I'm referring to is your .tml file where
> > you use this component.
> > 
> > Jan Vissers wrote:
> > > In the snippet below if I change:
> > >     public List<BreadcrumbBean> getBreadCrumbs()
> > >
> > > and let it return a freshly created list. The loop construct works.
> > > However via the @Parameter (passing it it) doesn't.
> > >
> > > -J.
> > >
> > >
> > > On Fri, 2008-04-18 at 16:27 +0200, Jan Vissers wrote:
> > >   
> > >> Here it is:
> > >>
> > >> import java.util.List;
> > >>
> > >> import org.apache.log4j.Logger;
> > >> import org.apache.tapestry.annotations.Parameter;
> > >>
> > >> import com.philips.lighting.guidecontrol.view.BreadcrumbBean;
> > >>
> > >> /**
> > >>  * The heading component holds the following pieces of Heading
> > >> information.
> > >>  * 
> > >>  * <pre>
> > >>  *    &lt;div id=&quot;heading&quot;&gt;
> > >>  *      &lt;ul id=&quot;breadcrumbs&quot;&gt;
> > >>  *           &lt;li
> > >> id=&quot;prefix&quot;&gt;[ &amp;aposyou-are-here&amp;apos ]&gt;/li&gt;
> > >>  *           { when loginPage }
> > >>  *               &lt;li&gt;&amp;aposlogin-page&amp;apos&lt;/li&gt;
> > >>  *           { when not loginPage }
> > >>  *               { for all crumbs }
> > >>  *                   { if crumb is last }
> > >>  *                       &lt;li&gt;[ crumb text ]&lt;/li&gt;
> > >>  *                   { if crumb is not last }
> > >>  *                       &lt;li&gt;&lt;a href=&quot;[ crumb
> > >> link ]&quot;&gt;[ crumb text ]&lt;/a&gt; &gt; &lt;/li&gt;
> > >>  *      &lt;/ul&gt;
> > >>  *    &lt;/div&gt;
> > >>  * </pre>
> > >>  * 
> > >>  * @author Cumquat Information Technology
> > >>  * 
> > >>  */
> > >> public class Heading {
> > >>     private static final Logger logger =
> > >> Logger.getLogger(Heading.class);
> > >>     
> > >>     @Parameter
> > >>     private boolean loginPage = false;
> > >>
> > >>     @Parameter
> > >>     private List<BreadcrumbBean> breadCrumbs;
> > >>
> > >>     private int index;
> > >>
> > >>     private BreadcrumbBean crumb;
> > >>
> > >>     public boolean isLoginPage() {
> > >>         return loginPage;
> > >>     }
> > >>
> > >>     public List<BreadcrumbBean> getBreadCrumbs() {
> > >>         return breadCrumbs;
> > >>     }
> > >>
> > >>     public void setBreadCrumbs(List<BreadcrumbBean> breadCrumbs) {
> > >>         logger.debug("Setting breadcrumbs: "+breadCrumbs);
> > >>         this.breadCrumbs = breadCrumbs;
> > >>     }
> > >>
> > >>     public int getIndex() {
> > >>         return index;
> > >>     }
> > >>
> > >>     public void setIndex(int index) {
> > >>         this.index = index;
> > >>     }
> > >>
> > >>     public BreadcrumbBean getCrumb() {
> > >>         return crumb;
> > >>     }
> > >>
> > >>     public void setCrumb(BreadcrumbBean crumb) {
> > >>         this.crumb = crumb;
> > >>     }
> > >>
> > >>     public boolean isLastCrumb() {
> > >>         return (index == breadCrumbs.size() - 1);
> > >>     }
> > >>     
> > >> }
> > >>
> > >> On Fri, 2008-04-18 at 16:22 +0200, Chris Lewis wrote:
> > >>     
> > >>> We still haven't seen your template code, where you declare this
> > >>> component and pass it the model. I can't be sure but perhaps it will
> > >>> shed some light...
> > >>>
> > >>> Jan Vissers wrote:
> > >>>       
> > >>>> The problem is somehow related to the way my page and component are
> > >>>> hooked up/working.
> > >>>>
> > >>>> For testing purposes I now create the Breadcrumb list in the component
> > >>>> itself, simply returning a created list on the fly whenever
> > >>>> getBreadCrumbs() is called. This works as expected!!!
> > >>>>
> > >>>> Strange thing is that via passing the 'model' to the component via a
> > >>>> page binding the same thing doesn't work. This must be a bug?!
> > >>>>
> > >>>> -J.
> > >>>>
> > >>>> On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
> > >>>>   
> > >>>>         
> > >>>>> That looks good to me. I don't have an example I can look at with a
> > >>>>> loop, but I do have one with a t:grid in which I reference a bean
> > >>>>> property of a custom class. It's possible that the two are vastly
> > >>>>> different, but I wouldn't think that.
> > >>>>>
> > >>>>> Jan Vissers wrote:
> > >>>>>     
> > >>>>>           
> > >>>>>> On the component I have:
> > >>>>>>
> > >>>>>>     @Parameter
> > >>>>>>     private List<BreadcrumbBean> breadCrumbs;
> > >>>>>>
> > >>>>>> This is passed in via the containg (base)page.
> > >>>>>> And in the same component class I have:
> > >>>>>>
> > >>>>>>     private BreadcrumbBean crumb;
> > >>>>>>
> > >>>>>>     public BreadcrumbBean getCrumb() {
> > >>>>>>         return crumb;
> > >>>>>>     }
> > >>>>>>
> > >>>>>>     public void setCrumb(BreadcrumbBean crumb) {
> > >>>>>>         this.crumb = crumb;
> > >>>>>>     }
> > >>>>>>
> > >>>>>> This should be right, right?
> > >>>>>>
> > >>>>>> -J.
> > >>>>>>
> > >>>>>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
> > >>>>>>   
> > >>>>>>       
> > >>>>>>             
> > >>>>>>> ? is your crumb property of type BreadCrumbBean, or is it type String?
> > >>>>>>> should be same as breadCrumbs<?TYPE>
> > >>>>>>>
> > >>>>>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
> > >>>>>>> wrote:
> > >>>>>>>
> > >>>>>>>     
> > >>>>>>>         
> > >>>>>>>               
> > >>>>>>>> I can't speak about your t:if bit because I don't know what "LastCrumb"
> > >>>>>>>> would be, but assuming that your page class has getters/setters (or the
> > >>>>>>>> property is annotated with @Property) for the "crumb" property, a getter
> > >>>>>>>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
> > >>>>>>>> you *should* be good.
> > >>>>>>>>
> > >>>>>>>> It would be helpful if you can include the exception, specifically the
> > >>>>>>>> line it references, etc.
> > >>>>>>>>
> > >>>>>>>> chris
> > >>>>>>>>
> > >>>>>>>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
> > >>>>>>>> better ;-)
> > >>>>>>>>
> > >>>>>>>> Jan Vissers wrote:
> > >>>>>>>>       
> > >>>>>>>>           
> > >>>>>>>>                 
> > >>>>>>>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
> > >>>>>>>>>
> > >>>>>>>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
> > >>>>>>>>>     <t:if test="LastCrumb">
> > >>>>>>>>>        ${crumb.name}
> > >>>>>>>>>        <t:parameter name="else">
> > >>>>>>>>>            <a href="#"
> > >>>>>>>>> t:type="pageLink" ....>${crumb.name}</a>
> > >>>>>>>>>               >
> > >>>>>>>>>        </t:parameter>
> > >>>>>>>>>     </t:if>
> > >>>>>>>>> </t:loop>
> > >>>>>>>>>
> > >>>>>>>>> -J.
> > >>>>>>>>>
> > >>>>>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
> > >>>>>>>>>
> > >>>>>>>>>         
> > >>>>>>>>>             
> > >>>>>>>>>                   
> > >>>>>>>>>> Can you share some code? At least the relevant part from template would
> > >>>>>>>>>> be helpful.
> > >>>>>>>>>>
> > >>>>>>>>>> chris
> > >>>>>>>>>>
> > >>>>>>>>>> Jan Vissers wrote:
> > >>>>>>>>>>
> > >>>>>>>>>>           
> > >>>>>>>>>>               
> > >>>>>>>>>>                     
> > >>>>>>>>>>> Hi,
> > >>>>>>>>>>>
> > >>>>>>>>>>> Just to make sure I'm not missing something.
> > >>>>>>>>>>>
> > >>>>>>>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
> > >>>>>>>>>>>             
> > >>>>>>>>>>>                 
> > >>>>>>>>>>>                       
> > >>>>>>>> I
> > >>>>>>>>       
> > >>>>>>>>           
> > >>>>>>>>                 
> > >>>>>>>>>>> provided a setter|getter pair for the class involved - in this case
> > >>>>>>>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
> > >>>>>>>>>>> instance individually. Now T5 throws up on me with this nice coercion
> > >>>>>>>>>>> message. Does this mean I need to contribute my own coercion - or is
> > >>>>>>>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
> > >>>>>>>>>>> holding three String members.
> > >>>>>>>>>>>
> > >>>>>>>>>>> Thanks (again :-))
> > >>>>>>>>>>> -J.
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>> ---------------------------------------------------------------------
> > >>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>             
> > >>>>>>>>>>>                 
> > >>>>>>>>>>>                       
> > >>>>>>>>> ---------------------------------------------------------------------
> > >>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>         
> > >>>>>>>>>             
> > >>>>>>>>>                   
> > >>>>>>>> --
> > >>>>>>>> http://thegodcode.net
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>       
> > >>>>>>>>           
> > >>>>>>>>                 
> > >>>>>> ---------------------------------------------------------------------
> > >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>>>>
> > >>>>>>
> > >>>>>>   
> > >>>>>>       
> > >>>>>>             
> > >>>> ---------------------------------------------------------------------
> > >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>>
> > >>>>
> > >>>>   
> > >>>>         
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>
> > >>
> > >>     
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> > >   
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Jan Vissers <Ja...@cumquat.nl>.
I'm deeply sorry for keeping you guys busy, and really appreciate the
feedback. But I nailed it. It had to do with the way I'm passing the
model. Via the Layout class it works, but not so via the Layout
template. I'm sure (am I?) that this is by design of T5 - so sorry for
any inconvenience.

-J.


On Fri, 2008-04-18 at 16:58 +0200, Chris Lewis wrote:
> Wow this is a bit tangled. I remember this from the other thread now( [
> BasePage -> Layout -> RealPage ] ). I don't mean to jerk you around, but
> can you provide the exception report page? I think if we can see the
> line causing this as well as the stack trace, we can nail down where T5
> is expecting something it's not getting.
> 
> Jan Vissers wrote:
> > The layout component that passes in the 'breadCrumb' model to the
> > 'heading' component which should render the breadcrumbs...
> >
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> > <html xmlns="http://www.w3.org/1999/xhtml"
> > xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> >     <head>
> >         <meta http-equiv="Content-Type"
> > content="text/html;charset=utf-8" />
> >         <link rel="shortcut icon" href="favicon.ico" />
> >         <title>${title}</title>
> >     </head>
> >     <body>
> >         <div id="container">
> >             <t:branding t:id="branding" />
> >             <t:heading t:id="heading"
> > t:breadCrumbs="${basePage.breadCrumbHolder.model}" />
> >             <t:body />
> >             <t:copyright t:id="copyright" />
> >         </div>
> >     </body>
> > </html>
> >
> > On Fri, 2008-04-18 at 16:43 +0200, Chris Lewis wrote:
> >   
> >> And that is the part I want to see, from the template code which you
> >> still haven't shared ;-). What I'm referring to is your .tml file where
> >> you use this component.
> >>
> >> Jan Vissers wrote:
> >>     
> >>> In the snippet below if I change:
> >>>     public List<BreadcrumbBean> getBreadCrumbs()
> >>>
> >>> and let it return a freshly created list. The loop construct works.
> >>> However via the @Parameter (passing it it) doesn't.
> >>>
> >>> -J.
> >>>
> >>>
> >>> On Fri, 2008-04-18 at 16:27 +0200, Jan Vissers wrote:
> >>>   
> >>>       
> >>>> Here it is:
> >>>>
> >>>> import java.util.List;
> >>>>
> >>>> import org.apache.log4j.Logger;
> >>>> import org.apache.tapestry.annotations.Parameter;
> >>>>
> >>>> import com.philips.lighting.guidecontrol.view.BreadcrumbBean;
> >>>>
> >>>> /**
> >>>>  * The heading component holds the following pieces of Heading
> >>>> information.
> >>>>  * 
> >>>>  * <pre>
> >>>>  *    &lt;div id=&quot;heading&quot;&gt;
> >>>>  *      &lt;ul id=&quot;breadcrumbs&quot;&gt;
> >>>>  *           &lt;li
> >>>> id=&quot;prefix&quot;&gt;[ &amp;aposyou-are-here&amp;apos ]&gt;/li&gt;
> >>>>  *           { when loginPage }
> >>>>  *               &lt;li&gt;&amp;aposlogin-page&amp;apos&lt;/li&gt;
> >>>>  *           { when not loginPage }
> >>>>  *               { for all crumbs }
> >>>>  *                   { if crumb is last }
> >>>>  *                       &lt;li&gt;[ crumb text ]&lt;/li&gt;
> >>>>  *                   { if crumb is not last }
> >>>>  *                       &lt;li&gt;&lt;a href=&quot;[ crumb
> >>>> link ]&quot;&gt;[ crumb text ]&lt;/a&gt; &gt; &lt;/li&gt;
> >>>>  *      &lt;/ul&gt;
> >>>>  *    &lt;/div&gt;
> >>>>  * </pre>
> >>>>  * 
> >>>>  * @author Cumquat Information Technology
> >>>>  * 
> >>>>  */
> >>>> public class Heading {
> >>>>     private static final Logger logger =
> >>>> Logger.getLogger(Heading.class);
> >>>>     
> >>>>     @Parameter
> >>>>     private boolean loginPage = false;
> >>>>
> >>>>     @Parameter
> >>>>     private List<BreadcrumbBean> breadCrumbs;
> >>>>
> >>>>     private int index;
> >>>>
> >>>>     private BreadcrumbBean crumb;
> >>>>
> >>>>     public boolean isLoginPage() {
> >>>>         return loginPage;
> >>>>     }
> >>>>
> >>>>     public List<BreadcrumbBean> getBreadCrumbs() {
> >>>>         return breadCrumbs;
> >>>>     }
> >>>>
> >>>>     public void setBreadCrumbs(List<BreadcrumbBean> breadCrumbs) {
> >>>>         logger.debug("Setting breadcrumbs: "+breadCrumbs);
> >>>>         this.breadCrumbs = breadCrumbs;
> >>>>     }
> >>>>
> >>>>     public int getIndex() {
> >>>>         return index;
> >>>>     }
> >>>>
> >>>>     public void setIndex(int index) {
> >>>>         this.index = index;
> >>>>     }
> >>>>
> >>>>     public BreadcrumbBean getCrumb() {
> >>>>         return crumb;
> >>>>     }
> >>>>
> >>>>     public void setCrumb(BreadcrumbBean crumb) {
> >>>>         this.crumb = crumb;
> >>>>     }
> >>>>
> >>>>     public boolean isLastCrumb() {
> >>>>         return (index == breadCrumbs.size() - 1);
> >>>>     }
> >>>>     
> >>>> }
> >>>>
> >>>> On Fri, 2008-04-18 at 16:22 +0200, Chris Lewis wrote:
> >>>>     
> >>>>         
> >>>>> We still haven't seen your template code, where you declare this
> >>>>> component and pass it the model. I can't be sure but perhaps it will
> >>>>> shed some light...
> >>>>>
> >>>>> Jan Vissers wrote:
> >>>>>       
> >>>>>           
> >>>>>> The problem is somehow related to the way my page and component are
> >>>>>> hooked up/working.
> >>>>>>
> >>>>>> For testing purposes I now create the Breadcrumb list in the component
> >>>>>> itself, simply returning a created list on the fly whenever
> >>>>>> getBreadCrumbs() is called. This works as expected!!!
> >>>>>>
> >>>>>> Strange thing is that via passing the 'model' to the component via a
> >>>>>> page binding the same thing doesn't work. This must be a bug?!
> >>>>>>
> >>>>>> -J.
> >>>>>>
> >>>>>> On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
> >>>>>>   
> >>>>>>         
> >>>>>>             
> >>>>>>> That looks good to me. I don't have an example I can look at with a
> >>>>>>> loop, but I do have one with a t:grid in which I reference a bean
> >>>>>>> property of a custom class. It's possible that the two are vastly
> >>>>>>> different, but I wouldn't think that.
> >>>>>>>
> >>>>>>> Jan Vissers wrote:
> >>>>>>>     
> >>>>>>>           
> >>>>>>>               
> >>>>>>>> On the component I have:
> >>>>>>>>
> >>>>>>>>     @Parameter
> >>>>>>>>     private List<BreadcrumbBean> breadCrumbs;
> >>>>>>>>
> >>>>>>>> This is passed in via the containg (base)page.
> >>>>>>>> And in the same component class I have:
> >>>>>>>>
> >>>>>>>>     private BreadcrumbBean crumb;
> >>>>>>>>
> >>>>>>>>     public BreadcrumbBean getCrumb() {
> >>>>>>>>         return crumb;
> >>>>>>>>     }
> >>>>>>>>
> >>>>>>>>     public void setCrumb(BreadcrumbBean crumb) {
> >>>>>>>>         this.crumb = crumb;
> >>>>>>>>     }
> >>>>>>>>
> >>>>>>>> This should be right, right?
> >>>>>>>>
> >>>>>>>> -J.
> >>>>>>>>
> >>>>>>>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
> >>>>>>>>   
> >>>>>>>>       
> >>>>>>>>             
> >>>>>>>>                 
> >>>>>>>>> ? is your crumb property of type BreadCrumbBean, or is it type String?
> >>>>>>>>> should be same as breadCrumbs<?TYPE>
> >>>>>>>>>
> >>>>>>>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
> >>>>>>>>> wrote:
> >>>>>>>>>
> >>>>>>>>>     
> >>>>>>>>>         
> >>>>>>>>>               
> >>>>>>>>>                   
> >>>>>>>>>> I can't speak about your t:if bit because I don't know what "LastCrumb"
> >>>>>>>>>> would be, but assuming that your page class has getters/setters (or the
> >>>>>>>>>> property is annotated with @Property) for the "crumb" property, a getter
> >>>>>>>>>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
> >>>>>>>>>> you *should* be good.
> >>>>>>>>>>
> >>>>>>>>>> It would be helpful if you can include the exception, specifically the
> >>>>>>>>>> line it references, etc.
> >>>>>>>>>>
> >>>>>>>>>> chris
> >>>>>>>>>>
> >>>>>>>>>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
> >>>>>>>>>> better ;-)
> >>>>>>>>>>
> >>>>>>>>>> Jan Vissers wrote:
> >>>>>>>>>>       
> >>>>>>>>>>           
> >>>>>>>>>>                 
> >>>>>>>>>>                     
> >>>>>>>>>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
> >>>>>>>>>>>
> >>>>>>>>>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
> >>>>>>>>>>>     <t:if test="LastCrumb">
> >>>>>>>>>>>        ${crumb.name}
> >>>>>>>>>>>        <t:parameter name="else">
> >>>>>>>>>>>            <a href="#"
> >>>>>>>>>>> t:type="pageLink" ....>${crumb.name}</a>
> >>>>>>>>>>>               >
> >>>>>>>>>>>        </t:parameter>
> >>>>>>>>>>>     </t:if>
> >>>>>>>>>>> </t:loop>
> >>>>>>>>>>>
> >>>>>>>>>>> -J.
> >>>>>>>>>>>
> >>>>>>>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
> >>>>>>>>>>>
> >>>>>>>>>>>         
> >>>>>>>>>>>             
> >>>>>>>>>>>                   
> >>>>>>>>>>>                       
> >>>>>>>>>>>> Can you share some code? At least the relevant part from template would
> >>>>>>>>>>>> be helpful.
> >>>>>>>>>>>>
> >>>>>>>>>>>> chris
> >>>>>>>>>>>>
> >>>>>>>>>>>> Jan Vissers wrote:
> >>>>>>>>>>>>
> >>>>>>>>>>>>           
> >>>>>>>>>>>>               
> >>>>>>>>>>>>                     
> >>>>>>>>>>>>                         
> >>>>>>>>>>>>> Hi,
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Just to make sure I'm not missing something.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
> >>>>>>>>>>>>>             
> >>>>>>>>>>>>>                 
> >>>>>>>>>>>>>                       
> >>>>>>>>>>>>>                           
> >>>>>>>>>> I
> >>>>>>>>>>       
> >>>>>>>>>>           
> >>>>>>>>>>                 
> >>>>>>>>>>                     
> >>>>>>>>>>>>> provided a setter|getter pair for the class involved - in this case
> >>>>>>>>>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
> >>>>>>>>>>>>> instance individually. Now T5 throws up on me with this nice coercion
> >>>>>>>>>>>>> message. Does this mean I need to contribute my own coercion - or is
> >>>>>>>>>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
> >>>>>>>>>>>>> holding three String members.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Thanks (again :-))
> >>>>>>>>>>>>> -J.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>             
> >>>>>>>>>>>>>                 
> >>>>>>>>>>>>>                       
> >>>>>>>>>>>>>                           
> >>>>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>         
> >>>>>>>>>>>             
> >>>>>>>>>>>                   
> >>>>>>>>>>>                       
> >>>>>>>>>> --
> >>>>>>>>>> http://thegodcode.net
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>       
> >>>>>>>>>>           
> >>>>>>>>>>                 
> >>>>>>>>>>                     
> >>>>>>>> ---------------------------------------------------------------------
> >>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>   
> >>>>>>>>       
> >>>>>>>>             
> >>>>>>>>                 
> >>>>>> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>
> >>>>>>
> >>>>>>   
> >>>>>>         
> >>>>>>             
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>
> >>>>
> >>>>     
> >>>>         
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>
> >>>
> >>>   
> >>>       
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >   
> 


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Chris Lewis <ch...@bellsouth.net>.
Wow this is a bit tangled. I remember this from the other thread now( [
BasePage -> Layout -> RealPage ] ). I don't mean to jerk you around, but
can you provide the exception report page? I think if we can see the
line causing this as well as the stack trace, we can nail down where T5
is expecting something it's not getting.

Jan Vissers wrote:
> The layout component that passes in the 'breadCrumb' model to the
> 'heading' component which should render the breadcrumbs...
>
>
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>     <head>
>         <meta http-equiv="Content-Type"
> content="text/html;charset=utf-8" />
>         <link rel="shortcut icon" href="favicon.ico" />
>         <title>${title}</title>
>     </head>
>     <body>
>         <div id="container">
>             <t:branding t:id="branding" />
>             <t:heading t:id="heading"
> t:breadCrumbs="${basePage.breadCrumbHolder.model}" />
>             <t:body />
>             <t:copyright t:id="copyright" />
>         </div>
>     </body>
> </html>
>
> On Fri, 2008-04-18 at 16:43 +0200, Chris Lewis wrote:
>   
>> And that is the part I want to see, from the template code which you
>> still haven't shared ;-). What I'm referring to is your .tml file where
>> you use this component.
>>
>> Jan Vissers wrote:
>>     
>>> In the snippet below if I change:
>>>     public List<BreadcrumbBean> getBreadCrumbs()
>>>
>>> and let it return a freshly created list. The loop construct works.
>>> However via the @Parameter (passing it it) doesn't.
>>>
>>> -J.
>>>
>>>
>>> On Fri, 2008-04-18 at 16:27 +0200, Jan Vissers wrote:
>>>   
>>>       
>>>> Here it is:
>>>>
>>>> import java.util.List;
>>>>
>>>> import org.apache.log4j.Logger;
>>>> import org.apache.tapestry.annotations.Parameter;
>>>>
>>>> import com.philips.lighting.guidecontrol.view.BreadcrumbBean;
>>>>
>>>> /**
>>>>  * The heading component holds the following pieces of Heading
>>>> information.
>>>>  * 
>>>>  * <pre>
>>>>  *    &lt;div id=&quot;heading&quot;&gt;
>>>>  *      &lt;ul id=&quot;breadcrumbs&quot;&gt;
>>>>  *           &lt;li
>>>> id=&quot;prefix&quot;&gt;[ &amp;aposyou-are-here&amp;apos ]&gt;/li&gt;
>>>>  *           { when loginPage }
>>>>  *               &lt;li&gt;&amp;aposlogin-page&amp;apos&lt;/li&gt;
>>>>  *           { when not loginPage }
>>>>  *               { for all crumbs }
>>>>  *                   { if crumb is last }
>>>>  *                       &lt;li&gt;[ crumb text ]&lt;/li&gt;
>>>>  *                   { if crumb is not last }
>>>>  *                       &lt;li&gt;&lt;a href=&quot;[ crumb
>>>> link ]&quot;&gt;[ crumb text ]&lt;/a&gt; &gt; &lt;/li&gt;
>>>>  *      &lt;/ul&gt;
>>>>  *    &lt;/div&gt;
>>>>  * </pre>
>>>>  * 
>>>>  * @author Cumquat Information Technology
>>>>  * 
>>>>  */
>>>> public class Heading {
>>>>     private static final Logger logger =
>>>> Logger.getLogger(Heading.class);
>>>>     
>>>>     @Parameter
>>>>     private boolean loginPage = false;
>>>>
>>>>     @Parameter
>>>>     private List<BreadcrumbBean> breadCrumbs;
>>>>
>>>>     private int index;
>>>>
>>>>     private BreadcrumbBean crumb;
>>>>
>>>>     public boolean isLoginPage() {
>>>>         return loginPage;
>>>>     }
>>>>
>>>>     public List<BreadcrumbBean> getBreadCrumbs() {
>>>>         return breadCrumbs;
>>>>     }
>>>>
>>>>     public void setBreadCrumbs(List<BreadcrumbBean> breadCrumbs) {
>>>>         logger.debug("Setting breadcrumbs: "+breadCrumbs);
>>>>         this.breadCrumbs = breadCrumbs;
>>>>     }
>>>>
>>>>     public int getIndex() {
>>>>         return index;
>>>>     }
>>>>
>>>>     public void setIndex(int index) {
>>>>         this.index = index;
>>>>     }
>>>>
>>>>     public BreadcrumbBean getCrumb() {
>>>>         return crumb;
>>>>     }
>>>>
>>>>     public void setCrumb(BreadcrumbBean crumb) {
>>>>         this.crumb = crumb;
>>>>     }
>>>>
>>>>     public boolean isLastCrumb() {
>>>>         return (index == breadCrumbs.size() - 1);
>>>>     }
>>>>     
>>>> }
>>>>
>>>> On Fri, 2008-04-18 at 16:22 +0200, Chris Lewis wrote:
>>>>     
>>>>         
>>>>> We still haven't seen your template code, where you declare this
>>>>> component and pass it the model. I can't be sure but perhaps it will
>>>>> shed some light...
>>>>>
>>>>> Jan Vissers wrote:
>>>>>       
>>>>>           
>>>>>> The problem is somehow related to the way my page and component are
>>>>>> hooked up/working.
>>>>>>
>>>>>> For testing purposes I now create the Breadcrumb list in the component
>>>>>> itself, simply returning a created list on the fly whenever
>>>>>> getBreadCrumbs() is called. This works as expected!!!
>>>>>>
>>>>>> Strange thing is that via passing the 'model' to the component via a
>>>>>> page binding the same thing doesn't work. This must be a bug?!
>>>>>>
>>>>>> -J.
>>>>>>
>>>>>> On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
>>>>>>   
>>>>>>         
>>>>>>             
>>>>>>> That looks good to me. I don't have an example I can look at with a
>>>>>>> loop, but I do have one with a t:grid in which I reference a bean
>>>>>>> property of a custom class. It's possible that the two are vastly
>>>>>>> different, but I wouldn't think that.
>>>>>>>
>>>>>>> Jan Vissers wrote:
>>>>>>>     
>>>>>>>           
>>>>>>>               
>>>>>>>> On the component I have:
>>>>>>>>
>>>>>>>>     @Parameter
>>>>>>>>     private List<BreadcrumbBean> breadCrumbs;
>>>>>>>>
>>>>>>>> This is passed in via the containg (base)page.
>>>>>>>> And in the same component class I have:
>>>>>>>>
>>>>>>>>     private BreadcrumbBean crumb;
>>>>>>>>
>>>>>>>>     public BreadcrumbBean getCrumb() {
>>>>>>>>         return crumb;
>>>>>>>>     }
>>>>>>>>
>>>>>>>>     public void setCrumb(BreadcrumbBean crumb) {
>>>>>>>>         this.crumb = crumb;
>>>>>>>>     }
>>>>>>>>
>>>>>>>> This should be right, right?
>>>>>>>>
>>>>>>>> -J.
>>>>>>>>
>>>>>>>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
>>>>>>>>   
>>>>>>>>       
>>>>>>>>             
>>>>>>>>                 
>>>>>>>>> ? is your crumb property of type BreadCrumbBean, or is it type String?
>>>>>>>>> should be same as breadCrumbs<?TYPE>
>>>>>>>>>
>>>>>>>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>               
>>>>>>>>>                   
>>>>>>>>>> I can't speak about your t:if bit because I don't know what "LastCrumb"
>>>>>>>>>> would be, but assuming that your page class has getters/setters (or the
>>>>>>>>>> property is annotated with @Property) for the "crumb" property, a getter
>>>>>>>>>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
>>>>>>>>>> you *should* be good.
>>>>>>>>>>
>>>>>>>>>> It would be helpful if you can include the exception, specifically the
>>>>>>>>>> line it references, etc.
>>>>>>>>>>
>>>>>>>>>> chris
>>>>>>>>>>
>>>>>>>>>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
>>>>>>>>>> better ;-)
>>>>>>>>>>
>>>>>>>>>> Jan Vissers wrote:
>>>>>>>>>>       
>>>>>>>>>>           
>>>>>>>>>>                 
>>>>>>>>>>                     
>>>>>>>>>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
>>>>>>>>>>>
>>>>>>>>>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
>>>>>>>>>>>     <t:if test="LastCrumb">
>>>>>>>>>>>        ${crumb.name}
>>>>>>>>>>>        <t:parameter name="else">
>>>>>>>>>>>            <a href="#"
>>>>>>>>>>> t:type="pageLink" ....>${crumb.name}</a>
>>>>>>>>>>>               >
>>>>>>>>>>>        </t:parameter>
>>>>>>>>>>>     </t:if>
>>>>>>>>>>> </t:loop>
>>>>>>>>>>>
>>>>>>>>>>> -J.
>>>>>>>>>>>
>>>>>>>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
>>>>>>>>>>>
>>>>>>>>>>>         
>>>>>>>>>>>             
>>>>>>>>>>>                   
>>>>>>>>>>>                       
>>>>>>>>>>>> Can you share some code? At least the relevant part from template would
>>>>>>>>>>>> be helpful.
>>>>>>>>>>>>
>>>>>>>>>>>> chris
>>>>>>>>>>>>
>>>>>>>>>>>> Jan Vissers wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>           
>>>>>>>>>>>>               
>>>>>>>>>>>>                     
>>>>>>>>>>>>                         
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Just to make sure I'm not missing something.
>>>>>>>>>>>>>
>>>>>>>>>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
>>>>>>>>>>>>>             
>>>>>>>>>>>>>                 
>>>>>>>>>>>>>                       
>>>>>>>>>>>>>                           
>>>>>>>>>> I
>>>>>>>>>>       
>>>>>>>>>>           
>>>>>>>>>>                 
>>>>>>>>>>                     
>>>>>>>>>>>>> provided a setter|getter pair for the class involved - in this case
>>>>>>>>>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
>>>>>>>>>>>>> instance individually. Now T5 throws up on me with this nice coercion
>>>>>>>>>>>>> message. Does this mean I need to contribute my own coercion - or is
>>>>>>>>>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
>>>>>>>>>>>>> holding three String members.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks (again :-))
>>>>>>>>>>>>> -J.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>             
>>>>>>>>>>>>>                 
>>>>>>>>>>>>>                       
>>>>>>>>>>>>>                           
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>         
>>>>>>>>>>>             
>>>>>>>>>>>                   
>>>>>>>>>>>                       
>>>>>>>>>> --
>>>>>>>>>> http://thegodcode.net
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>       
>>>>>>>>>>           
>>>>>>>>>>                 
>>>>>>>>>>                     
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>   
>>>>>>>>       
>>>>>>>>             
>>>>>>>>                 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>   
>>>>>>         
>>>>>>             
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>     
>>>>         
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>   
>>>       
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

-- 
http://thegodcode.net


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Jan Vissers <Ja...@cumquat.nl>.
The layout component that passes in the 'breadCrumb' model to the
'heading' component which should render the breadcrumbs...


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
    <head>
        <meta http-equiv="Content-Type"
content="text/html;charset=utf-8" />
        <link rel="shortcut icon" href="favicon.ico" />
        <title>${title}</title>
    </head>
    <body>
        <div id="container">
            <t:branding t:id="branding" />
            <t:heading t:id="heading"
t:breadCrumbs="${basePage.breadCrumbHolder.model}" />
            <t:body />
            <t:copyright t:id="copyright" />
        </div>
    </body>
</html>

On Fri, 2008-04-18 at 16:43 +0200, Chris Lewis wrote:
> And that is the part I want to see, from the template code which you
> still haven't shared ;-). What I'm referring to is your .tml file where
> you use this component.
> 
> Jan Vissers wrote:
> > In the snippet below if I change:
> >     public List<BreadcrumbBean> getBreadCrumbs()
> >
> > and let it return a freshly created list. The loop construct works.
> > However via the @Parameter (passing it it) doesn't.
> >
> > -J.
> >
> >
> > On Fri, 2008-04-18 at 16:27 +0200, Jan Vissers wrote:
> >   
> >> Here it is:
> >>
> >> import java.util.List;
> >>
> >> import org.apache.log4j.Logger;
> >> import org.apache.tapestry.annotations.Parameter;
> >>
> >> import com.philips.lighting.guidecontrol.view.BreadcrumbBean;
> >>
> >> /**
> >>  * The heading component holds the following pieces of Heading
> >> information.
> >>  * 
> >>  * <pre>
> >>  *    &lt;div id=&quot;heading&quot;&gt;
> >>  *      &lt;ul id=&quot;breadcrumbs&quot;&gt;
> >>  *           &lt;li
> >> id=&quot;prefix&quot;&gt;[ &amp;aposyou-are-here&amp;apos ]&gt;/li&gt;
> >>  *           { when loginPage }
> >>  *               &lt;li&gt;&amp;aposlogin-page&amp;apos&lt;/li&gt;
> >>  *           { when not loginPage }
> >>  *               { for all crumbs }
> >>  *                   { if crumb is last }
> >>  *                       &lt;li&gt;[ crumb text ]&lt;/li&gt;
> >>  *                   { if crumb is not last }
> >>  *                       &lt;li&gt;&lt;a href=&quot;[ crumb
> >> link ]&quot;&gt;[ crumb text ]&lt;/a&gt; &gt; &lt;/li&gt;
> >>  *      &lt;/ul&gt;
> >>  *    &lt;/div&gt;
> >>  * </pre>
> >>  * 
> >>  * @author Cumquat Information Technology
> >>  * 
> >>  */
> >> public class Heading {
> >>     private static final Logger logger =
> >> Logger.getLogger(Heading.class);
> >>     
> >>     @Parameter
> >>     private boolean loginPage = false;
> >>
> >>     @Parameter
> >>     private List<BreadcrumbBean> breadCrumbs;
> >>
> >>     private int index;
> >>
> >>     private BreadcrumbBean crumb;
> >>
> >>     public boolean isLoginPage() {
> >>         return loginPage;
> >>     }
> >>
> >>     public List<BreadcrumbBean> getBreadCrumbs() {
> >>         return breadCrumbs;
> >>     }
> >>
> >>     public void setBreadCrumbs(List<BreadcrumbBean> breadCrumbs) {
> >>         logger.debug("Setting breadcrumbs: "+breadCrumbs);
> >>         this.breadCrumbs = breadCrumbs;
> >>     }
> >>
> >>     public int getIndex() {
> >>         return index;
> >>     }
> >>
> >>     public void setIndex(int index) {
> >>         this.index = index;
> >>     }
> >>
> >>     public BreadcrumbBean getCrumb() {
> >>         return crumb;
> >>     }
> >>
> >>     public void setCrumb(BreadcrumbBean crumb) {
> >>         this.crumb = crumb;
> >>     }
> >>
> >>     public boolean isLastCrumb() {
> >>         return (index == breadCrumbs.size() - 1);
> >>     }
> >>     
> >> }
> >>
> >> On Fri, 2008-04-18 at 16:22 +0200, Chris Lewis wrote:
> >>     
> >>> We still haven't seen your template code, where you declare this
> >>> component and pass it the model. I can't be sure but perhaps it will
> >>> shed some light...
> >>>
> >>> Jan Vissers wrote:
> >>>       
> >>>> The problem is somehow related to the way my page and component are
> >>>> hooked up/working.
> >>>>
> >>>> For testing purposes I now create the Breadcrumb list in the component
> >>>> itself, simply returning a created list on the fly whenever
> >>>> getBreadCrumbs() is called. This works as expected!!!
> >>>>
> >>>> Strange thing is that via passing the 'model' to the component via a
> >>>> page binding the same thing doesn't work. This must be a bug?!
> >>>>
> >>>> -J.
> >>>>
> >>>> On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
> >>>>   
> >>>>         
> >>>>> That looks good to me. I don't have an example I can look at with a
> >>>>> loop, but I do have one with a t:grid in which I reference a bean
> >>>>> property of a custom class. It's possible that the two are vastly
> >>>>> different, but I wouldn't think that.
> >>>>>
> >>>>> Jan Vissers wrote:
> >>>>>     
> >>>>>           
> >>>>>> On the component I have:
> >>>>>>
> >>>>>>     @Parameter
> >>>>>>     private List<BreadcrumbBean> breadCrumbs;
> >>>>>>
> >>>>>> This is passed in via the containg (base)page.
> >>>>>> And in the same component class I have:
> >>>>>>
> >>>>>>     private BreadcrumbBean crumb;
> >>>>>>
> >>>>>>     public BreadcrumbBean getCrumb() {
> >>>>>>         return crumb;
> >>>>>>     }
> >>>>>>
> >>>>>>     public void setCrumb(BreadcrumbBean crumb) {
> >>>>>>         this.crumb = crumb;
> >>>>>>     }
> >>>>>>
> >>>>>> This should be right, right?
> >>>>>>
> >>>>>> -J.
> >>>>>>
> >>>>>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
> >>>>>>   
> >>>>>>       
> >>>>>>             
> >>>>>>> ? is your crumb property of type BreadCrumbBean, or is it type String?
> >>>>>>> should be same as breadCrumbs<?TYPE>
> >>>>>>>
> >>>>>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
> >>>>>>> wrote:
> >>>>>>>
> >>>>>>>     
> >>>>>>>         
> >>>>>>>               
> >>>>>>>> I can't speak about your t:if bit because I don't know what "LastCrumb"
> >>>>>>>> would be, but assuming that your page class has getters/setters (or the
> >>>>>>>> property is annotated with @Property) for the "crumb" property, a getter
> >>>>>>>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
> >>>>>>>> you *should* be good.
> >>>>>>>>
> >>>>>>>> It would be helpful if you can include the exception, specifically the
> >>>>>>>> line it references, etc.
> >>>>>>>>
> >>>>>>>> chris
> >>>>>>>>
> >>>>>>>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
> >>>>>>>> better ;-)
> >>>>>>>>
> >>>>>>>> Jan Vissers wrote:
> >>>>>>>>       
> >>>>>>>>           
> >>>>>>>>                 
> >>>>>>>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
> >>>>>>>>>
> >>>>>>>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
> >>>>>>>>>     <t:if test="LastCrumb">
> >>>>>>>>>        ${crumb.name}
> >>>>>>>>>        <t:parameter name="else">
> >>>>>>>>>            <a href="#"
> >>>>>>>>> t:type="pageLink" ....>${crumb.name}</a>
> >>>>>>>>>               >
> >>>>>>>>>        </t:parameter>
> >>>>>>>>>     </t:if>
> >>>>>>>>> </t:loop>
> >>>>>>>>>
> >>>>>>>>> -J.
> >>>>>>>>>
> >>>>>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
> >>>>>>>>>
> >>>>>>>>>         
> >>>>>>>>>             
> >>>>>>>>>                   
> >>>>>>>>>> Can you share some code? At least the relevant part from template would
> >>>>>>>>>> be helpful.
> >>>>>>>>>>
> >>>>>>>>>> chris
> >>>>>>>>>>
> >>>>>>>>>> Jan Vissers wrote:
> >>>>>>>>>>
> >>>>>>>>>>           
> >>>>>>>>>>               
> >>>>>>>>>>                     
> >>>>>>>>>>> Hi,
> >>>>>>>>>>>
> >>>>>>>>>>> Just to make sure I'm not missing something.
> >>>>>>>>>>>
> >>>>>>>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
> >>>>>>>>>>>             
> >>>>>>>>>>>                 
> >>>>>>>>>>>                       
> >>>>>>>> I
> >>>>>>>>       
> >>>>>>>>           
> >>>>>>>>                 
> >>>>>>>>>>> provided a setter|getter pair for the class involved - in this case
> >>>>>>>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
> >>>>>>>>>>> instance individually. Now T5 throws up on me with this nice coercion
> >>>>>>>>>>> message. Does this mean I need to contribute my own coercion - or is
> >>>>>>>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
> >>>>>>>>>>> holding three String members.
> >>>>>>>>>>>
> >>>>>>>>>>> Thanks (again :-))
> >>>>>>>>>>> -J.
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>             
> >>>>>>>>>>>                 
> >>>>>>>>>>>                       
> >>>>>>>>> ---------------------------------------------------------------------
> >>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>         
> >>>>>>>>>             
> >>>>>>>>>                   
> >>>>>>>> --
> >>>>>>>> http://thegodcode.net
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>       
> >>>>>>>>           
> >>>>>>>>                 
> >>>>>> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>
> >>>>>>
> >>>>>>   
> >>>>>>       
> >>>>>>             
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>
> >>>>
> >>>>   
> >>>>         
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >>     
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >   
> 


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Chris Lewis <ch...@bellsouth.net>.
And that is the part I want to see, from the template code which you
still haven't shared ;-). What I'm referring to is your .tml file where
you use this component.

Jan Vissers wrote:
> In the snippet below if I change:
>     public List<BreadcrumbBean> getBreadCrumbs()
>
> and let it return a freshly created list. The loop construct works.
> However via the @Parameter (passing it it) doesn't.
>
> -J.
>
>
> On Fri, 2008-04-18 at 16:27 +0200, Jan Vissers wrote:
>   
>> Here it is:
>>
>> import java.util.List;
>>
>> import org.apache.log4j.Logger;
>> import org.apache.tapestry.annotations.Parameter;
>>
>> import com.philips.lighting.guidecontrol.view.BreadcrumbBean;
>>
>> /**
>>  * The heading component holds the following pieces of Heading
>> information.
>>  * 
>>  * <pre>
>>  *    &lt;div id=&quot;heading&quot;&gt;
>>  *      &lt;ul id=&quot;breadcrumbs&quot;&gt;
>>  *           &lt;li
>> id=&quot;prefix&quot;&gt;[ &amp;aposyou-are-here&amp;apos ]&gt;/li&gt;
>>  *           { when loginPage }
>>  *               &lt;li&gt;&amp;aposlogin-page&amp;apos&lt;/li&gt;
>>  *           { when not loginPage }
>>  *               { for all crumbs }
>>  *                   { if crumb is last }
>>  *                       &lt;li&gt;[ crumb text ]&lt;/li&gt;
>>  *                   { if crumb is not last }
>>  *                       &lt;li&gt;&lt;a href=&quot;[ crumb
>> link ]&quot;&gt;[ crumb text ]&lt;/a&gt; &gt; &lt;/li&gt;
>>  *      &lt;/ul&gt;
>>  *    &lt;/div&gt;
>>  * </pre>
>>  * 
>>  * @author Cumquat Information Technology
>>  * 
>>  */
>> public class Heading {
>>     private static final Logger logger =
>> Logger.getLogger(Heading.class);
>>     
>>     @Parameter
>>     private boolean loginPage = false;
>>
>>     @Parameter
>>     private List<BreadcrumbBean> breadCrumbs;
>>
>>     private int index;
>>
>>     private BreadcrumbBean crumb;
>>
>>     public boolean isLoginPage() {
>>         return loginPage;
>>     }
>>
>>     public List<BreadcrumbBean> getBreadCrumbs() {
>>         return breadCrumbs;
>>     }
>>
>>     public void setBreadCrumbs(List<BreadcrumbBean> breadCrumbs) {
>>         logger.debug("Setting breadcrumbs: "+breadCrumbs);
>>         this.breadCrumbs = breadCrumbs;
>>     }
>>
>>     public int getIndex() {
>>         return index;
>>     }
>>
>>     public void setIndex(int index) {
>>         this.index = index;
>>     }
>>
>>     public BreadcrumbBean getCrumb() {
>>         return crumb;
>>     }
>>
>>     public void setCrumb(BreadcrumbBean crumb) {
>>         this.crumb = crumb;
>>     }
>>
>>     public boolean isLastCrumb() {
>>         return (index == breadCrumbs.size() - 1);
>>     }
>>     
>> }
>>
>> On Fri, 2008-04-18 at 16:22 +0200, Chris Lewis wrote:
>>     
>>> We still haven't seen your template code, where you declare this
>>> component and pass it the model. I can't be sure but perhaps it will
>>> shed some light...
>>>
>>> Jan Vissers wrote:
>>>       
>>>> The problem is somehow related to the way my page and component are
>>>> hooked up/working.
>>>>
>>>> For testing purposes I now create the Breadcrumb list in the component
>>>> itself, simply returning a created list on the fly whenever
>>>> getBreadCrumbs() is called. This works as expected!!!
>>>>
>>>> Strange thing is that via passing the 'model' to the component via a
>>>> page binding the same thing doesn't work. This must be a bug?!
>>>>
>>>> -J.
>>>>
>>>> On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
>>>>   
>>>>         
>>>>> That looks good to me. I don't have an example I can look at with a
>>>>> loop, but I do have one with a t:grid in which I reference a bean
>>>>> property of a custom class. It's possible that the two are vastly
>>>>> different, but I wouldn't think that.
>>>>>
>>>>> Jan Vissers wrote:
>>>>>     
>>>>>           
>>>>>> On the component I have:
>>>>>>
>>>>>>     @Parameter
>>>>>>     private List<BreadcrumbBean> breadCrumbs;
>>>>>>
>>>>>> This is passed in via the containg (base)page.
>>>>>> And in the same component class I have:
>>>>>>
>>>>>>     private BreadcrumbBean crumb;
>>>>>>
>>>>>>     public BreadcrumbBean getCrumb() {
>>>>>>         return crumb;
>>>>>>     }
>>>>>>
>>>>>>     public void setCrumb(BreadcrumbBean crumb) {
>>>>>>         this.crumb = crumb;
>>>>>>     }
>>>>>>
>>>>>> This should be right, right?
>>>>>>
>>>>>> -J.
>>>>>>
>>>>>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
>>>>>>   
>>>>>>       
>>>>>>             
>>>>>>> ? is your crumb property of type BreadCrumbBean, or is it type String?
>>>>>>> should be same as breadCrumbs<?TYPE>
>>>>>>>
>>>>>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
>>>>>>> wrote:
>>>>>>>
>>>>>>>     
>>>>>>>         
>>>>>>>               
>>>>>>>> I can't speak about your t:if bit because I don't know what "LastCrumb"
>>>>>>>> would be, but assuming that your page class has getters/setters (or the
>>>>>>>> property is annotated with @Property) for the "crumb" property, a getter
>>>>>>>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
>>>>>>>> you *should* be good.
>>>>>>>>
>>>>>>>> It would be helpful if you can include the exception, specifically the
>>>>>>>> line it references, etc.
>>>>>>>>
>>>>>>>> chris
>>>>>>>>
>>>>>>>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
>>>>>>>> better ;-)
>>>>>>>>
>>>>>>>> Jan Vissers wrote:
>>>>>>>>       
>>>>>>>>           
>>>>>>>>                 
>>>>>>>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
>>>>>>>>>
>>>>>>>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
>>>>>>>>>     <t:if test="LastCrumb">
>>>>>>>>>        ${crumb.name}
>>>>>>>>>        <t:parameter name="else">
>>>>>>>>>            <a href="#"
>>>>>>>>> t:type="pageLink" ....>${crumb.name}</a>
>>>>>>>>>               >
>>>>>>>>>        </t:parameter>
>>>>>>>>>     </t:if>
>>>>>>>>> </t:loop>
>>>>>>>>>
>>>>>>>>> -J.
>>>>>>>>>
>>>>>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
>>>>>>>>>
>>>>>>>>>         
>>>>>>>>>             
>>>>>>>>>                   
>>>>>>>>>> Can you share some code? At least the relevant part from template would
>>>>>>>>>> be helpful.
>>>>>>>>>>
>>>>>>>>>> chris
>>>>>>>>>>
>>>>>>>>>> Jan Vissers wrote:
>>>>>>>>>>
>>>>>>>>>>           
>>>>>>>>>>               
>>>>>>>>>>                     
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> Just to make sure I'm not missing something.
>>>>>>>>>>>
>>>>>>>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
>>>>>>>>>>>             
>>>>>>>>>>>                 
>>>>>>>>>>>                       
>>>>>>>> I
>>>>>>>>       
>>>>>>>>           
>>>>>>>>                 
>>>>>>>>>>> provided a setter|getter pair for the class involved - in this case
>>>>>>>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
>>>>>>>>>>> instance individually. Now T5 throws up on me with this nice coercion
>>>>>>>>>>> message. Does this mean I need to contribute my own coercion - or is
>>>>>>>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
>>>>>>>>>>> holding three String members.
>>>>>>>>>>>
>>>>>>>>>>> Thanks (again :-))
>>>>>>>>>>> -J.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>             
>>>>>>>>>>>                 
>>>>>>>>>>>                       
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>         
>>>>>>>>>             
>>>>>>>>>                   
>>>>>>>> --
>>>>>>>> http://thegodcode.net
>>>>>>>>
>>>>>>>>
>>>>>>>>       
>>>>>>>>           
>>>>>>>>                 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>   
>>>>>>       
>>>>>>             
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>   
>>>>         
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

-- 
http://thegodcode.net


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Jan Vissers <Ja...@cumquat.nl>.
In the snippet below if I change:
    public List<BreadcrumbBean> getBreadCrumbs()

and let it return a freshly created list. The loop construct works.
However via the @Parameter (passing it it) doesn't.

-J.


On Fri, 2008-04-18 at 16:27 +0200, Jan Vissers wrote:
> Here it is:
> 
> import java.util.List;
> 
> import org.apache.log4j.Logger;
> import org.apache.tapestry.annotations.Parameter;
> 
> import com.philips.lighting.guidecontrol.view.BreadcrumbBean;
> 
> /**
>  * The heading component holds the following pieces of Heading
> information.
>  * 
>  * <pre>
>  *    &lt;div id=&quot;heading&quot;&gt;
>  *      &lt;ul id=&quot;breadcrumbs&quot;&gt;
>  *           &lt;li
> id=&quot;prefix&quot;&gt;[ &amp;aposyou-are-here&amp;apos ]&gt;/li&gt;
>  *           { when loginPage }
>  *               &lt;li&gt;&amp;aposlogin-page&amp;apos&lt;/li&gt;
>  *           { when not loginPage }
>  *               { for all crumbs }
>  *                   { if crumb is last }
>  *                       &lt;li&gt;[ crumb text ]&lt;/li&gt;
>  *                   { if crumb is not last }
>  *                       &lt;li&gt;&lt;a href=&quot;[ crumb
> link ]&quot;&gt;[ crumb text ]&lt;/a&gt; &gt; &lt;/li&gt;
>  *      &lt;/ul&gt;
>  *    &lt;/div&gt;
>  * </pre>
>  * 
>  * @author Cumquat Information Technology
>  * 
>  */
> public class Heading {
>     private static final Logger logger =
> Logger.getLogger(Heading.class);
>     
>     @Parameter
>     private boolean loginPage = false;
> 
>     @Parameter
>     private List<BreadcrumbBean> breadCrumbs;
> 
>     private int index;
> 
>     private BreadcrumbBean crumb;
> 
>     public boolean isLoginPage() {
>         return loginPage;
>     }
> 
>     public List<BreadcrumbBean> getBreadCrumbs() {
>         return breadCrumbs;
>     }
> 
>     public void setBreadCrumbs(List<BreadcrumbBean> breadCrumbs) {
>         logger.debug("Setting breadcrumbs: "+breadCrumbs);
>         this.breadCrumbs = breadCrumbs;
>     }
> 
>     public int getIndex() {
>         return index;
>     }
> 
>     public void setIndex(int index) {
>         this.index = index;
>     }
> 
>     public BreadcrumbBean getCrumb() {
>         return crumb;
>     }
> 
>     public void setCrumb(BreadcrumbBean crumb) {
>         this.crumb = crumb;
>     }
> 
>     public boolean isLastCrumb() {
>         return (index == breadCrumbs.size() - 1);
>     }
>     
> }
> 
> On Fri, 2008-04-18 at 16:22 +0200, Chris Lewis wrote:
> > We still haven't seen your template code, where you declare this
> > component and pass it the model. I can't be sure but perhaps it will
> > shed some light...
> > 
> > Jan Vissers wrote:
> > > The problem is somehow related to the way my page and component are
> > > hooked up/working.
> > >
> > > For testing purposes I now create the Breadcrumb list in the component
> > > itself, simply returning a created list on the fly whenever
> > > getBreadCrumbs() is called. This works as expected!!!
> > >
> > > Strange thing is that via passing the 'model' to the component via a
> > > page binding the same thing doesn't work. This must be a bug?!
> > >
> > > -J.
> > >
> > > On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
> > >   
> > >> That looks good to me. I don't have an example I can look at with a
> > >> loop, but I do have one with a t:grid in which I reference a bean
> > >> property of a custom class. It's possible that the two are vastly
> > >> different, but I wouldn't think that.
> > >>
> > >> Jan Vissers wrote:
> > >>     
> > >>> On the component I have:
> > >>>
> > >>>     @Parameter
> > >>>     private List<BreadcrumbBean> breadCrumbs;
> > >>>
> > >>> This is passed in via the containg (base)page.
> > >>> And in the same component class I have:
> > >>>
> > >>>     private BreadcrumbBean crumb;
> > >>>
> > >>>     public BreadcrumbBean getCrumb() {
> > >>>         return crumb;
> > >>>     }
> > >>>
> > >>>     public void setCrumb(BreadcrumbBean crumb) {
> > >>>         this.crumb = crumb;
> > >>>     }
> > >>>
> > >>> This should be right, right?
> > >>>
> > >>> -J.
> > >>>
> > >>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
> > >>>   
> > >>>       
> > >>>> ? is your crumb property of type BreadCrumbBean, or is it type String?
> > >>>> should be same as breadCrumbs<?TYPE>
> > >>>>
> > >>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
> > >>>> wrote:
> > >>>>
> > >>>>     
> > >>>>         
> > >>>>> I can't speak about your t:if bit because I don't know what "LastCrumb"
> > >>>>> would be, but assuming that your page class has getters/setters (or the
> > >>>>> property is annotated with @Property) for the "crumb" property, a getter
> > >>>>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
> > >>>>> you *should* be good.
> > >>>>>
> > >>>>> It would be helpful if you can include the exception, specifically the
> > >>>>> line it references, etc.
> > >>>>>
> > >>>>> chris
> > >>>>>
> > >>>>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
> > >>>>> better ;-)
> > >>>>>
> > >>>>> Jan Vissers wrote:
> > >>>>>       
> > >>>>>           
> > >>>>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
> > >>>>>>
> > >>>>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
> > >>>>>>     <t:if test="LastCrumb">
> > >>>>>>        ${crumb.name}
> > >>>>>>        <t:parameter name="else">
> > >>>>>>            <a href="#"
> > >>>>>> t:type="pageLink" ....>${crumb.name}</a>
> > >>>>>>               >
> > >>>>>>        </t:parameter>
> > >>>>>>     </t:if>
> > >>>>>> </t:loop>
> > >>>>>>
> > >>>>>> -J.
> > >>>>>>
> > >>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
> > >>>>>>
> > >>>>>>         
> > >>>>>>             
> > >>>>>>> Can you share some code? At least the relevant part from template would
> > >>>>>>> be helpful.
> > >>>>>>>
> > >>>>>>> chris
> > >>>>>>>
> > >>>>>>> Jan Vissers wrote:
> > >>>>>>>
> > >>>>>>>           
> > >>>>>>>               
> > >>>>>>>> Hi,
> > >>>>>>>>
> > >>>>>>>> Just to make sure I'm not missing something.
> > >>>>>>>>
> > >>>>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
> > >>>>>>>>             
> > >>>>>>>>                 
> > >>>>> I
> > >>>>>       
> > >>>>>           
> > >>>>>>>> provided a setter|getter pair for the class involved - in this case
> > >>>>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
> > >>>>>>>> instance individually. Now T5 throws up on me with this nice coercion
> > >>>>>>>> message. Does this mean I need to contribute my own coercion - or is
> > >>>>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
> > >>>>>>>> holding three String members.
> > >>>>>>>>
> > >>>>>>>> Thanks (again :-))
> > >>>>>>>> -J.
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>> ---------------------------------------------------------------------
> > >>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>             
> > >>>>>>>>                 
> > >>>>>> ---------------------------------------------------------------------
> > >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>         
> > >>>>>>             
> > >>>>> --
> > >>>>> http://thegodcode.net
> > >>>>>
> > >>>>>
> > >>>>>       
> > >>>>>           
> > >>> ---------------------------------------------------------------------
> > >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>
> > >>>
> > >>>   
> > >>>       
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> > >   
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Jan Vissers <Ja...@cumquat.nl>.
Here it is:

import java.util.List;

import org.apache.log4j.Logger;
import org.apache.tapestry.annotations.Parameter;

import com.philips.lighting.guidecontrol.view.BreadcrumbBean;

/**
 * The heading component holds the following pieces of Heading
information.
 * 
 * <pre>
 *    &lt;div id=&quot;heading&quot;&gt;
 *      &lt;ul id=&quot;breadcrumbs&quot;&gt;
 *           &lt;li
id=&quot;prefix&quot;&gt;[ &amp;aposyou-are-here&amp;apos ]&gt;/li&gt;
 *           { when loginPage }
 *               &lt;li&gt;&amp;aposlogin-page&amp;apos&lt;/li&gt;
 *           { when not loginPage }
 *               { for all crumbs }
 *                   { if crumb is last }
 *                       &lt;li&gt;[ crumb text ]&lt;/li&gt;
 *                   { if crumb is not last }
 *                       &lt;li&gt;&lt;a href=&quot;[ crumb
link ]&quot;&gt;[ crumb text ]&lt;/a&gt; &gt; &lt;/li&gt;
 *      &lt;/ul&gt;
 *    &lt;/div&gt;
 * </pre>
 * 
 * @author Cumquat Information Technology
 * 
 */
public class Heading {
    private static final Logger logger =
Logger.getLogger(Heading.class);
    
    @Parameter
    private boolean loginPage = false;

    @Parameter
    private List<BreadcrumbBean> breadCrumbs;

    private int index;

    private BreadcrumbBean crumb;

    public boolean isLoginPage() {
        return loginPage;
    }

    public List<BreadcrumbBean> getBreadCrumbs() {
        return breadCrumbs;
    }

    public void setBreadCrumbs(List<BreadcrumbBean> breadCrumbs) {
        logger.debug("Setting breadcrumbs: "+breadCrumbs);
        this.breadCrumbs = breadCrumbs;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public BreadcrumbBean getCrumb() {
        return crumb;
    }

    public void setCrumb(BreadcrumbBean crumb) {
        this.crumb = crumb;
    }

    public boolean isLastCrumb() {
        return (index == breadCrumbs.size() - 1);
    }
    
}

On Fri, 2008-04-18 at 16:22 +0200, Chris Lewis wrote:
> We still haven't seen your template code, where you declare this
> component and pass it the model. I can't be sure but perhaps it will
> shed some light...
> 
> Jan Vissers wrote:
> > The problem is somehow related to the way my page and component are
> > hooked up/working.
> >
> > For testing purposes I now create the Breadcrumb list in the component
> > itself, simply returning a created list on the fly whenever
> > getBreadCrumbs() is called. This works as expected!!!
> >
> > Strange thing is that via passing the 'model' to the component via a
> > page binding the same thing doesn't work. This must be a bug?!
> >
> > -J.
> >
> > On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
> >   
> >> That looks good to me. I don't have an example I can look at with a
> >> loop, but I do have one with a t:grid in which I reference a bean
> >> property of a custom class. It's possible that the two are vastly
> >> different, but I wouldn't think that.
> >>
> >> Jan Vissers wrote:
> >>     
> >>> On the component I have:
> >>>
> >>>     @Parameter
> >>>     private List<BreadcrumbBean> breadCrumbs;
> >>>
> >>> This is passed in via the containg (base)page.
> >>> And in the same component class I have:
> >>>
> >>>     private BreadcrumbBean crumb;
> >>>
> >>>     public BreadcrumbBean getCrumb() {
> >>>         return crumb;
> >>>     }
> >>>
> >>>     public void setCrumb(BreadcrumbBean crumb) {
> >>>         this.crumb = crumb;
> >>>     }
> >>>
> >>> This should be right, right?
> >>>
> >>> -J.
> >>>
> >>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
> >>>   
> >>>       
> >>>> ? is your crumb property of type BreadCrumbBean, or is it type String?
> >>>> should be same as breadCrumbs<?TYPE>
> >>>>
> >>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
> >>>> wrote:
> >>>>
> >>>>     
> >>>>         
> >>>>> I can't speak about your t:if bit because I don't know what "LastCrumb"
> >>>>> would be, but assuming that your page class has getters/setters (or the
> >>>>> property is annotated with @Property) for the "crumb" property, a getter
> >>>>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
> >>>>> you *should* be good.
> >>>>>
> >>>>> It would be helpful if you can include the exception, specifically the
> >>>>> line it references, etc.
> >>>>>
> >>>>> chris
> >>>>>
> >>>>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
> >>>>> better ;-)
> >>>>>
> >>>>> Jan Vissers wrote:
> >>>>>       
> >>>>>           
> >>>>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
> >>>>>>
> >>>>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
> >>>>>>     <t:if test="LastCrumb">
> >>>>>>        ${crumb.name}
> >>>>>>        <t:parameter name="else">
> >>>>>>            <a href="#"
> >>>>>> t:type="pageLink" ....>${crumb.name}</a>
> >>>>>>               >
> >>>>>>        </t:parameter>
> >>>>>>     </t:if>
> >>>>>> </t:loop>
> >>>>>>
> >>>>>> -J.
> >>>>>>
> >>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
> >>>>>>
> >>>>>>         
> >>>>>>             
> >>>>>>> Can you share some code? At least the relevant part from template would
> >>>>>>> be helpful.
> >>>>>>>
> >>>>>>> chris
> >>>>>>>
> >>>>>>> Jan Vissers wrote:
> >>>>>>>
> >>>>>>>           
> >>>>>>>               
> >>>>>>>> Hi,
> >>>>>>>>
> >>>>>>>> Just to make sure I'm not missing something.
> >>>>>>>>
> >>>>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
> >>>>>>>>             
> >>>>>>>>                 
> >>>>> I
> >>>>>       
> >>>>>           
> >>>>>>>> provided a setter|getter pair for the class involved - in this case
> >>>>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
> >>>>>>>> instance individually. Now T5 throws up on me with this nice coercion
> >>>>>>>> message. Does this mean I need to contribute my own coercion - or is
> >>>>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
> >>>>>>>> holding three String members.
> >>>>>>>>
> >>>>>>>> Thanks (again :-))
> >>>>>>>> -J.
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> ---------------------------------------------------------------------
> >>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>             
> >>>>>>>>                 
> >>>>>> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>         
> >>>>>>             
> >>>>> --
> >>>>> http://thegodcode.net
> >>>>>
> >>>>>
> >>>>>       
> >>>>>           
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>
> >>>
> >>>   
> >>>       
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >   
> 


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Chris Lewis <ch...@bellsouth.net>.
We still haven't seen your template code, where you declare this
component and pass it the model. I can't be sure but perhaps it will
shed some light...

Jan Vissers wrote:
> The problem is somehow related to the way my page and component are
> hooked up/working.
>
> For testing purposes I now create the Breadcrumb list in the component
> itself, simply returning a created list on the fly whenever
> getBreadCrumbs() is called. This works as expected!!!
>
> Strange thing is that via passing the 'model' to the component via a
> page binding the same thing doesn't work. This must be a bug?!
>
> -J.
>
> On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
>   
>> That looks good to me. I don't have an example I can look at with a
>> loop, but I do have one with a t:grid in which I reference a bean
>> property of a custom class. It's possible that the two are vastly
>> different, but I wouldn't think that.
>>
>> Jan Vissers wrote:
>>     
>>> On the component I have:
>>>
>>>     @Parameter
>>>     private List<BreadcrumbBean> breadCrumbs;
>>>
>>> This is passed in via the containg (base)page.
>>> And in the same component class I have:
>>>
>>>     private BreadcrumbBean crumb;
>>>
>>>     public BreadcrumbBean getCrumb() {
>>>         return crumb;
>>>     }
>>>
>>>     public void setCrumb(BreadcrumbBean crumb) {
>>>         this.crumb = crumb;
>>>     }
>>>
>>> This should be right, right?
>>>
>>> -J.
>>>
>>> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
>>>   
>>>       
>>>> ? is your crumb property of type BreadCrumbBean, or is it type String?
>>>> should be same as breadCrumbs<?TYPE>
>>>>
>>>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
>>>> wrote:
>>>>
>>>>     
>>>>         
>>>>> I can't speak about your t:if bit because I don't know what "LastCrumb"
>>>>> would be, but assuming that your page class has getters/setters (or the
>>>>> property is annotated with @Property) for the "crumb" property, a getter
>>>>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
>>>>> you *should* be good.
>>>>>
>>>>> It would be helpful if you can include the exception, specifically the
>>>>> line it references, etc.
>>>>>
>>>>> chris
>>>>>
>>>>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
>>>>> better ;-)
>>>>>
>>>>> Jan Vissers wrote:
>>>>>       
>>>>>           
>>>>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
>>>>>>
>>>>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
>>>>>>     <t:if test="LastCrumb">
>>>>>>        ${crumb.name}
>>>>>>        <t:parameter name="else">
>>>>>>            <a href="#"
>>>>>> t:type="pageLink" ....>${crumb.name}</a>
>>>>>>               >
>>>>>>        </t:parameter>
>>>>>>     </t:if>
>>>>>> </t:loop>
>>>>>>
>>>>>> -J.
>>>>>>
>>>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
>>>>>>
>>>>>>         
>>>>>>             
>>>>>>> Can you share some code? At least the relevant part from template would
>>>>>>> be helpful.
>>>>>>>
>>>>>>> chris
>>>>>>>
>>>>>>> Jan Vissers wrote:
>>>>>>>
>>>>>>>           
>>>>>>>               
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Just to make sure I'm not missing something.
>>>>>>>>
>>>>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
>>>>>>>>             
>>>>>>>>                 
>>>>> I
>>>>>       
>>>>>           
>>>>>>>> provided a setter|getter pair for the class involved - in this case
>>>>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
>>>>>>>> instance individually. Now T5 throws up on me with this nice coercion
>>>>>>>> message. Does this mean I need to contribute my own coercion - or is
>>>>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
>>>>>>>> holding three String members.
>>>>>>>>
>>>>>>>> Thanks (again :-))
>>>>>>>> -J.
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>             
>>>>>>>>                 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>         
>>>>>>             
>>>>> --
>>>>> http://thegodcode.net
>>>>>
>>>>>
>>>>>       
>>>>>           
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>   
>>>       
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

-- 
http://thegodcode.net


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Jan Vissers <Ja...@cumquat.nl>.
The problem is somehow related to the way my page and component are
hooked up/working.

For testing purposes I now create the Breadcrumb list in the component
itself, simply returning a created list on the fly whenever
getBreadCrumbs() is called. This works as expected!!!

Strange thing is that via passing the 'model' to the component via a
page binding the same thing doesn't work. This must be a bug?!

-J.

On Fri, 2008-04-18 at 15:59 +0200, Chris Lewis wrote:
> That looks good to me. I don't have an example I can look at with a
> loop, but I do have one with a t:grid in which I reference a bean
> property of a custom class. It's possible that the two are vastly
> different, but I wouldn't think that.
> 
> Jan Vissers wrote:
> > On the component I have:
> >
> >     @Parameter
> >     private List<BreadcrumbBean> breadCrumbs;
> >
> > This is passed in via the containg (base)page.
> > And in the same component class I have:
> >
> >     private BreadcrumbBean crumb;
> >
> >     public BreadcrumbBean getCrumb() {
> >         return crumb;
> >     }
> >
> >     public void setCrumb(BreadcrumbBean crumb) {
> >         this.crumb = crumb;
> >     }
> >
> > This should be right, right?
> >
> > -J.
> >
> > On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
> >   
> >> ? is your crumb property of type BreadCrumbBean, or is it type String?
> >> should be same as breadCrumbs<?TYPE>
> >>
> >> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
> >> wrote:
> >>
> >>     
> >>> I can't speak about your t:if bit because I don't know what "LastCrumb"
> >>> would be, but assuming that your page class has getters/setters (or the
> >>> property is annotated with @Property) for the "crumb" property, a getter
> >>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
> >>> you *should* be good.
> >>>
> >>> It would be helpful if you can include the exception, specifically the
> >>> line it references, etc.
> >>>
> >>> chris
> >>>
> >>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
> >>> better ;-)
> >>>
> >>> Jan Vissers wrote:
> >>>       
> >>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
> >>>>
> >>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
> >>>>     <t:if test="LastCrumb">
> >>>>        ${crumb.name}
> >>>>        <t:parameter name="else">
> >>>>            <a href="#"
> >>>> t:type="pageLink" ....>${crumb.name}</a>
> >>>>               >
> >>>>        </t:parameter>
> >>>>     </t:if>
> >>>> </t:loop>
> >>>>
> >>>> -J.
> >>>>
> >>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
> >>>>
> >>>>         
> >>>>> Can you share some code? At least the relevant part from template would
> >>>>> be helpful.
> >>>>>
> >>>>> chris
> >>>>>
> >>>>> Jan Vissers wrote:
> >>>>>
> >>>>>           
> >>>>>> Hi,
> >>>>>>
> >>>>>> Just to make sure I'm not missing something.
> >>>>>>
> >>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
> >>>>>>             
> >>> I
> >>>       
> >>>>>> provided a setter|getter pair for the class involved - in this case
> >>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
> >>>>>> instance individually. Now T5 throws up on me with this nice coercion
> >>>>>> message. Does this mean I need to contribute my own coercion - or is
> >>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
> >>>>>> holding three String members.
> >>>>>>
> >>>>>> Thanks (again :-))
> >>>>>> -J.
> >>>>>>
> >>>>>>
> >>>>>> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>             
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>
> >>>>
> >>>>
> >>>>         
> >>> --
> >>> http://thegodcode.net
> >>>
> >>>
> >>>       
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >   
> 


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Chris Lewis <ch...@bellsouth.net>.
That looks good to me. I don't have an example I can look at with a
loop, but I do have one with a t:grid in which I reference a bean
property of a custom class. It's possible that the two are vastly
different, but I wouldn't think that.

Jan Vissers wrote:
> On the component I have:
>
>     @Parameter
>     private List<BreadcrumbBean> breadCrumbs;
>
> This is passed in via the containg (base)page.
> And in the same component class I have:
>
>     private BreadcrumbBean crumb;
>
>     public BreadcrumbBean getCrumb() {
>         return crumb;
>     }
>
>     public void setCrumb(BreadcrumbBean crumb) {
>         this.crumb = crumb;
>     }
>
> This should be right, right?
>
> -J.
>
> On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
>   
>> ? is your crumb property of type BreadCrumbBean, or is it type String?
>> should be same as breadCrumbs<?TYPE>
>>
>> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
>> wrote:
>>
>>     
>>> I can't speak about your t:if bit because I don't know what "LastCrumb"
>>> would be, but assuming that your page class has getters/setters (or the
>>> property is annotated with @Property) for the "crumb" property, a getter
>>> for your "breadCrumbs," and your crumb bean defines a "getName" method,
>>> you *should* be good.
>>>
>>> It would be helpful if you can include the exception, specifically the
>>> line it references, etc.
>>>
>>> chris
>>>
>>> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
>>> better ;-)
>>>
>>> Jan Vissers wrote:
>>>       
>>>> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
>>>>
>>>>  <t:loop source="breadCrumbs" value="crumb" index="index">
>>>>     <t:if test="LastCrumb">
>>>>        ${crumb.name}
>>>>        <t:parameter name="else">
>>>>            <a href="#"
>>>> t:type="pageLink" ....>${crumb.name}</a>
>>>>               >
>>>>        </t:parameter>
>>>>     </t:if>
>>>> </t:loop>
>>>>
>>>> -J.
>>>>
>>>> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
>>>>
>>>>         
>>>>> Can you share some code? At least the relevant part from template would
>>>>> be helpful.
>>>>>
>>>>> chris
>>>>>
>>>>> Jan Vissers wrote:
>>>>>
>>>>>           
>>>>>> Hi,
>>>>>>
>>>>>> Just to make sure I'm not missing something.
>>>>>>
>>>>>> In T4 when I wrote a @For construct I could use value="..." as long as
>>>>>>             
>>> I
>>>       
>>>>>> provided a setter|getter pair for the class involved - in this case
>>>>>> BreadcrumbBean. I want to iterate over a list of beans and use each
>>>>>> instance individually. Now T5 throws up on me with this nice coercion
>>>>>> message. Does this mean I need to contribute my own coercion - or is
>>>>>> there a more simple way? In my case BreadcrumbBean is a simple class
>>>>>> holding three String members.
>>>>>>
>>>>>> Thanks (again :-))
>>>>>> -J.
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>>         
>>> --
>>> http://thegodcode.net
>>>
>>>
>>>       
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

-- 
http://thegodcode.net


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Jan Vissers <Ja...@cumquat.nl>.
On the component I have:

    @Parameter
    private List<BreadcrumbBean> breadCrumbs;

This is passed in via the containg (base)page.
And in the same component class I have:

    private BreadcrumbBean crumb;

    public BreadcrumbBean getCrumb() {
        return crumb;
    }

    public void setCrumb(BreadcrumbBean crumb) {
        this.crumb = crumb;
    }

This should be right, right?

-J.

On Fri, 2008-04-18 at 14:00 +0100, nicholas Krul wrote:
> ? is your crumb property of type BreadCrumbBean, or is it type String?
> should be same as breadCrumbs<?TYPE>
> 
> On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
> wrote:
> 
> > I can't speak about your t:if bit because I don't know what "LastCrumb"
> > would be, but assuming that your page class has getters/setters (or the
> > property is annotated with @Property) for the "crumb" property, a getter
> > for your "breadCrumbs," and your crumb bean defines a "getName" method,
> > you *should* be good.
> >
> > It would be helpful if you can include the exception, specifically the
> > line it references, etc.
> >
> > chris
> >
> > PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
> > better ;-)
> >
> > Jan Vissers wrote:
> > > Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
> > >
> > >  <t:loop source="breadCrumbs" value="crumb" index="index">
> > >     <t:if test="LastCrumb">
> > >        ${crumb.name}
> > >        <t:parameter name="else">
> > >            <a href="#"
> > > t:type="pageLink" ....>${crumb.name}</a>
> > >               >
> > >        </t:parameter>
> > >     </t:if>
> > > </t:loop>
> > >
> > > -J.
> > >
> > > On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
> > >
> > >> Can you share some code? At least the relevant part from template would
> > >> be helpful.
> > >>
> > >> chris
> > >>
> > >> Jan Vissers wrote:
> > >>
> > >>> Hi,
> > >>>
> > >>> Just to make sure I'm not missing something.
> > >>>
> > >>> In T4 when I wrote a @For construct I could use value="..." as long as
> > I
> > >>> provided a setter|getter pair for the class involved - in this case
> > >>> BreadcrumbBean. I want to iterate over a list of beans and use each
> > >>> instance individually. Now T5 throws up on me with this nice coercion
> > >>> message. Does this mean I need to contribute my own coercion - or is
> > >>> there a more simple way? In my case BreadcrumbBean is a simple class
> > >>> holding three String members.
> > >>>
> > >>> Thanks (again :-))
> > >>> -J.
> > >>>
> > >>>
> > >>> ---------------------------------------------------------------------
> > >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>
> > >>>
> > >>>
> > >>>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> > >
> >
> > --
> > http://thegodcode.net
> >
> >


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by nicholas Krul <ni...@gmail.com>.
? is your crumb property of type BreadCrumbBean, or is it type String?
should be same as breadCrumbs<?TYPE>

On Fri, Apr 18, 2008 at 1:56 PM, Chris Lewis <ch...@bellsouth.net>
wrote:

> I can't speak about your t:if bit because I don't know what "LastCrumb"
> would be, but assuming that your page class has getters/setters (or the
> property is annotated with @Property) for the "crumb" property, a getter
> for your "breadCrumbs," and your crumb bean defines a "getName" method,
> you *should* be good.
>
> It would be helpful if you can include the exception, specifically the
> line it references, etc.
>
> chris
>
> PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
> better ;-)
>
> Jan Vissers wrote:
> > Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
> >
> >  <t:loop source="breadCrumbs" value="crumb" index="index">
> >     <t:if test="LastCrumb">
> >        ${crumb.name}
> >        <t:parameter name="else">
> >            <a href="#"
> > t:type="pageLink" ....>${crumb.name}</a>
> >               >
> >        </t:parameter>
> >     </t:if>
> > </t:loop>
> >
> > -J.
> >
> > On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
> >
> >> Can you share some code? At least the relevant part from template would
> >> be helpful.
> >>
> >> chris
> >>
> >> Jan Vissers wrote:
> >>
> >>> Hi,
> >>>
> >>> Just to make sure I'm not missing something.
> >>>
> >>> In T4 when I wrote a @For construct I could use value="..." as long as
> I
> >>> provided a setter|getter pair for the class involved - in this case
> >>> BreadcrumbBean. I want to iterate over a list of beans and use each
> >>> instance individually. Now T5 throws up on me with this nice coercion
> >>> message. Does this mean I need to contribute my own coercion - or is
> >>> there a more simple way? In my case BreadcrumbBean is a simple class
> >>> holding three String members.
> >>>
> >>> Thanks (again :-))
> >>> -J.
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>
> >>>
> >>>
> >>>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >
>
> --
> http://thegodcode.net
>
>

Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Chris Lewis <ch...@bellsouth.net>.
I can't speak about your t:if bit because I don't know what "LastCrumb"
would be, but assuming that your page class has getters/setters (or the
property is annotated with @Property) for the "crumb" property, a getter
for your "breadCrumbs," and your crumb bean defines a "getName" method,
you *should* be good.

It would be helpful if you can include the exception, specifically the
line it references, etc.

chris

PS the list is good, the IRC channel (irc.freenode.net #tapestry) is
better ;-)

Jan Vissers wrote:
> Yep, sure, I may I add - This mailing list is great and Tapestry rocks!
>
>  <t:loop source="breadCrumbs" value="crumb" index="index">
>     <t:if test="LastCrumb">
>        ${crumb.name}
>        <t:parameter name="else">
>            <a href="#"
> t:type="pageLink" ....>${crumb.name}</a>                            
>               >
>        </t:parameter>
>     </t:if>
> </t:loop>
>
> -J.
>
> On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
>   
>> Can you share some code? At least the relevant part from template would
>> be helpful.
>>
>> chris
>>
>> Jan Vissers wrote:
>>     
>>> Hi,
>>>
>>> Just to make sure I'm not missing something.
>>>
>>> In T4 when I wrote a @For construct I could use value="..." as long as I
>>> provided a setter|getter pair for the class involved - in this case
>>> BreadcrumbBean. I want to iterate over a list of beans and use each
>>> instance individually. Now T5 throws up on me with this nice coercion
>>> message. Does this mean I need to contribute my own coercion - or is
>>> there a more simple way? In my case BreadcrumbBean is a simple class
>>> holding three String members.
>>>
>>> Thanks (again :-))
>>> -J.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>   
>>>       
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

-- 
http://thegodcode.net


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Jan Vissers <Ja...@cumquat.nl>.
Yep, sure, I may I add - This mailing list is great and Tapestry rocks!

 <t:loop source="breadCrumbs" value="crumb" index="index">
    <t:if test="LastCrumb">
       ${crumb.name}
       <t:parameter name="else">
           <a href="#"
t:type="pageLink" ....>${crumb.name}</a>                            
              >
       </t:parameter>
    </t:if>
</t:loop>

-J.

On Fri, 2008-04-18 at 14:34 +0200, Chris Lewis wrote:
> Can you share some code? At least the relevant part from template would
> be helpful.
> 
> chris
> 
> Jan Vissers wrote:
> > Hi,
> >
> > Just to make sure I'm not missing something.
> >
> > In T4 when I wrote a @For construct I could use value="..." as long as I
> > provided a setter|getter pair for the class involved - in this case
> > BreadcrumbBean. I want to iterate over a list of beans and use each
> > instance individually. Now T5 throws up on me with this nice coercion
> > message. Does this mean I need to contribute my own coercion - or is
> > there a more simple way? In my case BreadcrumbBean is a simple class
> > holding three String members.
> >
> > Thanks (again :-))
> > -J.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >   
> 


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


Re: Could not find a coercion from type java.lang.String to type com.****.lighting.guidecontrol.view.BreadcrumbBean

Posted by Chris Lewis <ch...@bellsouth.net>.
Can you share some code? At least the relevant part from template would
be helpful.

chris

Jan Vissers wrote:
> Hi,
>
> Just to make sure I'm not missing something.
>
> In T4 when I wrote a @For construct I could use value="..." as long as I
> provided a setter|getter pair for the class involved - in this case
> BreadcrumbBean. I want to iterate over a list of beans and use each
> instance individually. Now T5 throws up on me with this nice coercion
> message. Does this mean I need to contribute my own coercion - or is
> there a more simple way? In my case BreadcrumbBean is a simple class
> holding three String members.
>
> Thanks (again :-))
> -J.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   

-- 
http://thegodcode.net


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