Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-13 Thread Yunhua Sang
Cool idea, your way really shows how powerful and extendable tapestry is. Thanks! On Fri, Feb 13, 2009 at 3:21 PM, Robert Zeigler wrote: > Interesting. I wonder, though, if you could do this another way, that > doesn't involve duplicating all of the parameters of grid. > > What if you provided a

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-13 Thread Thiago H. de Paula Figueiredo
Em Fri, 13 Feb 2009 16:43:57 -0300, Yunhua Sang escreveu: I want to provide user a jpa entity grid component, which will provide its own griddatasource and hide it to end user; user instead will provide an ejbql for the entity grid and the component will execute the ejbql, generate griddataso

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-13 Thread Robert Zeigler
Interesting. I wonder, though, if you could do this another way, that doesn't involve duplicating all of the parameters of grid. What if you provided a coercion from an EJBQL query to GridDataSource? If you want the query to be specifiable as a string in, eg, the template, then you could als

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-13 Thread Yunhua Sang
I want to provide user a jpa entity grid component, which will provide its own griddatasource and hide it to end user; user instead will provide an ejbql for the entity grid and the component will execute the ejbql, generate griddatasource, show results in grid. It's a good example of simplifying/e

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-13 Thread Robert Zeigler
Depending on what you're trying to do, you may be able to accomplish what you want with a mixin, and avoid having to duplicate any parameters at all. On a project awhile back, for example, I wrote a "filter" mixin for grid so any grid could have filtering applied to it just by adding the mi

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-13 Thread Yunhua Sang
Hi guys, Thanks for all your input. I've decided to change my code to use composition instead of inheritance, though I still remain my opinion: it would be very nice too that inheritance is perfectly support in Tapestry. Now I am going to modify my code... one of my component is a sub-class of Gr

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-12 Thread Robert Zeigler
On Feb 12, 2009, at 2/126:55 PM , Howard Lewis Ship wrote: On Thu, Feb 12, 2009 at 12:58 PM, Robert Zeigler wrote: 0) I don't usually extend components; I prefer building things based on composition. That said: Which is the point of Tapestry! Agreed! But our friend isn't using composi

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-12 Thread Howard Lewis Ship
On Thu, Feb 12, 2009 at 12:58 PM, Robert Zeigler wrote: > 0) I don't usually extend components; I prefer building things based on > composition. That said: > Which is the point of Tapestry! > 2) This will work iff your parent class also implements a "defaultName" > method that the subclass over

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-12 Thread Robert Zeigler
0) I don't usually extend components; I prefer building things based on composition. That said: 2) This will work iff your parent class also implements a "defaultName" method that the subclass overrides. Just tried it to be sure. 3) You can provide getters and setters for the property. P

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-12 Thread Yunhua Sang
Hi Robert, 2) I tried your way, it doesn't work; it doesn't work even back to 5.0.18. 3) I don't think the get/set methods would work for parameters; look at ParameterWorker class, it's fairly complicated because of the implementation of the binding magic. Thanks, Richard On Thu, Feb 12, 2009 a

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-12 Thread Thiago H. de Paula Figueiredo
Em Thu, 12 Feb 2009 16:56:09 -0300, Robert Zeigler escreveu: 3) Otherwise, access in the child via code is mediated through normal java channels: create a public (or protected) getter and setter in the Parent class. I guess he's trying to subclass Tapestry core components. This was alrea

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-12 Thread Robert Zeigler
1) Since Child extends Parent, it already has a name @Parameter. 2) If you want to provide the default in the child, you can always provide the "default" method: String defaultName() { return "Tom"; } 3) Otherwise, access in the child via code is mediated through

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-12 Thread Yunhua Sang
Hi Howard, Can you show me in a child component, how to access a parameter defined in parent by using another way? I cannot find api which isn't internal about it. By the way, seems it's also diffcult to provide default binding for a parameter within parent because function bindParameter(String pa

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-12 Thread Christian Edward Gruber
Jeez - I didn't read the example well. I was not thinking @Parameter, I was thinking @Property. A parameter means something else entirely. Sorry, Christian. On 12-Feb-09, at 11:35 , Howard Lewis Ship wrote: I think even that is ambiguous. On Thu, Feb 12, 2009 at 8:29 AM, Christian Edward

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-12 Thread Howard Lewis Ship
I think even that is ambiguous. On Thu, Feb 12, 2009 at 8:29 AM, Christian Edward Gruber wrote: > Would an @OverrideDefault annotation be appropriate here as a signal? (I'd > just say just @Override for readability, but that's been used) > > Christian > > On 12-Feb-09, at 11:10 , Howard Lewis Sh

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-12 Thread Christian Edward Gruber
Would an @OverrideDefault annotation be appropriate here as a signal? (I'd just say just @Override for readability, but that's been used) Christian On 12-Feb-09, at 11:10 , Howard Lewis Ship wrote: It looks to me like theres an ambiguity here: I don't think a child component should be allow

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-12 Thread Howard Lewis Ship
It looks to me like theres an ambiguity here: I don't think a child component should be allowed to declare a second parameter, "name" in this example, that is already defined in a super-class. On Wed, Feb 11, 2009 at 12:20 PM, Yunhua Sang wrote: > Hello Howard, > > It turns out the error occurs o

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-11 Thread Yunhua Sang
Hello Howard, It turns out the error occurs only when the child wants to provide its own default binding for a parameter originally defined in parent; example: public class Parent { @Parameter private String name; void setupRender() { name.toUpperCase(); // NPE happens here

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-11 Thread Howard Lewis Ship
I'm not aware of anything that's changed in this area; could you elaborate? On Wed, Feb 11, 2009 at 10:56 AM, Yunhua Sang wrote: > Hello all, > > It seems there is no clear document about how to access a parameter > defined in parent component; previous to 5.0.18, I was using the way > of declari

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-11 Thread Yunhua Sang
Hi Uli, inherit is used between a component and its container, it doesn't work in class and sub-class scenario. Thanks, Yunhua On Wed, Feb 11, 2009 at 2:04 PM, Ulrich Stärk wrote: > I've never done it, but there's the inherit: parameter binding, maybe that's > what you are looking for. Check th

Re: T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-11 Thread Ulrich Stärk
I've never done it, but there's the inherit: parameter binding, maybe that's what you are looking for. Check the component paramter docs in the user guide. Uli Yunhua Sang schrieb: Hello all, It seems there is no clear document about how to access a parameter defined in parent component; prev

T5 Question: how to access a parameter defined in parent component(not container) in 5.1.0.0

2009-02-11 Thread Yunhua Sang
Hello all, It seems there is no clear document about how to access a parameter defined in parent component; previous to 5.0.18, I was using the way of declaring the parameter again in child class and it worked well; however looks like some changes in 5.1.0.0 broke the way, seems there is no link b