You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Marc Portier <mp...@outerthought.org> on 2004/05/03 08:53:49 UTC

Re: event.source.parent.getWidget("siblingrepeater").getWidget("widget-in-row-of-repeater")

A cascading-exception is one that is wrapping around another one,
could you scroll down to a line that mentions caused by etc etc

if you don't recognose important sections yourself, then the full stack
trace could be useful, as well some mentioning of which cocoon version
you are running

regards,
-marc=

Christina wrote:

> I want the content of  "droplist-inner" changed every time value of 
> "droplist-outer" changed.
> So I use this " 
> event.source.parent.getWidget("siblingrepeater").getWidget("widget-in-row-of-repeater") 
> " to get widget "droplist-inner" from "droplist-outer"
> then  use "setSelectionList" to set its list content.
> but every time there is error:   
>  org.apache.avalon.framework.CascadingRuntimeException: Error invoking 
> JavaScript event handler
>  
> Would anybody give me some idea why and how to fix it????
> Thanks!!
>  
> <wd:repeater id="outer">
> ..
>   <wd:widgets>
>        <wd:field id="droplist-outer">
>        <wd:repeater id="inner">
>               <wd:widgets>
>                    <wd:field id="droplist-inner">

-- 
Marc Portier                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                http://blogs.cocoondev.org/mpo/
mpo@outerthought.org                              mpo@apache.org

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


Re: event.source.parent.getWidget("siblingrepeater").getWidget("droplist-inner")

Posted by Marc Portier <mp...@outerthought.org>.

Christina wrote:

> my cocoon is 2.1.4,  and following is part of the ecxeption tracking stack;
> Does it mean that I have to specify row number of the second getWidget in "
> event.source.parent.getWidget("inner").getWidget("droplist-inner") "?
> But what if  I want to change all rows of "inner" repeater's droplist.
> I found there is a function of getWidget(Indetifieronly) in repeater.
> 

yeah, but the nested widgets inside a repeater are repeater-rows 
(identified by integer indices) not the widgets from the definition file 
directly

the error you get points you to the fact that you need to loop through 
all rows with (and that thus the string 'droplist-inner' could not be 
seen as an integer row-index)

event.source.parent.getWidget("inner").getRow(rowIndex).getWidget("droplist-inner")

getSize() on the repeater should give you the number of rows currently 
in the repeater....

any other suggestions?
-marc=

