Re: [t5.2.6] Composing pages through inheritance problem

2011-09-29 Thread Thiago H. de Paula Figueiredo
On Wed, 28 Sep 2011 13:17:10 -0300, Muhammad Gelbana   
wrote:



I hope one day I can as helpful as you are..for no less than helping you
back :)


Just help people in this mailing list, blog about Tapestry if you have a  
blog, and I'll be very, very happy. :)


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: [t5.2.6] Composing pages through inheritance problem

2011-09-28 Thread Muhammad Gelbana
I hope one day I can as helpful as you are..for no less than helping you
back :)

On Wed, Sep 28, 2011 at 3:51 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 28 Sep 2011 10:38:53 -0300, Taha Hafeez 
> wrote:
>
>  Have you looked at
>> http://tawus.wordpress.com/**2011/04/20/tapestry-magic-3-**plugin-blocks/
>>
>
> Which is basically the same approach used by BeanEditor, Grid and other
> BeanModel-based components. A proven approach. :)
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*


Re: [t5.2.6] Composing pages through inheritance problem

2011-09-28 Thread Thiago H. de Paula Figueiredo
On Wed, 28 Sep 2011 10:38:53 -0300, Taha Hafeez   
wrote:



Have you looked at
http://tawus.wordpress.com/2011/04/20/tapestry-magic-3-plugin-blocks/


Which is basically the same approach used by BeanEditor, Grid and other  
BeanModel-based components. A proven approach. :)


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: [t5.2.6] Composing pages through inheritance problem

2011-09-28 Thread Taha Hafeez
Have you looked at
http://tawus.wordpress.com/2011/04/20/tapestry-magic-3-plugin-blocks/



On Wed, Sep 28, 2011 at 6:13 PM, Muhammad Gelbana  wrote:
> I know you mean I should use components but in what way ?
> I retracted the inheritance approache and replaced it with the
> switchingidea which
> is marvelous. This way I won't get into the messy "t:if" tree.
>
> I'm trying to figure out *every possible way* of composing pages from
> components, that's why I asked you what do you mean :)
> And this way I'll learn more about components till hopefully reach the point
> when I say "Now I get it !" :)
>
> For example consider this case, what if I want to have the blocks in the
> switching example, to be in a separate .tml file ? Just to reduce the page's
> size and make it easier to maintain.
>
> Actually I can apply this idea to the common test fields part. It's a bean
> editor declaration in the page's .tml file:
> *         object="commonTestData">*
> * *
> * *
> * *
> * *
> * *
>
> Is it possible to get this bean-editor's declaration from another .tml file
> ? I tried extending the bean editor component, but I couldn't figure out
> what to put in the .tml file ! Can mixins fit in ?
>
> I'm all about trying everything and mastering this very flexible and nice
> framework, that's why I'm asking too many questions :)
>
> Thank you for your time :)
>
> On Wed, Sep 28, 2011 at 1:37 PM, Taha Hafeez wrote:
>
>> Use components :)
>>
>>
>> On Wed, Sep 28, 2011 at 5:03 PM, Muhammad Gelbana 
>> wrote:
>> > Thank you Taha :)
>> >
>> > But what do you mean by "You can always re-factor your code by
>> composition."
>> >
>> >
>> > On Wed, Sep 28, 2011 at 1:11 PM, Taha Hafeez > >wrote:
>> >
>> >> Hi Muhammad
>> >>
>> >> I don't think inheritance is the best approach with tapestry. You can
>> >> always re-factor your code by composition. Using components is always
>> >> a better approach.
>> >>
>> >> If you have a child page trying to access a component in parent page,
>> >> IMHO, you should reconsider your refactoring.
>> >>
>> >> On Wed, Sep 28, 2011 at 3:58 PM, Muhammad Gelbana 
>> >> wrote:
>> >> > This is a new approach I'm taking to compose pages. I'm trying to
>> convert
>> >> an
>> >> > existing application to tapestry but one page turned out to be really
>> big
>> >> > and hard to maintain. This page has many form fields. Some fields
>> should
>> >> > always exists, and conditionally show other fields depending on a
>> >> condition,
>> >> > let's say a "test type".
>> >> >
>> >> > I used to do this in one page template, then conditionally showing the
>> >> > fields I want using the "t:if" component and a configured bean-editor
>> >> > inside.
>> >> > Then I decided to go more scalable so I decided to make a page for
>> each
>> >> > "test" and inherit the page with the common fields. This will release
>> me
>> >> for
>> >> > the messy "t:if" "p:else" tags all over the center of the page.
>> >> >
>> >> > Now I'm facing an issue that my parent page has injected components
>> >> > (@InjectComponent) and when displaying the child page, it complains:
>> >> > Component tests/DNSTest does not contain embedded component
>> >> 'gatewayField'.
>> >> > The "gatewayField" variable exists in the parent page as:
>> >> > @InjectComponent
>> >> > private TextField gatewayField
>> >> >
>> >> > ..and there are other fields. I tried adding @Property, and
>> >> getters\setters
>> >> > my self, still didn't work. It only worked when I commented these
>> fields
>> >> and
>> >> > code referring to them.
>> >> >
>> >> > How can I resolve this ? And is this the best approach to dynamically
>> >> > construct a page ?
>> >> >
>> >> > Thank you all for your time :)
>> >> >
>> >> > --
>> >> > *Regards,*
>> >> > *Muhammad Gelbana
>> >> > Java Developer*
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Regards
>> >>
>> >> Taha Hafeez Siddiqi (tawus)
>> >> http://tawus.wordpress.com
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> >> For additional commands, e-mail: users-h...@tapestry.apache.org
>> >>
>> >>
>> >
>> >
>> > --
>> > *Regards,*
>> > *Muhammad Gelbana
>> > Java Developer*
>> >
>>
>>
>>
>> --
>> Regards
>>
>> Taha Hafeez Siddiqi (tawus)
>> http://tawus.wordpress.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
>
> --
> *Regards,*
> *Muhammad Gelbana
> Java Developer*
>



