Hi,
 After studying cocoon-forms's source code a while, I find it is very hard
to create widgets without creating a form widget. To create a widget, one
has to start from a FormManager. All of the classes FormManager, Form,
FormDefintion, FormDefinitionBuilder, Widget, WidgetDefinition,
WidgetDefinitionBuilder, ..etc. are coupled so tight. Even a widget has an
association to its definition. It seems impossible to create a widget
without through its definition. Hence, to dynamically modify a form's
structure is not that easy in cforms. I originally thought it should be
quite easy to do it like in wicket.

Rice

On 3/24/07, Rice Yeh <[EMAIL PROTECTED]> wrote:

Hi,
  I am writing some code to insert widgets into a form dynamically in the
on-action event of an action widget. But I have the most code written in a
java method first. Since my code is not in a Serviceable class, I don't have
access to a service manager. But I need to access the LibraryManager. I try
to access it through the spring WebApplicationContext, but it says there is
no such bean definition. With the same way, I can access SourceResolver. My
code is like the following:

WebAppContextUtils.*getCurrentWebApplicationContext*().getBean(
org.apache.cocoon.forms.formmodel.library.LibraryManager.*ROLE* );
How can I get the LibraryManager without a ServiceManager?

Rice

Reply via email to