> 
> 
>>><wd:repeater id="outer">
>>>..
>>>  <wd:widgets>
>>>       <wd:field id="droplist-outer">
>>>       <wd:repeater id="inner">
>>>              <wd:widgets>
>>>                   <wd:field id="droplist-inner">
> 
> 
> 
> cause: org.mozilla.javascript.JavaScriptException: at top-level script
> (file:/D:/cocoon/cocoon-2.1.4/build/webapp/test/readyform/forms/form1.xml,
> Line 306): java.lang.RuntimeException: Repeater: Row id is not a valid
> integer: droplist-inner
> 
> full exception chain stacktrace[hide]
> 
> Original Exception: org.apache.avalon.framework.CascadingRuntimeException:
> Error invoking JavaScript event handler
> 	at
> org.apache.cocoon.woody.event.impl.JavaScriptWidgetListener.callScript(JavaS
> criptWidgetListener.java:107)
> 	at
> org.apache.cocoon.woody.event.impl.JavaScriptWidgetListener$JSValueChangedLi
> stener.valueChanged(JavaScriptWidgetListener.java:129)
> 	at
> org.apache.cocoon.woody.formmodel.AbstractDatatypeWidgetDefinition.fireValue
> ChangedEvent(AbstractDatatypeWidgetDefinition.java:129)
> 	at org.apache.cocoon.woody.formmodel.Field.broadcastEvent(Field.java:351)
> 	at org.apache.cocoon.woody.formmodel.Form.fireWidgetEvents(Form.java:123)
> 	at org.apache.cocoon.woody.formmodel.Form.process(Form.java:249)
> 	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(Conti
> nuationInterpreter.java:1105)
> 	at
> org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(Conti
> nuationInterpreter.java:190)
> 	at
> org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(Conti
> nuationInterpreter.java:138)
> 	at
> org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(Interprete
> dFunctionImpl.java:121)
> 	at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
> 	at
> org.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:159
> 1)
> 
> 
> 
> 
> 
> 
> 
> 
> ----- Original Message -----
> From: "Marc Portier" <mp...@outerthought.org>
> To: <us...@cocoon.apache.org>
> Sent: Sunday, May 02, 2004 11:53 PM
> Subject: Re:
> event.source.parent.getWidget("siblingrepeater").getWidget("widget-in-row-of
> -repeater")
> 
> 
> 
>>A cascading-exception is one that is wrapping around another one,
>>could you scroll down to a line that mentions caused by etc etc
>>
>>if you don't recognose important sections yourself, then the full stack
>>trace could be useful, as well some mentioning of which cocoon version
>>you are running
>>
>>regards,
>>-marc=
>>
>>Christina wrote:
>>
>>
>>>I want the content of  "droplist-inner" changed every time value of
>>>"droplist-outer" changed.
>>>So I use this "
>>>
> 
> event.source.parent.getWidget("siblingrepeater").getWidget("widget-in-row-of
> -repeater")
> 
>>>" to get widget "droplist-inner" from "droplist-outer"
>>>then  use "setSelectionList" to set its list content.
>>>but every time there is error:
>>> org.apache.avalon.framework.CascadingRuntimeException: Error invoking
>>>JavaScript event handler
>>>
>>>Would anybody give me some idea why and how to fix it????
>>>Thanks!!
>>>
> 
> 
>>--
>>Marc Portier                            http://outerthought.org/
>>Outerthought - Open Source, Java & XML Competence Support Center
>>Read my weblog at                http://blogs.cocoondev.org/mpo/
>>mpo@outerthought.org                              mpo@apache.org
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

-- 
Marc Portier                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                http://blogs.cocoondev.org/mpo/
mpo@outerthought.org                              mpo@apache.org

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


Re: event.source.parent.getWidget("siblingrepeater").getWidget("droplist-inner")

Posted by Christina <le...@hotmail.com>.
my cocoon is 2.1.4,  and following is part of the ecxeption tracking stack;
Does it mean that I have to specify row number of the second getWidget in "
event.source.parent.getWidget("inner").getWidget("droplist-inner") "?
But what if  I want to change all rows of "inner" repeater's droplist.
I found there is a function of getWidget(Indetifieronly) in repeater.


> > <wd:repeater id="outer">
> > ..
> >   <wd:widgets>
> >        <wd:field id="droplist-outer">
> >        <wd:repeater id="inner">
> >               <wd:widgets>
> >                    <wd:field id="droplist-inner">


cause: org.mozilla.javascript.JavaScriptException: at top-level script
(file:/D:/cocoon/cocoon-2.1.4/build/webapp/test/readyform/forms/form1.xml,
Line 306): java.lang.RuntimeException: Repeater: Row id is not a valid
integer: droplist-inner

full exception chain stacktrace[hide]

Original Exception: org.apache.avalon.framework.CascadingRuntimeException:
Error invoking JavaScript event handler
	at
org.apache.cocoon.woody.event.impl.JavaScriptWidgetListener.callScript(JavaS
criptWidgetListener.java:107)
	at
org.apache.cocoon.woody.event.impl.JavaScriptWidgetListener$JSValueChangedLi
stener.valueChanged(JavaScriptWidgetListener.java:129)
	at
org.apache.cocoon.woody.formmodel.AbstractDatatypeWidgetDefinition.fireValue
ChangedEvent(AbstractDatatypeWidgetDefinition.java:129)
	at org.apache.cocoon.woody.formmodel.Field.broadcastEvent(Field.java:351)
	at org.apache.cocoon.woody.formmodel.Form.fireWidgetEvents(Form.java:123)
	at org.apache.cocoon.woody.formmodel.Form.process(Form.java:249)
	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(Conti
nuationInterpreter.java:1105)
	at
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(Conti
nuationInterpreter.java:190)
	at
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(Conti
nuationInterpreter.java:138)
	at
org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(Interprete
dFunctionImpl.java:121)
	at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
	at
org.mozilla.javascript.ScriptableObject.callMethod(ScriptableObject.java:159
1)








----- Original Message -----
From: "Marc Portier" <mp...@outerthought.org>
To: <us...@cocoon.apache.org>
Sent: Sunday, May 02, 2004 11:53 PM
Subject: Re:
event.source.parent.getWidget("siblingrepeater").getWidget("widget-in-row-of
-repeater")


> A cascading-exception is one that is wrapping around another one,
> could you scroll down to a line that mentions caused by etc etc
>
> if you don't recognose important sections yourself, then the full stack
> trace could be useful, as well some mentioning of which cocoon version
> you are running
>
> regards,
> -marc=
>
> Christina wrote:
>
> > I want the content of  "droplist-inner" changed every time value of
> > "droplist-outer" changed.
> > So I use this "
> >
event.source.parent.getWidget("siblingrepeater").getWidget("widget-in-row-of
-repeater")
> > " to get widget "droplist-inner" from "droplist-outer"
> > then  use "setSelectionList" to set its list content.
> > but every time there is error:
> >  org.apache.avalon.framework.CascadingRuntimeException: Error invoking
> > JavaScript event handler
> >
> > Would anybody give me some idea why and how to fix it????
> > Thanks!!
> >

>
> --
> Marc Portier                            http://outerthought.org/
> Outerthought - Open Source, Java & XML Competence Support Center
> Read my weblog at                http://blogs.cocoondev.org/mpo/
> mpo@outerthought.org                              mpo@apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

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