digging into the below problem, it appears that the null pointer exception
is throwed by the union, and more accuratly its function getValue();
If you look at the API, you will see that :
in the class org.apache.cocoon.forms.formmodel.Union
public Object getValue()
Specified by:
getValue in interface Widget
So, I took a look at the getValue provided by the interface widget and here
is what is writen :
getValue
public Object getValue()
Returns:
the value of the widget. For some widgets (notably ContainerWidgets) this may not make
sense, those should then simply return null here.
As I think the union is kinda ContainerWidget (it belongs to AbstractContainerWidget)
and so, guess it's normal to return null.
Is this correct ?
by the way I use cocoon 2.1.5 is this fixed (if it has to be) on the CVS ?
regards,
Stephane
Bitte antworten an [EMAIL PROTECTED]
An: [EMAIL PROTECTED]
Kopie:
Thema: [cforms] struct and class display
Hi,
well I can, now, access to the object in class, struct or union in my
flowscript (see previous thread).
but then, the shame is that it does not display the form and I have a
"nullpointer exception" error instead.
In my defintion file I have :
******************************
<...>
<fd:widgets>
<fd:union id="start" default="" case="widget-id">
<fd:datatype base="string"/>
<fd:widgets>
<fd:new id="widgetClass"/>
</fd:widgets>
</fd:union>
<fd:class id="widgetClass">
<fd:widgets>
<fd:repeater id="inList" >
<fd:widgets>
<fd:union id="union" case="widget-id">
<fd:datatype base="string"/>
<fd:widgets>
<fd:struct id="simpleList">
<fd:widgets>
<fd:multivaluefield id="list">
<....>
In fill the field thanks to the followwing flowscript :
********************************************************
.......
var myRepeater = form.lookupWidget("start").lookupWidget("inList");
var row = myRepeater.addRow();
var myUnion = row.lookupWidget("union");
var myDesiredStruct = myUnion.lookupWidget("simpleList");
var myList = myDesiredStruct.lookupWidget("list");
myList.setSelectionList( c, "listId", "label" ); //c is an ArrayList
(collection).
....
then, finally here is the *template file which get me into troubles *;
*************************************************************************
<...>
<ft:union id="start">
<ft:case id="widgetClass"> // if I put this
block in comments, the form is not display but I do not have any
exception
<ft:new id="widgetClass"/>
</ft:case>
</ft:union>
<ft:class id="widgetClass">
<ft:repeater-widget id="inList">
<ft:union id="union">
<ft:case id="simpleList">
<ft:struct id="simpleList">
<ft:widget id="list">
<fi:styling list-type="checkbox"/>
</ft:widget>
</ft:struct>
<...>
Anyway, it appears that I can fill any field of any structure belonging to
my union id="union" thanks to the lookupwidget function. So, in this
case how doesthe union make the selection to know which structure is
to be displayed ?
Thanks in advance for any help,
Stephane
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]