cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Larson <>
Subject Re: [cforms] struct and class access in flowscript
Date Wed, 11 Aug 2004 12:57:59 GMT
On Wed, Aug 11, 2004 at 01:32:35PM +0200, Stephane Delort wrote:
> I would like to fill it with values from a bean, in a flowcsript so I did ;
> var model = form.getModel();
> var p = form.lookupWidget("widgetClass");
> var f = p.lookupWidgetWidget("union").getChild("simpleList").lookupWidget
> ("list"); /* error here because p is null*/
>  f.setSelectionList( c, "listId", "label" );
> but then I have a "cannot convert nul to a n object" error (p is null)
> I took a look at the cocooon API but I really don't know how to deal with
> class, union, ans struct in flowscript (or java).
> any help greatly appreciated,
> Stephane

I don't have time to describe all of it right now, but this might
help get you started...

    <fd:class id="someClass">
        <fd:field id="myField">
	  <!-- fill in widget details here -->
    <fd:struct id="spacer">
      <fd:new id="someClass"/>

A "fd:class" is not a real is just a blueprint for
creating widgets.  So you need to put an "fd:new" where you want
to build an instance of the widgets described by this blueprint.

Note in the sample above that I wrapped the "fd:new" with an
"fd:struct"...this is because the "fd:class" and the "fb:new"
must be in different "namespaces" since they use the same id.
You could instead wrap the "fd:new" in a repeater or a union...
anything that would put it in a different namespace.

To access "myField" from flowscript or java, you would use
lookupWidget to reference "spacer.myField"...note that neither
the "fd:class" nor the "fd:new" are referenced.

--Tim Larson

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message