You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Heping Zhang <ph...@gmail.com> on 2007/05/30 05:07:07 UTC
Can't a Component has its own listener?
hi, I have a Border component like this:
<html jwcid="@Shell"
title="test"
>
<body jwcid="@Body">
<a jwcid="@DirectLink" listener="listener:showDialog"
updateComponents="testDialog3">Show 3</a><br/>
<div jwcid="testDialog3@Dialog" hidden="ognl:dlHidden3" >
<p style="display:block;background:#ffffff;width:20em;">
This is content hidden in a Dialog.
<a href="#" onClick="dojo.widget.byId('testDialog3').hide();return
false">Close</a>
</p>
</div>
<span jwcid="@RenderBody" />
</body>
</html>
And in Border.java I have a method:
public abstract class Border extends BasePage {
public void showDialog() {
Dialog dlg = (Dialog) getComponent("testDialog3");
dlg.show();
}
}
However, when I call this component in Home page, it keeps tell me
Object $BaseComponent_157@4e8c6265[Home/$Border] does not implement a
listener method named 'showDialog'
But I do have this method! I found this:
http://tapestry.apache.org/tapestry4.1/usersguide/listenermethods.html
is that means component can't has its own listeners defined in itself?
Thank you in advance.
Re: Can't a Component has its own listener?
Posted by Heping Zhang <ph...@gmail.com>.
Thank you Jesse! It is because of the
org.apache.tapestry.component-class-packages configuration. In fact I just
thought org.apache.tapestry.page-class-packages is enough and I don't know
there is a org.apache.tapestry.component-class-packages. Thank you!
Re: Can't a Component has its own listener?
Posted by Jesse Kuhnert <jk...@gmail.com>.
It's not associating your html template with your java class for some reason
- the key is seeing the BaseComponent doesn't implement blah blah.
Either the org.apache.tapestry.component-class-packages configuration you
may/may not have setup isn't setup to correctly resolve it or if not using
that method you don't have a Border.page file setup with a class=""
definition pointing to your Border class.
On 5/29/07, Heping Zhang <ph...@gmail.com> wrote:
>
> hi, I have a Border component like this:
> <html jwcid="@Shell"
> title="test"
> >
> <body jwcid="@Body">
> <a jwcid="@DirectLink" listener="listener:showDialog"
> updateComponents="testDialog3">Show 3</a><br/>
>
> <div jwcid="testDialog3@Dialog" hidden="ognl:dlHidden3" >
> <p style="display:block;background:#ffffff;width:20em;">
> This is content hidden in a Dialog.
>
> <a href="#" onClick="dojo.widget.byId('testDialog3').hide();return
> false">Close</a>
> </p>
> </div>
>
> <span jwcid="@RenderBody" />
> </body>
> </html>
>
> And in Border.java I have a method:
> public abstract class Border extends BasePage {
> public void showDialog() {
> Dialog dlg = (Dialog) getComponent("testDialog3");
> dlg.show();
> }
> }
>
> However, when I call this component in Home page, it keeps tell me
> Object $BaseComponent_157@4e8c6265[Home/$Border] does not implement a
> listener method named 'showDialog'
> But I do have this method! I found this:
> http://tapestry.apache.org/tapestry4.1/usersguide/listenermethods.html
> is that means component can't has its own listeners defined in itself?
> Thank you in advance.
>
--
Jesse Kuhnert
Tapestry/Dojo team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com