Move your abstract page out of your pages package.
http://tapestry.apache.org/tapestry5/tapestry-core/guide/component-classes.html:
"In addition, it is common for an application to have base classes,
often abstract base classes, that should not be directly referenced.
These should not go in the p
ROTECTED]>
wrote:
> Add the @Property annotation to dummy in component class to provide
> getter+setter?
>
> > -Original Message-
> > From: Jan Vissers [mailto:[EMAIL PROTECTED]
> > Sent: 18 April 2008 11:59
> > To: nicholas Krul
> > Cc: Tapestr
Add the @Property annotation to dummy in component class to provide
getter+setter?
> -Original Message-
> From: Jan Vissers [mailto:[EMAIL PROTECTED]
> Sent: 18 April 2008 11:59
> To: nicholas Krul
> Cc: Tapestry users
> Subject: Re: T5: How do I access a page proper
Somehow got it working:
AbstractBasePage (AbstractBasePage.java) declares:
public int getSize() {
return 57575; //Test
}
Layout declares (Layout.java):
@InjectContainer
private AbstractBasePage basePage;
Heading component on Layout template declares (Layout.tml):
Heading
This approach doesn't work.
Top level class->
public abstract class AbstractBasePage {
private int dummy;
public int getDummy() {
return 14575; //Test
}
}
Component class (which is part of Layout)
@Parameter
private int dummy;
Component template
${d
@Paramater per property required.
If you need access to all of them as a bundle, consider wrapping them into a
class.
...
or (I guess) you could use
@Parameter
private MyBasePageClass basePage;
and make sure that the MyBasePageClass has a getThis(return this;) method
bind as
(I think)
I'd
Noticed the @InjectPage annotation and tried that - as the javadoc
talked about accessing read only properties of a page. However I get
this:
[ERROR] RequestExceptionHandler Processing of request failed with
uncaught exception:
com.*.lighting.guidecontrol.view.pages.AbstractBasePage
java.lang.
Ok - figured out what @InjectContainer gives me.
Although I'm not quite happy with it, as it returns another component,
which contains the component - but not the actual page. This is one
level further up the foodchain for me ;-)
Would be nice to have a direct way to access page properties :-(
-
Thanks - but I don't understand...
What is the parameter - the containing page?
Basically I want to access a property from my 'AbstractBasePage' which
has some common properties on it from a component that is placed on a
concrete page.
@Chris: regarding your hint of @InjectContainer...? what sho
bind it as a paramater
@Paramater(required=true) //only if required
Object needed
On Fri, Apr 18, 2008 at 11:07 AM, Chris Lewis <[EMAIL PROTECTED]>
wrote:
> Jan,
>
> There's probably a simpler way, but you should be able to use
> @InjectContainer in your component to get the page and call what
Jan,
There's probably a simpler way, but you should be able to use
@InjectContainer in your component to get the page and call whatever
methods (in your case a a getter) you want. I imagine there's a more
terse way, but I'm not sure what it would be.
chris
Jan Vissers wrote:
> Hi,
>
> I want to
Hi,
I want to access a page property from within my component - that has
been placed on that page. In T4 I had something like 'page.' - how is
this done in T5?
Thx,
-J.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
12 matches
Mail list logo