-- 
Regards

Taha Hafeez Siddiqi (tawus)
http://tawus.wordpress.com

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



Re: [t5.2.6] Composing pages through inheritance problem

2011-09-28 Thread Muhammad Gelbana
I know you mean I should use components but in what way ?
I retracted the inheritance approache and replaced it with the
switchingidea which
is marvelous. This way I won't get into the messy "t:if" tree.

I'm trying to figure out *every possible way* of composing pages from
components, that's why I asked you what do you mean :)
And this way I'll learn more about components till hopefully reach the point
when I say "Now I get it !" :)

For example consider this case, what if I want to have the blocks in the
switching example, to be in a separate .tml file ? Just to reduce the page's
size and make it easier to maintain.

Actually I can apply this idea to the common test fields part. It's a bean
editor declaration in the page's .tml file:
**
* *
* *
* *
* *
* *

Is it possible to get this bean-editor's declaration from another .tml file
? I tried extending the bean editor component, but I couldn't figure out
what to put in the .tml file ! Can mixins fit in ?

I'm all about trying everything and mastering this very flexible and nice
framework, that's why I'm asking too many questions :)

Thank you for your time :)

On Wed, Sep 28, 2011 at 1:37 PM, Taha Hafeez wrote:

> Use components :)
>
>
> On Wed, Sep 28, 2011 at 5:03 PM, Muhammad Gelbana 
> wrote:
> > Thank you Taha :)
> >
> > But what do you mean by "You can always re-factor your code by
> composition."
> >
> >
> > On Wed, Sep 28, 2011 at 1:11 PM, Taha Hafeez  >wrote:
> >
> >> Hi Muhammad
> >>
> >> I don't think inheritance is the best approach with tapestry. You can
> >> always re-factor your code by composition. Using components is always
> >> a better approach.
> >>
> >> If you have a child page trying to access a component in parent page,
> >> IMHO, you should reconsider your refactoring.
> >>
> >> On Wed, Sep 28, 2011 at 3:58 PM, Muhammad Gelbana 
> >> wrote:
> >> > This is a new approach I'm taking to compose pages. I'm trying to
> convert
> >> an
> >> > existing application to tapestry but one page turned out to be really
> big
> >> > and hard to maintain. This page has many form fields. Some fields
> should
> >> > always exists, and conditionally show other fields depending on a
> >> condition,
> >> > let's say a "test type".
> >> >
> >> > I used to do this in one page template, then conditionally showing the
> >> > fields I want using the "t:if" component and a configured bean-editor
> >> > inside.
> >> > Then I decided to go more scalable so I decided to make a page for
> each
> >> > "test" and inherit the page with the common fields. This will release
> me
> >> for
> >> > the messy "t:if" "p:else" tags all over the center of the page.
> >> >
> >> > Now I'm facing an issue that my parent page has injected components
> >> > (@InjectComponent) and when displaying the child page, it complains:
> >> > Component tests/DNSTest does not contain embedded component
> >> 'gatewayField'.
> >> > The "gatewayField" variable exists in the parent page as:
> >> > @InjectComponent
> >> > private TextField gatewayField
> >> >
> >> > ..and there are other fields. I tried adding @Property, and
> >> getters\setters
> >> > my self, still didn't work. It only worked when I commented these
> fields
> >> and
> >> > code referring to them.
> >> >
> >> > How can I resolve this ? And is this the best approach to dynamically
> >> > construct a page ?
> >> >
> >> > Thank you all for your time :)
> >> >
> >> > --
> >> > *Regards,*
> >> > *Muhammad Gelbana
> >> > Java Developer*
> >> >
> >>
> >>
> >>
> >> --
> >> Regards
> >>
> >> Taha Hafeez Siddiqi (tawus)
> >> http://tawus.wordpress.com
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >>
> >
> >
> > --
> > *Regards,*
> > *Muhammad Gelbana
> > Java Developer*
> >
>
>
>
> --
> Regards
>
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*


