You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Remmerie Bart <Ba...@elia.be> on 2004/10/27 17:21:05 UTC

[cforms][recursive forms] "non-terminating recursion detected in widget definition"

Hi folks,

I'm trying to create a recursive form but I keep on getting a
"non-terminating recursion detected in widget definition"-error.
I've found some info on the mailinglist, but it did not give me with
sufficient clarity.

* Does anyone ever struggled with this problem ?
* Is there a smooth solution/workaround ?

use case, form-model and error-description are below.

Thanks,
Bart

The use-case is rather simple:
creating a dynamic orgchart, filled with departments

each department can have sub-departments
each subdepartment is a department

the simplified model-snippet giving the error looks like this:

    <fd:new id="Department"/>
    <fd:class id="Department">
      <fd:widgets>
        <fd:field id="departmentName">
          <fd:label>Department Name</fd:label>
          <fd:datatype base="string"/>
        </fd:field>
        <fd:repeater id="subDepartments">
          <fd:label>subDepartments</fd:label>
          <fd:widgets>
            <fd:new id="Department"/>
          </fd:widgets>
        </fd:repeater>
      </fd:widgets>
    </fd:class>

the exact error-description is the following:
cause: java.lang.Exception: Container: Non-terminating recursion detected in
widget definition: subDepartment
(file:/C:/projects/Hive/tools/cocoon/webapp/myforms/orgchart_model.xml:18:42
)





This message and its attachments may contain confidential information protected by intellectual property rights or other rights & is strictly for the exclusive use of the intended recipient. It is strictly prohibited to copy, alter or disclose this message or its contents to any other person without Elia's prior consent. If you are not the intended recipient of this message, please inform the person who sent it and delete the message from your system. Elia is not liable for any direct or indirect damage arising from errors, inaccuracies or any loss in the message, from unauthorized use, disclosure, copying or alteration of it or as a result of any virus being passed on. This message does not constitute any commitment from Elia except when expressly otherwise agreed between the intended recipient and Elia.

U vindt de Nederlandse versie van deze disclaimer op onze internetsite  www.elia.be

Vous pouvez découvrir la version française de ce disclaimer sur notre site internet www.elia.be


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [cforms][recursive forms] "non-terminating recursion detected in widget definition"

Posted by David Verdin <ve...@agrocampus-rennes.fr>.
Hi,

Try to use the approach used in the "Form model GUI example" : you need 
to add a new department only when needed, so use a widget supporting the 
"submit-on-change" function.

    <fd:new id="Department"/>
    <fd:class id="Department">
      <fd:widgets>
        <fd:field id="departmentName">
          <fd:label>Department Name</fd:label>
          <fd:datatype base="string"/>
        </fd:field>
        <fd:repeater id="subDepartments">
          <fd:label>subDepartments</fd:label>
          <fd:widgets>
            <fd:new id="Department-row"/>
          </fd:widgets>
        </fd:repeater>
      </fd:widgets>
    </fd:class>

    <fd:class id="Department-row">
      <fd:widgets>
        <fd:field id="type">
          <fd:label>Type element</fd:label>
          <fd:datatype base="string"/>
  	  <fd:selection-list>
	    <fd:item value="">
              <fd:label>nothing</fd:label>
            </fd:item>
	    <fd:item value="department">
              <fd:label>department</fd:label>
            </fd:item>
 	  </fd:selection-list>
        </fd:field>
	<fd:union id="union" default="" case="type">
          <fd:datatype base="string"/>
          <fd:label>Type</fd:label>
 	  <fd:widgets>
	    <fd:struct id="Department">
            <fd:label>Department</fd:label>
           <fd:widgets>
              <fd:new id="departmentName"/>
              <fd:new id="Department"/>
            </fd:widgets>
          </fd:struct>
        </fd:union>
      </fd:widgets>
    </fd:class>


Well, it's not really beautiful, because like this you will have a dummy 
selection list with only one option.
I guess you can replace it with a simple action-widget.

On my (newbying) opinion, that is the spirit : instead of adding your 
"fd:new" tag recreating your element directly in the very same element, 
you put it in another, in which you won't automaticaly add this element, 
but only when needed.

You also need to create a template file according to this structure. You 
can find an example in the sample.

Good luck !

David


Remmerie Bart a écrit :

>Hi folks,
>
>I'm trying to create a recursive form but I keep on getting a
>"non-terminating recursion detected in widget definition"-error.
>I've found some info on the mailinglist, but it did not give me with
>sufficient clarity.
>
>* Does anyone ever struggled with this problem ?
>* Is there a smooth solution/workaround ?
>
>use case, form-model and error-description are below.
>
>Thanks,
>Bart
>
>The use-case is rather simple:
>creating a dynamic orgchart, filled with departments
>
>each department can have sub-departments
>each subdepartment is a department
>
>the simplified model-snippet giving the error looks like this:
>
>    <fd:new id="Department"/>
>    <fd:class id="Department">
>      <fd:widgets>
>        <fd:field id="departmentName">
>          <fd:label>Department Name</fd:label>
>          <fd:datatype base="string"/>
>        </fd:field>
>        <fd:repeater id="subDepartments">
>          <fd:label>subDepartments</fd:label>
>          <fd:widgets>
>            <fd:new id="Department"/>
>          </fd:widgets>
>        </fd:repeater>
>      </fd:widgets>
>    </fd:class>
>
>the exact error-description is the following:
>cause: java.lang.Exception: Container: Non-terminating recursion detected in
>widget definition: subDepartment
>(file:/C:/projects/Hive/tools/cocoon/webapp/myforms/orgchart_model.xml:18:42
>)
>
>
>
>
>
>This message and its attachments may contain confidential information protected by intellectual property rights or other rights & is strictly for the exclusive use of the intended recipient. It is strictly prohibited to copy, alter or disclose this message or its contents to any other person without Elia's prior consent. If you are not the intended recipient of this message, please inform the person who sent it and delete the message from your system. Elia is not liable for any direct or indirect damage arising from errors, inaccuracies or any loss in the message, from unauthorized use, disclosure, copying or alteration of it or as a result of any virus being passed on. This message does not constitute any commitment from Elia except when expressly otherwise agreed between the intended recipient and Elia.
>
>U vindt de Nederlandse versie van deze disclaimer op onze internetsite  www.elia.be
>
>Vous pouvez découvrir la version française de ce disclaimer sur notre site internet www.elia.be
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
>  
>

-- 
************************************
David Verdin
GES / ENSAR - laboratoire d'informatique
65, rue de St Brieuc
CS 84 215
35 042 Rennes cedex
e-mail : verdin@lilas.roazhon.inra.fr
tél : 02 23 48 54 58
fax : 02 23 48 54 50
************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org