On Thu, 16 Sep 2010 19:09:05 -0300, Антон Мезерный
<anton.meze...@gmail.com> wrote:
Hello,
Hi!
I am trying to make a dynamic form component, something like
beaneditform, but based not on bean field type, but on some property in
database.
I strongly advise you to read the BeanEditor sources and do something
similar or, better yet, contribute viewing and edition blocks. The end of
this page shows you how to add blocks:
http://tapestry.apache.org/tapestry5.1/guide/beaneditform.html. Besides
that, create one of more DataTypeAnalyzer and contribute them to the
DataTypeAnalyzer service. See
http://tapestry.1045711.n5.nabble.com/Custom-Edit-Block-td2427355.html for
a little more detail.
Another words I want to create something like
<t:${componentNameFromDB} ...>
Short answer: you can't. Tapestry pages and components have stricly static
structure.
Long answer: you can use blocks (<t:block>) and the Delegate component to
render blocks or components dynamically.
I tried to use delegate component, but as I understood, I should define
all my components (inputs and other) inside one tml-page in block tags
and
Not necessarily in a single page.
create block instances in java code. Can I do that with separate
components for every element in the form?
Yes.
What is the best way to achieve it?
ComponentSource will help you to grab page instances.
--
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