Re: [t5.2.6] Composing pages through inheritance problem

2011-09-28 Thread Taha Hafeez
Use components :)


On Wed, Sep 28, 2011 at 5:03 PM, Muhammad Gelbana  wrote:
> Thank you Taha :)
>
> But what do you mean by "You can always re-factor your code by composition."
>
>
> On Wed, Sep 28, 2011 at 1:11 PM, Taha Hafeez wrote:
>
>> Hi Muhammad
>>
>> I don't think inheritance is the best approach with tapestry. You can
>> always re-factor your code by composition. Using components is always
>> a better approach.
>>
>> If you have a child page trying to access a component in parent page,
>> IMHO, you should reconsider your refactoring.
>>
>> On Wed, Sep 28, 2011 at 3:58 PM, Muhammad Gelbana 
>> wrote:
>> > This is a new approach I'm taking to compose pages. I'm trying to convert
>> an
>> > existing application to tapestry but one page turned out to be really big
>> > and hard to maintain. This page has many form fields. Some fields should
>> > always exists, and conditionally show other fields depending on a
>> condition,
>> > let's say a "test type".
>> >
>> > I used to do this in one page template, then conditionally showing the
>> > fields I want using the "t:if" component and a configured bean-editor
>> > inside.
>> > Then I decided to go more scalable so I decided to make a page for each
>> > "test" and inherit the page with the common fields. This will release me
>> for
>> > the messy "t:if" "p:else" tags all over the center of the page.
>> >
>> > Now I'm facing an issue that my parent page has injected components
>> > (@InjectComponent) and when displaying the child page, it complains:
>> > Component tests/DNSTest does not contain embedded component
>> 'gatewayField'.
>> > The "gatewayField" variable exists in the parent page as:
>> > @InjectComponent
>> > private TextField gatewayField
>> >
>> > ..and there are other fields. I tried adding @Property, and
>> getters\setters
>> > my self, still didn't work. It only worked when I commented these fields
>> and
>> > code referring to them.
>> >
>> > How can I resolve this ? And is this the best approach to dynamically
>> > construct a page ?
>> >
>> > Thank you all for your time :)
>> >
>> > --
>> > *Regards,*
>> > *Muhammad Gelbana
>> > Java Developer*
>> >
>>
>>
>>
>> --
>> Regards
>>
>> Taha Hafeez Siddiqi (tawus)
>> http://tawus.wordpress.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
>
> --
> *Regards,*
> *Muhammad Gelbana
> Java Developer*
>



-- 
Regards

Taha Hafeez Siddiqi (tawus)
http://tawus.wordpress.com

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



Re: [t5.2.6] Composing pages through inheritance problem

2011-09-28 Thread Muhammad Gelbana
Thank you Taha :)

But what do you mean by "You can always re-factor your code by composition."


On Wed, Sep 28, 2011 at 1:11 PM, Taha Hafeez wrote:

