Re: Creating inner components on the fly in a form custom component

2008-09-27 Thread Edouard sur edouardmercier.fr
Thank you so much Kris for your answer.

The Tapestry 5 BeanEditor source code gives some kind of vertigo, but
I will look at it, in order to better understand what you mean.

In the meantime, I had another idea: using some .tml inside my
component with a t:loop and t:if statements inside that nest some
t:select/t:radioGroup...: I think that it might solve my problem
(do you agree?). As soon as I have something which works, I will let
you know.

Cheers,
Édouard

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Creating inner components on the fly in a form custom component

2008-09-26 Thread Kristian Marinkovic
hi,

you cannot create T5 components dynamically  but you can simulate it 
:)

you can define Blocks with any (nested) T5 components and HTML fragments 
that can be re-used multiple times to render a page.

take a closer (source code) look at the BeanEditor. it creates input 
fields
for every property of a given bean. it has a loop with a delegate in it 
which 
is able to render any block that was determined for the current property.
eg. for every String property it will render a block with a TextField 
component
for every Date property it will render a block containing the DateField 
compoinent
...

i hope this helped

g,
kris




Edouard sur edouardmercier.fr [EMAIL PROTECTED] 
Gesendet von: [EMAIL PROTECTED]
25.09.2008 18:50
Bitte antworten an
Tapestry users users@tapestry.apache.org


An
users@tapestry.apache.org
Kopie

Thema
Creating inner components on the fly in a form custom component







Hello.

I've been digging the web with no success, but I'm a Tapestry 5 newbie
(running the v5.0.15), thus maybe I missed something.

I'm currently attempting to develop a custom Tapestry component that
aims at inserting HTML select/checkbox/textfield tags into an
existing HTML form. Let's say that I have a .tml which contains a
t:form, in which I have my t:myCustomComponent element.

This myCustomComponent component is supposed to render multiple HTML
select/checkbox/textfield elements, depending on its main Tapestry
parameter. But, instead of writing plain HTML via the traditional
beginRender/afterRender() methods, I'd prefer to re-user the
built-in Select/CheckBox/TextField Tapestry classes, and add
instances of those classes as inner components of my myCustomComponent
component.

The idea is, on the enclosing form submission, to be able to retrieve
the values of those various HTML form sub elements. I do not know
whether this is feasible. Is it possible to add components on-the-fly
to an existing component during its rendering process (or at another
relevant moment)? I do not even know where to start with. Could
someone, please give me a hint on how to achieve that?

Thank you for your help and time. Cheers,
Édouard

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Creating inner components on the fly in a form custom component

2008-09-25 Thread Edouard sur edouardmercier.fr
Hello.

I've been digging the web with no success, but I'm a Tapestry 5 newbie
(running the v5.0.15), thus maybe I missed something.

I'm currently attempting to develop a custom Tapestry component that
aims at inserting HTML select/checkbox/textfield tags into an
existing HTML form. Let's say that I have a .tml which contains a
t:form, in which I have my t:myCustomComponent element.

This myCustomComponent component is supposed to render multiple HTML
select/checkbox/textfield elements, depending on its main Tapestry
parameter. But, instead of writing plain HTML via the traditional
beginRender/afterRender() methods, I'd prefer to re-user the
built-in Select/CheckBox/TextField Tapestry classes, and add
instances of those classes as inner components of my myCustomComponent
component.

The idea is, on the enclosing form submission, to be able to retrieve
the values of those various HTML form sub elements. I do not know
whether this is feasible. Is it possible to add components on-the-fly
to an existing component during its rendering process (or at another
relevant moment)? I do not even know where to start with. Could
someone, please give me a hint on how to achieve that?

Thank you for your help and time. Cheers,
Édouard

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]