On 27 Nov 2003, at 16:29, Bruno Dumon wrote:


Saw your messages on the dev list (which are still valid), but you could
do this as follows:
event.getSourceWidget().getParent().getWidget("my-id- widget").getValue()

where "my-id-widget" is the widget containing your id (assuming that's
what you want).

I get a strange Exception :

java.lang.NoClassDefFoundError: uk/co/my/bean/album (wrong name: uk/co/my/bean/Album)

I am trying this :

in my main FlowScript, I pass my bizzdata to the showForm method, so it is available to the event handler :

. . .
importPackage (Packages.uk.co.my.bean);
. . .
function updateAlbum () {
. . .
var album = AlbumPeer.load (session, new java.lang.Long (cocoon.parameters["albumid"]), null);
. . .
form.load (album);
. . .
form.showForm (screen, {album: album});
. . .
}

Where 'album' is an instance of uk.co.my.bean.Album.

In my form model, I define this button in my 'resources' Repeater:

. . .
<wd:row-action id="delete" action-command="delete">
        . . .
  <wd:on-activate>
    <javascript>deleteRow (event, viewData)</javascript>
  </wd:on-activate>
</wd:row-action>
. . .

and back in the FlowSript (same file as above) I have this function:

// event handler called by Woody to remove a Resource Row from the Album
function deleteRow (event, viewData) {
var factory = cocoon.getComponent (PersistanceFactory.ROLE);
var session = factory.createSession ();
var id = event.getSourceWidget ().getParent ().getWidget ("id").getValue ();
var deletee = AlbumPeer.getResourceById (viewData.album, new java.lang.Long (id));
album.removeResource (deletee);
if (!ResourcePeer["delete"] (session, deletee))
cocoon.log.error ("Resource not deleted properly!!!: " + deletee.getId ());
session.close ();
cocoon.releaseComponent (factory);
}

When I click the 'delete' button on one of the resources, I get this Exception :


Original Exception: java.lang.NoClassDefFoundError: uk/co/my/bean/album (wrong name: uk/co/my/bean/Album)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:198)
at org.mortbay.http.ContextLoader.loadClass(ContextLoader.java:171)
at org.mozilla.javascript.ScriptRuntime.loadClassName(ScriptRuntime.java: 2103)
at org.mozilla.javascript.NativeJavaPackage.getPkgProperty(NativeJavaPackag e.java:183)
at org.mozilla.javascript.ImporterTopLevel.get(ImporterTopLevel.java:119)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1110)
at org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(C ontinuationInterpreter.java:1220)
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.InterpretedScriptImpl.call(Interpre tedScriptImpl.java:137)
at org.mozilla.javascript.InterpretedScript.exec(InterpretedScript.java: 59)
at org.apache.cocoon.woody.util.JavaScriptHelper.execScript(JavaScriptHelpe r.java:177)
at org.apache.cocoon.woody.event.impl.JavaScriptWidgetListener.callScript(J avaScriptWidgetListener.java:101)
at org.apache.cocoon.woody.event.impl.JavaScriptWidgetListener$JSActionList ener.actionPerformed(JavaScriptWidgetListener.java:118)
at org.apache.cocoon.woody.event.WidgetEventMulticaster.actionPerformed(Wid getEventMulticaster.java:80)
at org.apache.cocoon.woody.formmodel.ActionDefinition.fireActionEvent(Actio nDefinition.java:82)
at org.apache.cocoon.woody.formmodel.Action.broadcastEvent(Action.java: 144)
at org.apache.cocoon.woody.formmodel.Form.fireWidgetEvents(Form.java:133)
at org.apache.cocoon.woody.formmodel.Form.process(Form.java:259)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.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(C ontinuationInterpreter.java:1105)

etc.

This started as soon as I began passing the bizdata to showForm.
It looks very odd to me ...

Thanks for any suggestions

regards Jeremy


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to