> Hi Muhammad
>
> I don't think inheritance is the best approach with tapestry. You can
> always re-factor your code by composition. Using components is always
> a better approach.
>
> If you have a child page trying to access a component in parent page,
> IMHO, you should reconsider your refactoring.
>
> On Wed, Sep 28, 2011 at 3:58 PM, Muhammad Gelbana 
> wrote:
> > This is a new approach I'm taking to compose pages. I'm trying to convert
> an
> > existing application to tapestry but one page turned out to be really big
> > and hard to maintain. This page has many form fields. Some fields should
> > always exists, and conditionally show other fields depending on a
> condition,
> > let's say a "test type".
> >
> > I used to do this in one page template, then conditionally showing the
> > fields I want using the "t:if" component and a configured bean-editor
> > inside.
> > Then I decided to go more scalable so I decided to make a page for each
> > "test" and inherit the page with the common fields. This will release me
> for
> > the messy "t:if" "p:else" tags all over the center of the page.
> >
> > Now I'm facing an issue that my parent page has injected components
> > (@InjectComponent) and when displaying the child page, it complains:
> > Component tests/DNSTest does not contain embedded component
> 'gatewayField'.
> > The "gatewayField" variable exists in the parent page as:
> > @InjectComponent
> > private TextField gatewayField
> >
> > ..and there are other fields. I tried adding @Property, and
> getters\setters
> > my self, still didn't work. It only worked when I commented these fields
> and
> > code referring to them.
> >
> > How can I resolve this ? And is this the best approach to dynamically
> > construct a page ?
> >
> > Thank you all for your time :)
> >
> > --
> > *Regards,*
> > *Muhammad Gelbana
> > Java Developer*
> >
>
>
>
> --
> Regards
>
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*


Re: [t5.2.6] Composing pages through inheritance problem

2011-09-28 Thread Taha Hafeez
Hi Muhammad

I don't think inheritance is the best approach with tapestry. You can
always re-factor your code by composition. Using components is always
a better approach.

If you have a child page trying to access a component in parent page,
IMHO, you should reconsider your refactoring.

On Wed, Sep 28, 2011 at 3:58 PM, Muhammad Gelbana  wrote:
> This is a new approach I'm taking to compose pages. I'm trying to convert an
> existing application to tapestry but one page turned out to be really big
> and hard to maintain. This page has many form fields. Some fields should
> always exists, and conditionally show other fields depending on a condition,
> let's say a "test type".
>
> I used to do this in one page template, then conditionally showing the
> fields I want using the "t:if" component and a configured bean-editor
> inside.
> Then I decided to go more scalable so I decided to make a page for each
> "test" and inherit the page with the common fields. This will release me for
> the messy "t:if" "p:else" tags all over the center of the page.
>
> Now I'm facing an issue that my parent page has injected components
> (@InjectComponent) and when displaying the child page, it complains:
> Component tests/DNSTest does not contain embedded component 'gatewayField'.
> The "gatewayField" variable exists in the parent page as:
> @InjectComponent
> private TextField gatewayField
>
> ..and there are other fields. I tried adding @Property, and getters\setters
> my self, still didn't work. It only worked when I commented these fields and
> code referring to them.
>
> How can I resolve this ? And is this the best approach to dynamically
> construct a page ?
>
> Thank you all for your time :)
>
> --
> *Regards,*
> *Muhammad Gelbana
> Java Developer*
>



-- 
Regards

Taha Hafeez Siddiqi (tawus)
http://tawus.wordpress.com

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



[t5.2.6] Composing pages through inheritance problem

2011-09-28 Thread Muhammad Gelbana
This is a new approach I'm taking to compose pages. I'm trying to convert an
existing application to tapestry but one page turned out to be really big
and hard to maintain. This page has many form fields. Some fields should
always exists, and conditionally show other fields depending on a condition,
let's say a "test type".

I used to do this in one page template, then conditionally showing the
fields I want using the "t:if" component and a configured bean-editor
inside.
Then I decided to go more scalable so I decided to make a page for each
"test" and inherit the page with the common fields. This will release me for
the messy "t:if" "p:else" tags all over the center of the page.

Now I'm facing an issue that my parent page has injected components
(@InjectComponent) and when displaying the child page, it complains:
Component tests/DNSTest does not contain embedded component 'gatewayField'.
The "gatewayField" variable exists in the parent page as:
@InjectComponent
private TextField gatewayField

..and there are other fields. I tried adding @Property, and getters\setters
my self, still didn't work. It only worked when I commented these fields and
code referring to them.

How can I resolve this ? And is this the best approach to dynamically
construct a page ?

Thank you all for your time :)

-- 
*Regards,*
*Muhammad Gelbana
Java Developer*