cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alessandro Vincelli <a.vince...@w4b.it>
Subject CFORM - repeater , add-row on OJB collection
Date Wed, 08 Feb 2006 14:08:47 GMT
I have a this simple form with repeater:


The flowscript invoke dao.getAllRows, and pass to form/bionding a Colection:

------------ BEGIN flowscript---------------------------

Elenco = dao.getAllRows(manager);
form.load(Elenco);
......
form.save(Elenco);
------------  END flowscript---------------------------


------------ BEGIN OJB METHOD---------------------------

public Collection getAllRows(PersistenceManager pm) {
	PersistenceBroker broker = 
PersistenceBrokerFactory.defaultPersistenceBroker();
		Criteria crit = new org.apache.ojb.broker.query.Criteria();
		QueryByCriteria q = new QueryByCriteria(Docuassist.class, crit);
		Collection objects = (Collection)broker.getCollectionByQuery(q);
	
		q.addOrderByAscending("dgprogre");
			
		broker.close();
		return objects;
}
	
------------ END OJB METHOD---------------------------


When I modify 1 or more bean in the collection and in flowscript  call

form.save(Elenco);
....

I save correctly the bean in database.


The problem occur when i try to insert new row

I receive this error on:
form.save(Elenco);


java.lang.NoSuchMethodException: 
org.apache.ojb.broker.util.collections.RemovalAwareCollection.add(w4b.com.cassagest.db.Docuassist)


in my binding definition I have this:
         <fb:on-insert-row>
             <fb:insert-bean classname="w4b.com.cassagest.db.Docuassist" 
addmethod="add"/>
         </fb:on-insert-row>


How Can I add object to a Collection from  OJB?


Thanks in advance, Alessandro





_____________________________________________________________________________
MODEL:

<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition" 
xmlns:label="http://w4b.it/cocoon/label/" 
xmlns:i18n="http://apache.org/cocoon/i18n/2.1">

     <fd:widgets>
         <fd:repeater id="Docuassist">
             <fd:label>Repeater di docuassist</fd:label>
             <fd:widgets>

                 <fd:field id="dgprogre">
                     <fd:label>Progressivo</fd:label>
                     <fd:datatype base="integer"/>
                 </fd:field>

                 <fd:field id="dgdescri">
                     <fd:label>Descrizione ridotta</fd:label>
                     <fd:datatype base="string">
                     </fd:datatype>
                 </fd:field>

                 <fd:field id="dgdescre">
                     <fd:label>Descrizione estesa</fd:label>
                     <fd:datatype base="string">
                     </fd:datatype>
                 </fd:field>

                 <fd:row-action id="up" command="move-up"/>
                 <fd:row-action id="down" command="move-down"/>

                 <fd:booleanfield id="select">
                     <fd:label>Select</fd:label>
                 </fd:booleanfield>
             </fd:widgets>
         </fd:repeater>

         <fd:repeater-action id="addRow" command="add-row" 
repeater="Docuassist">
             <fd:label>Aggiungi riga</fd:label>
         </fd:repeater-action>

         <fd:repeater-action id="removeRow" command="delete-rows" 
repeater="Docuassist" select="select">
             <fd:label>Rimuovi le righe selezionate</fd:label>
         </fd:repeater-action>
     </fd:widgets>

</fd:form>
_________________________________________________________________________________________________
BINDING


<fb:repeater id="Docuassist" parent-path="." row-path=".">
         <fb:identity>
             <fb:value id="dgprogre" path="dgprogre"/>
         </fb:identity>
         <fb:on-bind>
             <fb:value id="dgdescri" path="dgdescri"/>
             <fb:value id="dgdescre" path="dgdescre"/>
         </fb:on-bind>

         <fb:unique-row>
             <fb:unique-field id="dgprogre" path="dgprogre"/>
         </fb:unique-row>

         <fb:on-insert-row>
             <fb:insert-bean classname="w4b.com.cassagest.db.Docuassist" 
addmethod="add"/>
         </fb:on-insert-row>
     </fb:repeater>





_______________________________________________________________________________________________________
STACKTRACE



Message: 
org.apache.ojb.broker.util.collections.RemovalAwareCollection.add(w4b.com.cassagest.db.Docuassist)

Description: org.apache.cocoon.ProcessingException: Error calling 
continuation at 
resource://org/apache/cocoon/forms/flow/javascript/Form.js:228:-1 at 
file:/var/webapps/cassagest/cforms/cforms/flow/cattura.js:175:-1 at 
<map:call> - file:/var/webapps/cassagest/cforms/sitemap.xmap:356:82 at 
<map:mount> - file:/var/webapps/cassagest/sitemap.xmap:727:83

Sender: org.apache.cocoon.servlet.CocoonServlet

Source: Cocoon Servlet

Request URI

cforms/continue

cause

java.lang.NoSuchMethodException: 
org.apache.ojb.broker.util.collections.RemovalAwareCollection.add(w4b.com.cassagest.db.Docuassist)

request-uri

/cassagest/cforms/continue

full exception chain stacktrace

org.apache.cocoon.ProcessingException: Error calling continuation
	at resource://org/apache/cocoon/forms/flow/javascript/Form.js:228:-1
	at file:/var/webapps/cassagest/cforms/cforms/flow/cattura.js:175:-1
	at <map:call> - file:/var/webapps/cassagest/cforms/sitemap.xmap:356:82
	at <map:mount> - file:/var/webapps/cassagest/sitemap.xmap:727:83
	at 
org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.java:144)
	at 
org.apache.cocoon.components.flow.javascript.LocationTrackingDebugger.getException(LocationTrackingDebugger.java:132)
	at 
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.handleContinuation(FOM_JavaScriptInterpreter.java:856)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:123)
	at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
	at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:142)
	at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
	at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234)
	at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:176)
	at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:248)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:117)
	at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
	at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:142)
	at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
	at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:234)
	at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:176)
	at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:248)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:679)
	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1154)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
	at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
	at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
	at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
	at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
	at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(Stand
-- 
-------------------------------
Alessandro Vincelli
W4B - web for business s.r.l.
Firenze
via Pellicceria 10 - 50123
E-mail: a.vincelli@w4b.it
tel: 055-2654270

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


Mime
View raw message