how can I use CKeditorBehavior?

51 views
Skip to first unread message

decebal

unread,
Dec 9, 2010, 7:40:28 AM12/9/10
to wiquery-plugins
Hello

How can I use CKeditorBehavior?

For me
TextArea<String> description = new TextArea<String>("description");
description.add(new CKeditorBehavior());
doesn't work.

My project uses maven and I include wiquery-ckeditor with

<dependency>
<groupId>org.odlabs.wiquery</groupId>
<artifactId>wiquery-ckeditor</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

It's 1.0-SNAPSHOT the last version?

Thanks,
Decebal

decebal

unread,
Dec 9, 2010, 7:40:28 AM12/9/10
to wiquery-plugins

decebal

unread,
Dec 9, 2010, 7:44:50 AM12/9/10
to wiquery-plugins
The exception is:

java.lang.NoSuchMethodError:
org.odlabs.wiquery.core.commons.WiQueryResourceManager.addJavaScriptResource(Lorg/
apache/wicket/markup/html/resources/JavascriptResourceReference;)V
at
org.odlabs.wiquery.plugins.ckeditor.CKeditorBehavior.contribute(CKeditorBehavior.java:
155)
at
org.odlabs.wiquery.core.commons.WiQueryCoreHeaderContributor.renderPlugin(WiQueryCoreHeaderContributor.java:
249)
at
org.odlabs.wiquery.core.commons.WiQueryCoreHeaderContributor.renderAjaxResponse(WiQueryCoreHeaderContributor.java:
224)
at
org.odlabs.wiquery.core.commons.WiQueryCoreHeaderContributor.renderHead(WiQueryCoreHeaderContributor.java:
131)
at
org.apache.wicket.behavior.AbstractHeaderContributor.renderHead(AbstractHeaderContributor.java:
68)
at org.apache.wicket.Component.renderHead(Component.java:2768)
at org.apache.wicket.ajax.AjaxRequestTarget
$3.component(AjaxRequestTarget.java:1137)

and I use wicket 1.4.13

Ernesto Reinaldo Barreiro

unread,
Dec 9, 2010, 7:47:21 AM12/9/10
to wiquery...@googlegroups.com
Maybe you have a wrong version of wiQuery? Which one are you using?

Regards,

Ernesto.

decebal

unread,
Dec 9, 2010, 8:08:59 AM12/9/10
to wiquery-plugins

Ernesto Reinaldo Barreiro

unread,
Dec 9, 2010, 8:36:43 AM12/9/10
to wiquery...@googlegroups.com
Yes, I know but is it 1.1.1 that jar the one you have on your
class-path? See [1]. that class has the method

public void addJavaScriptResource(ResourceReference reference) {
this.javascriptResources.add(reference);
}

and JavascriptResourceReference is an instance of ResourceReference.
Will try the editor myself and see if I get this error.

Ernesto

1-http://code.google.com/p/wiquery/source/browse/tags/1.1.1/src/main/java/org/odlabs/wiquery/core/commons/WiQueryResourceManager.java

decebal

unread,
Dec 9, 2010, 9:23:28 AM12/9/10
to wiquery-plugins
only wiquery 1.1.1 jar is on my classpath.
when I click on error from the eclipse console everything is ok (I see
the method)

On Dec 9, 3:36 pm, Ernesto Reinaldo Barreiro <reier...@gmail.com>
wrote:
> Yes, I know but is it 1.1.1 that jar the one you have on your
> class-path? See [1]. that class has the method
>
>  public void addJavaScriptResource(ResourceReference reference) {
>                 this.javascriptResources.add(reference);
>        }
>
> and JavascriptResourceReference is an instance of ResourceReference.
> Will try the editor myself and see if I get this error.
>
> Ernesto
>
> 1-http://code.google.com/p/wiquery/source/browse/tags/1.1.1/src/main/ja...
>
>
>
>
>
>
>
> On Thu, Dec 9, 2010 at 2:08 PM, decebal <decebal.s...@gmail.com> wrote:
> > wiquery 1.1.1
> > Seehttp://wiquery.googlecode.com/svn/repo/org/odlabs/wiquery/wiquery-cke...

Ernesto Reinaldo Barreiro

unread,
Dec 9, 2010, 9:32:51 AM12/9/10
to wiquery...@googlegroups.com
Thats weird. I see the signature of the method changed from 1.0.X to
1.1.X. Did you installs the jar containing CKeditorBehavior class
yourself via mvn install or you got it form somewhere else? Will try
to build an example when I'm back home and see if I get the same
problem.

Regards,

Ernesto

decebal

unread,
Dec 9, 2010, 9:46:50 AM12/9/10
to wiquery-plugins
<repository>
<id>wiquery-maven-repo</id>
<name>WiQuery Repository</name>
<url>http://wiquery.googlecode.com/svn/repo</url>
</repository>

<dependency>
<groupId>org.odlabs.wiquery</groupId>
<artifactId>wiquery-ckeditor</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

On Dec 9, 4:32 pm, Ernesto Reinaldo Barreiro <reier...@gmail.com>
wrote:

Ernesto Reinaldo Barreiro

unread,
Dec 9, 2010, 10:04:05 AM12/9/10
to wiquery...@googlegroups.com
Can you try to generate them yourself and see if you get the same error?

Regards,

Ernesto

decebal

unread,
Dec 9, 2010, 10:56:52 AM12/9/10
to wiquery-plugins
It's work!

I take the wiquery-ckeditor from trunk and create 1.2-SNAPSHOT in my
maven repository.
I added this dependencies in my pom.xml

<dependency>
<groupId>org.odlabs.wiquery</groupId>
<artifactId>wiquery</artifactId>
<version>1.1.2</version>
</dependency>

<dependency>
<groupId>org.odlabs.wiquery</groupId>
<artifactId>wiquery-ckeditor</artifactId>
<version>1.2-SNAPSHOT</version>
</dependency>

Can you publish other versions for wiquery-ckeditor in the maven
repository(http://wiquery.googlecode.com/svn/repo/org/odlabs/wiquery/
wiquery-ckeditor/)?

On Dec 9, 5:04 pm, Ernesto Reinaldo Barreiro <reier...@gmail.com>
wrote:

indiana_jules

unread,
Dec 9, 2010, 2:55:26 PM12/9/10
to wiquery-plugins
Hi,

I've updated the pom.xml to use the last wiquery release (the 1.1.2)
and that seems to work well. Maybe this is a problem with the
dependencies in the last version. I let for the moment the wiquery-
ckeditor as a snapshot.

My example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:wicket="http://wicket.apache.org/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /
>
<title>WiQuery application</title>
</head>

<body>
<textarea wicket:id="editor"></textarea>
</body>
</html>

package org.odlabs.wiquery.examples;

import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.TextArea;
import org.odlabs.wiquery.plugins.ckeditor.CKeditorBehavior;


public class HomePage extends WebPage {
private static final long serialVersionUID = 1L;

public HomePage(final PageParameters parameters) {
super();

TextArea<String> editor = new TextArea<String>("editor");
editor.add(new CKeditorBehavior());
add(editor);
}
}

As attachment, a snapshot of the result.

You can download the new version (I've updated the repository).

Regards

Julien
Reply all
Reply to author
Forward
0 new messages