cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "cocoon.erard" <cocoon.er...@besonet.ch>
Subject binding for multivaluefields
Date Sun, 04 Dec 2005 10:54:01 GMT
Hello,

I'm trying to bind a multivaluefield with an object, but this doesn't work.

I've a bean:

public class MyBean {

   private HashMap questions = new HashMap();

   public HashMap getQuestions() ...
   public void setQuestions(HashMap questions) ...

}

the quesitons map contains Question Objects:

public class Question {
   private Object response = null;

   public Object getResponse()...
   public void setResponse(Object response)...

}

somewhere i make:

myBean.getQuestions().put("name", new Question());
myBean.getQuestions().put("languages", new Question());

the binding:

<fb:context path="." xmlns:fb="http://apache.org/cocoon/forms/1.0#binding" xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
    <fb:struct id="1" path=".">
        <fb:value id="name" path="questions[@name='name']/response"/>
        <fb:multi-value id="languages" parent-path="questions[@name='languages']/response"
row-path="."/>
    </fb:struct>
</fb:context>

This works fine for the widget 'name'. If response is null, an Object of the correct type
is created for field widgets. If response is != null the content is displayed in the form.
But for 'languages' (which is a selection list) I receive allways the exeption at the end
of the mail. 
I've already tried out other combinations with row-path and parent-path but didn't find the
solution, can someone help me?

Regars

Mike


org.apache.commons.jxpath.JXPathException: Exception trying to create xpath questions[@name='languages']/response;
java.lang.ClassCastException
	at org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.handleContinuation(FOM_JavaScriptInterpreter.java:853)
	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:46)
	at org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTypeNode.java:138)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
	at org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTypeNode.java:138)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:138)
	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:243)
	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:138)
	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:243)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:608)
	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1123)
	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:118)
	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(StandardPipeline.java:520)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
	at java.lang.Thread.run(Thread.java:552)
Caused by: org.apache.commons.jxpath.JXPathException: Exception trying to create xpath questions[@name='languages']/response;
java.lang.ClassCastException
	at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath(JXPathContextReferenceImpl.java:450)
	at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath(JXPathContextReferenceImpl.java:427)
	at org.apache.cocoon.forms.binding.MultiValueJXPathBinding.doSave(MultiValueJXPathBinding.java:106)
	at org.apache.cocoon.forms.binding.JXPathBindingBase.saveFormToModel(JXPathBindingBase.java:202)
	at org.apache.cocoon.forms.binding.ComposedJXPathBindingBase.doSave(ComposedJXPathBindingBase.java:109)
	at org.apache.cocoon.forms.binding.ContextJXPathBinding.doSave(ContextJXPathBinding.java:74)
	at org.apache.cocoon.forms.binding.StructJXPathBinding.doSave(StructJXPathBinding.java:65)
	at org.apache.cocoon.forms.binding.JXPathBindingBase.saveFormToModel(JXPathBindingBase.java:202)
	at org.apache.cocoon.forms.binding.ComposedJXPathBindingBase.doSave(ComposedJXPathBindingBase.java:109)
	at org.apache.cocoon.forms.binding.ContextJXPathBinding.doSave(ContextJXPathBinding.java:74)
	at org.apache.cocoon.forms.binding.JXPathBindingBase.saveFormToModel(JXPathBindingBase.java:202)
	at org.apache.cocoon.forms.binding.JXPathBindingBase.saveFormToModel(JXPathBindingBase.java:216)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)
	at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
	at org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:1134)
	at org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:190)
	at org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:138)
	at org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(InterpretedFunctionImpl.java:121)
	at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
	at org.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:1591)
	at org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.handleContinuation(FOM_JavaScriptInterpreter.java:843)
	... 51 more
 


____________________________________________
QuickLine WebMail - http://www.QuickLine.com

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


Mime
View raw message