cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew M <and...@jibeya.com>
Subject Forms V2 foolishness
Date Mon, 29 Nov 2004 10:41:27 GMT
Hi,
I have just across a problem with forms version 2 that makes no sense.  
In my flowscript (cocoon 2.1.5.1) I do:

	cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/v2/ 
Form.js");

	function myFunc(){
	var form = new Form("forms/register.xml");
	var bizData = form.getWidget();
	var message;
	
	bizData.fname.value = "Somevaluehere";
     form.showForm("registerDetails1.xml");
	}

The problem is with the line bizData.fname.value where I assign it a  
string value. fname is declared in register.xml as :

     <fd:field id="fname" required="true">
       <fd:label>First Name</fd:label>
       <fd:datatype base="string"/>
       <fd:validation>
         <fd:length max="25"/>
       </fd:validation>
     </fd:field>

and in registerDetails1.xml as:

	<ft:widget id="fname">
		<fi:styling listbox-size="22" class="keyinbox"  
submit-on-change="true"/>
	</ft:widget>

In the V2 examples I can assign a value to a widget as I have done  
above, but I get the following error message:

org.mozilla.javascript.EvaluatorException:  
"file:/Library/jboss-4.0.0/server/default/deploy/jbossweb-tomcat50.sar/ 
ROOT.war/beyarecords/flow/register.js", line 14: The undefined value  
has no properties.
         at  
org.apache.cocoon.components.flow.javascript.JSErrorReporter.runtimeErro 
r(JSErrorReporter.java:66)
         at  
org.mozilla.javascript.Context.reportRuntimeError(Context.java:588)
         at  
org.mozilla.javascript.Context.reportRuntimeError(Context.java:627)
         at  
org.mozilla.javascript.Context.reportRuntimeError0(Context.java:597)
         at  
org.mozilla.javascript.Undefined.reportError(Undefined.java:138)
         at  
org.mozilla.javascript.Undefined.getPrototype(Undefined.java:100)
         at  
org.mozilla.javascript.ScriptRuntime.setProp(ScriptRuntime.java:851)
         at  
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(C 
ontinuationInterpreter.java:706)
         at  
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(C 
ontinuationInterpreter.java:190)
         at  
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(C 
ontinuationInterpreter.java:138)
         at  
org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(Interp 
retedFunctionImpl.java:121)
         at  
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
         at  
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpret 
er.callFunction(FOM_JavaScriptInterpreter.java:702)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invo 
ke(CallFunctionNode.java:130)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:49)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i 
nvoke(PreparableMatchNode.java:130)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:72)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P 
ipelineNode.java:126)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:72)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke( 
PipelinesNode.java:101)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:336)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:277)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(Moun 
tNode.java:103)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:49)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i 
nvoke(PreparableMatchNode.java:130)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:72)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P 
ipelineNode.java:126)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:72)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke( 
PipelinesNode.java:101)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:336)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:277)
         at org.apache.cocoon.Cocoon.process(Cocoon.java:639)
         at  
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java: 
1098)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at  
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica 
tionFilterChain.java:237)
         at  
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt 
erChain.java:157)
         at  
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilte 
r.java:75)
         at  
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica 
tionFilterChain.java:186)
         at  
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt 
erChain.java:157)
         at  
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv 
e.java:214)
         at  
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo 
ntext.java:104)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
520)
         at  
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCon 
textValve.java:198)
         at  
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv 
e.java:152)
         at  
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo 
ntext.java:104)
         at  
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipa 
lValve.java:44)
         at  
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo 
ntext.java:102)
         at  
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAs 
sociationValve.java:169)
         at  
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo 
ntext.java:102)
         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(StandardValveCo 
ntext.java:104)
         at  
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java 
:118)
         at  
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo 
ntext.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(StandardValveCo 
ntext.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.processC 
onnection(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)

Is this a bug?

thanks

Andrew



Mime
View raw message