Wysiwyg editor plugin for wicket jquery ui

705 views
Skip to first unread message

Andun Sameera

unread,
Jun 5, 2013, 2:30:46 AM6/5/13
to wicket-j...@googlegroups.com, Maxim Solodovnik
Hi Sebatien,

Me and Maxim have created a Wicket-jquery-UI plugin for Wysiwyg text editor which can be found at [1]. We have hosted our source code at [2]. We would like to merge that with Wicket-jquery-UI code. Can you please do the needful.

Thanks!

[1] - http://mindmup.github.io/bootstrap-wysiwyg/
[2] - https://github.com/andunslg/Wysiwyg-Wicket

--
Regards
Andun S.L. Gunawardana
Undergraduate
Department of Computer Science And Engineering
University of Moratuwa
Sri Lanka

Blog - http://www.insightforfuture.blogspot.com/
LinkedIn - http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
Twitter -http://twitter.com/AndunSLG

Sebastien

unread,
Jun 5, 2013, 3:51:29 AM6/5/13
to wicket-j...@googlegroups.com, Maxim Solodovnik
Hi Andun & Maxim,

That's great, thank you! I will test and integrate it asap.
It should be available in the next release...

Best regards,
Sebastien

Andun Sameera

unread,
Jun 5, 2013, 9:01:48 AM6/5/13
to wicket-j...@googlegroups.com, Maxim Solodovnik
Hi Sebastien,

We have to do some modifications. Please do the testing after that. We will let you know about that.

Thanks!

Maxim Solodovnik

unread,
Jun 6, 2013, 8:15:38 AM6/6/13
to Andun Sameera, wicket-j...@googlegroups.com

Sebastien,

Maybe you know, is it possible to download file from git using maven?
This js plugin uses font which is partially compatible with AL:
http://markmail.org/message/a66igo5t3i5sxor2

Sebastien

unread,
Jun 6, 2013, 9:07:34 AM6/6/13
to wicket-j...@googlegroups.com
Hi Maxim,

As far as I understand, downloading the file on build time a requirement about the license concern?

So, purely maven speaking, I don't know if 'js' packaging is now handled by maven... But even in that case, you will have to 'force' the download of the dependency which normally cannot be done except for snapshots...
Maybe javascript-maven-plugin can answer your need. If not, maybe should you consider a continuous integration via Jenkins, I suppose there is a module that allows to perform such thing...

Well now, if it is for wicket-jquery-ui, that's another discussion; I know it is possible to have a continuous integration with GitHub and Jenkins, but I have yet not idea how to set it up...

Hope I partially answer your question...
Sebastien.

Maxim Solodovnik

unread,
Jun 6, 2013, 11:36:24 PM6/6/13
to wicket-j...@googlegroups.com
If I understand the license correctly (i'm not license expert :)) )
The font can be used in binary form and should not be in Apache SVN ...
So there is no issue it it will be in googlecode SVN from my point of view :)

Maxim Solodovnik

unread,
Jun 7, 2013, 2:24:18 PM6/7/13
to wicket-j...@googlegroups.com
Hello Sebastian,

Could you please take a look at the plugin: https://github.com/andunslg/Wysiwyg-Wicket
It is not perfect, but maybe it is OK for the first revision?

Issues I can see with it right now:
1) not configurable resources
2) no localization
3) SIL licensed font in the resources (not sure is it is issue or not)

Thanks in advance

Sebastien Briquet

unread,
Jun 16, 2013, 12:19:21 PM6/16/13
to wicket-j...@googlegroups.com
Hi Andun, Hi Maxim,

That nice for a first version, thank you!
I did integrate the WysiwygEditor to wicket-jquery-ui-plugins. I just refactored it a little bit to stay consistent with the overall code design.
https://github.com/sebfz1/wicket-jquery-ui/tree/master/wicket-jquery-ui-plugins/src/main/java/com/googlecode/wicket/jquery/ui/plugins/wysiwyg

Here is the list of changes that can break you current use:
  • renamed WysiwygDefaultToolbar to DefaultWysiwygToolbar (because it implements IWysiwygToolbar)
  • moved DefaultWysiwygToolbar to 'toolbar' package
  • renamed WysiwygEditor#getEditorMarkupID() to #getEditorMarkupId()
  • editor.css: renamed .editor-area to .wysiwyg-editor
Please tell me if it's ok like this and if you will manage the enhancements you mentioned bellow...

I added a sample in the demo webapp (not deployed yet)
6.8.2-SNAPSHOT has been deployed, so you can use it right now.

Best regards,
Sebastien.
Message has been deleted

Andun Sameera

unread,
Jul 8, 2013, 1:32:05 AM7/8/13
to wicket-j...@googlegroups.com, Maxim Solodovnik
Hi Sebestian,

I have implmented configurable resource references, localizations. Also I have removed the problematic font files and replace them with images. I have committed them to this repo https://github.com/andunslg/Wysiwyg-Wicket/. Please add these changes also! I have refactored the repo to make it identical to your one. Also we I have added a entry to the readme.md file in my repo mentioning a reference to the icon library(FamFam Silk Icons) i have used. That have to be included in your readme also.

Thanks!

Sebastien

unread,
Jul 8, 2013, 7:33:46 AM7/8/13
to wicket-j...@googlegroups.com, Maxim Solodovnik
Hi Andun,

I am looking to this asap, thanks :)

Sebastien.

Sebastien Briquet

unread,
Jul 13, 2013, 8:27:17 AM7/13/13
to wicket-j...@googlegroups.com, Maxim Solodovnik
Hi Andun,

Seems to be very good, thanks!
I have integrated your updates and made a pull request to you so you will have the small changes I did.
Please note that I renamed getJqueryHotKeysJavaScriptReference to getJQueryHotKeysJavaScriptReference (uppercase Q) and that some classes are still missing javadoc... ;)

Best regards,
Sebastien.

Andun Sameera

unread,
Jul 15, 2013, 12:56:39 AM7/15/13
to wicket-j...@googlegroups.com, Maxim Solodovnik
Hi Sebastien,

I have merged you pull request to my repo. Also will provide Java Doc Updates soon!

Thanks!

Jan Dohrmann

unread,
Dec 19, 2013, 2:08:45 PM12/19/13
to wicket-j...@googlegroups.com, Maxim Solodovnik
Hi Sebastien,

The WysiwygEditor is a nice component. I have a suggestion for an improvement - maybe there is already a solution or maybe I am using the component the wrong way.

My scenario is the following. I created a ModalWindow with a panel and in this Panel I construct a WysiwygEditor.

The ModalWindow (with the editor) is hidden in the first place but will be shown when I press an AjaxButton. The challenge is that the WysiwygEditor do not read the Model Object first time it is shown. It shows the value from the Model when it was created.

I would expect that the editor should read the Model when it is shown not when it is constructed?

Please give your opinion and maybe a workaround.

Best Regards
Jan

Sebastien

unread,
Dec 19, 2013, 5:33:50 PM12/19/13
to wicket-j...@googlegroups.com
Hi Jan,

Glad to read you like it :)

Your problem is due to the nature of FormComponent(s), their values (here the textarea's text) comes from the model only when no value are available. So even the model object changed afterward, the value will remains the same... I don't know ModalWindow too much but I guess it does not handle this use-case particularly.

The point is that there is no value available when you are (re)attaching the component. So IMO, the most efficient way to read again from the model is to re-attach the editor to the ART; something like this:

@override
public void show(ART target)
{
    super.show(target);

    target.add(this.editor); // re-attach the WysiwygEditor
    // or target.add(this.theEditorPanel);
}

Hope this helps! :)
Sebastien.

Jan Dohrmann

unread,
Dec 19, 2013, 6:40:22 PM12/19/13
to wicket-j...@googlegroups.com
Hi Sebastien,

Thank you for the quick answer - I will try that.

I found another solution that works. I call modelChanged() in the Editors onBeforeRender() which force the editor to read the Model object again before each rendering. Is that a good workaround? I am still new to Wicket.


Best Regards
Jan

Martin Grigorov

unread,
Dec 20, 2013, 3:12:29 AM12/20/13
to wicket-j...@googlegroups.com


On Fri, Dec 20, 2013 at 10:10 AM, Martin Grigorov <mgri...@apache.org> wrote:

Martin Grigorov
Wicket Training and Consulting


--
You received this message because you are subscribed to the Google Groups "wicket-jquery-ui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wicket-jquery-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wicket-jquery-ui/a58e7d63-a41f-4609-90cd-d52509b14a6c%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


Sebastien

unread,
Dec 20, 2013, 4:10:04 AM12/20/13
to wicket-j...@googlegroups.com
Hi Martin,

Yes, I was also surprised with these 2 lines yesterday because I know it's a bad practice to unwrap models in the ctor. I don't know if I did this or it it comes from the original implementation and I did not pay attention...
By testing, I replaced the first line by this.getModel() and removed the second line (IIRC, because I slept in the meantime ;)). The component behave in the same way so I will commit the change as soon as I will have tested a little bit further...

However, it does not explain to me why calling #modelChanged() works. For the few I saw, the #open method is supposed to only trigger the javascript that displays/shows the dialog; #onComponentTag (which calls #getValue) is not supposed to be called, only the js statement is supposed to be sent to the client... So I am really curious to see how ModalWindow is handling this!.. I will investigate...

Thanks for having taken a look!
Best regards,
Sebastien.


On Fri, Dec 20, 2013 at 9:12 AM, Martin Grigorov <martin....@gmail.com> wrote:

Jan Dohrmann

unread,
Dec 20, 2013, 12:35:14 PM12/20/13
to wicket-j...@googlegroups.com
Hi Sebastiin,

To help you I give you the  important pieces of my code regarding Modual Window. As mentioned the editor read the value from the model in its constructor and not later on when the editor is redered.

Main panel (constructor code)

final ModalWindow popupEditor = new Editor("popupEditor", labelModel, aModel);
popupEditor.setOutputMarkupId(true);


final AjaxButton editorButton = new AjaxButton("editorButton", form)
{
     protected void onSubmit(AjaxRequestTarget target, Form<?> form)
     {
         popupEditor.show(target);
     }
};


ModalWindow ( code constructor)

final EditorPanel EditorPanel = new EditorPanel(this.getContentId(), aModel) ;

Panel in ModalWindow (constructor code)

final DefaultWysiwygToolbar toolbar = new DefaultWysiwygToolbar("toolbar");
final WysiwygEditor editor  = new WysiwygEditor("editor", aModel)
{
     @Override
      protected void onBeforeRender()
      {
          super.onBeforeRender();

          // Force editor to reread model before rendering
          modelChanged();
       }
};

Best Regards Jan

Sebastien

unread,
Dec 22, 2013, 9:16:30 AM12/22/13
to wicket-j...@googlegroups.com
Hi Jan, Hi Martin,

@Jan, thanks for for code snippets, it allowed me test a little...
@Martin, well see! This was exactly the root of the issue.

I finally understood why the model update is reflected while open the window... Because, not only the js statement is sent, but the whole window is re-attached to the ART

    public void show(final AjaxRequestTarget target)
    {
        if (shown == false)
        {
            getContent().setVisible(true);
            target.add(this);
            target.appendJavaScript(getWindowOpenJavaScript());
            shown = true;
        }
    }


I also finally remembered the goal of Model.of(this.getModelObject()). Even this is a bad practice that should be avoided, this is was a workaround to a common problem of transmitting the model as-is to a child component, in the ctor. If the model is a CompoundPropertyModel, you get into troubles.
For instance, if you have
    final WysiwygEditor editor  = new WysiwygEditor("editor") // CPM
and in WysiwygEditor#ctor:
    this.textarea = new TextArea<String>("textarea", this.getModel());
You've got a runtime exception saying
"textarea" property was not found (which remains logical actually, even if it looks strange because we are explicitly supplying a model as a parameter).

The only way I (now) know to properly "correct" this is to make the instantiation of the TextArea in #onInitialize... But in this case, what is strange is that the behavior is actually different depending on "where" the component has been instantiated. I think this is not easy to understand for newcomers (and honestly... not only for newcomers), and I am almost sure there is no such mention in the - still excellent - wicket guide...

Anyway, I will commit the fix, it will be available for 6.13.0.

Thanks & best regards,
Sebastien.

Martin Grigorov

unread,
Dec 27, 2013, 4:26:20 AM12/27/13
to wicket-j...@googlegroups.com
Hi Sebastien,

I think you should not optimize for CPM.
If the user application wants to use CPM then it is its responsibility to provide a proper object for the actual component tree.


--
You received this message because you are subscribed to the Google Groups "wicket-jquery-ui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wicket-jquery-...@googlegroups.com.

Martin Grigorov

unread,
Dec 30, 2013, 8:17:17 AM12/30/13
to wicket-j...@googlegroups.com
On Fri, Dec 27, 2013 at 11:26 AM, Martin Grigorov <martin....@gmail.com> wrote:
Hi Sebastien,

I think you should not optimize for CPM.
If the user application wants to use CPM then it is its responsibility to provide a proper object for the actual component tree.

Or use org.apache.wicket.model.CompoundPropertyModel#bind(String)

Sebastien

unread,
Jan 5, 2014, 6:13:04 PM1/5/14
to wicket-j...@googlegroups.com
Hi Martin,

Thanks very much,
I will take a deeper look at this and see if something can be done... I will also see if IComponentAssignedModel can be of some help (or not).

I would like to wish you a very happy new year with all successes you deserve! :)

Best regards,
Sebastien.

Maxim Solodovnik

unread,
Jan 9, 2014, 10:16:25 PM1/9/14
to wicket-j...@googlegroups.com
I have added code for model manipulation because changes were not reflected to the model passed otherwise :(
I might use hack instead of proper way because of lack of time :(

Jan Dohrmann

unread,
Jan 13, 2014, 10:21:34 AM1/13/14
to wicket-j...@googlegroups.com
Hi all,

During stress test the editor throws an java.util.ConcurrentModificationException from the PackageResourceGuard. Is that a known problem?

I create 10 editors per second.

Best Regards
Jan

Martin Grigorov

unread,
Jan 13, 2014, 10:29:12 AM1/13/14
to wicket-j...@googlegroups.com
Hi,

This sounds like a problem in Wicket itself.
Can you please post the stacktrace ?


--
You received this message because you are subscribed to the Google Groups "wicket-jquery-ui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wicket-jquery-...@googlegroups.com.

Sebastien

unread,
Jan 13, 2014, 10:32:39 AM1/13/14
to wicket-j...@googlegroups.com
Hi Jan, hi Martin,

Yes, or a editor's collection being updated without being synchronized.
Are you using multiple thread for testing ?

Thanks,
Sebastien



Jan Dohrmann

unread,
Jan 13, 2014, 10:59:01 AM1/13/14
to wicket-j...@googlegroups.com
Txs for looking into it. Here is the dump. Bold marked what I believe is the cause.

13 jan 2014 16:18:23,633 WARN Handling the following exception org.apache.wicket.request.cycle.RequestCycle.handleException
org.apache.wicket.WicketRuntimeException: An error occurred while generating an Url for handler 'ResourceReferenceRequestHandler{resourceReference=scope: org.apache.wicket.resource.JQueryResourceReference; name: jquery/jquery-1.10.1.js; locale: null; style: null; variation: null, pageParameters=}'
    at org.apache.wicket.request.cycle.RequestCycle.urlFor(RequestCycle.java:535)
    at org.apache.wicket.markup.head.JavaScriptReferenceHeaderItem.getUrl(JavaScriptReferenceHeaderItem.java:159)
    at org.apache.wicket.markup.head.JavaScriptReferenceHeaderItem.getRenderTokens(JavaScriptReferenceHeaderItem.java:142)
    at org.apache.wicket.markup.head.PriorityHeaderItem.getRenderTokens(PriorityHeaderItem.java:64)
    at org.apache.wicket.markup.head.internal.HeaderResponse.wasItemRendered(HeaderResponse.java:61)
    at org.apache.wicket.markup.head.internal.HeaderResponse.render(HeaderResponse.java:52)
    at org.apache.wicket.markup.head.ResourceAggregator.renderHeaderItems(ResourceAggregator.java:304)
    at org.apache.wicket.markup.head.ResourceAggregator.close(ResourceAggregator.java:273)
    at org.apache.wicket.markup.html.internal.HtmlHeaderContainer.onComponentTagBody(HtmlHeaderContainer.java:175)
    at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:71)
    at org.apache.wicket.Component.internalRenderComponent(Component.java:2549)
    at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1493)
    at org.apache.wicket.Component.internalRender(Component.java:2379)
    at org.apache.wicket.Component.render(Component.java:2307)
    at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1390)
    at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1554)
    at org.apache.wicket.Page.onRender(Page.java:876)
    at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:142)
    at org.apache.wicket.Component.internalRender(Component.java:2379)
    at org.apache.wicket.Component.render(Component.java:2307)
    at org.apache.wicket.Page.renderPage(Page.java:1010)
    at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:121)
    at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:274)
    at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:165)
    at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:861)
    at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
    at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
    at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
    at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
    at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
    at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
    at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:152)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.util.ConcurrentModificationException
    at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)
    at java.util.ArrayList$ListItr.previous(ArrayList.java:886)
    at org.apache.wicket.util.collections.ReverseListIterator.next(ReverseListIterator.java:53)
    at org.apache.wicket.markup.html.SecurePackageResourceGuard.acceptAbsolutePath(SecurePackageResourceGuard.java:186)
    at org.apache.wicket.markup.html.PackageResourceGuard.accept(PackageResourceGuard.java:71)
    at org.apache.wicket.request.resource.PackageResource.accept(PackageResource.java:486)
    at org.apache.wicket.request.resource.PackageResource.internalGetResourceStream(PackageResource.java:458)
    at org.apache.wicket.request.resource.PackageResource.getCacheableResourceStream(PackageResource.java:395)
    at org.apache.wicket.request.resource.PackageResource.getCacheKey(PackageResource.java:223)
    at org.apache.wicket.request.resource.caching.version.RequestCycleCachedResourceVersion.getVersion(RequestCycleCachedResourceVersion.java:81)
    at org.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategy.decorateUrl(FilenameWithVersionResourceCachingStrategy.java:102)
    at org.apache.wicket.core.request.mapper.BasicResourceReferenceMapper.mapHandler(BasicResourceReferenceMapper.java:238)
    at org.apache.wicket.request.mapper.ParentPathReferenceRewriter.mapHandler(ParentPathReferenceRewriter.java:91)
    at org.apache.wicket.request.mapper.CompoundRequestMapper.mapHandler(CompoundRequestMapper.java:215)
    at org.apache.wicket.request.cycle.RequestCycle.mapUrlFor(RequestCycle.java:429)
    at org.apache.wicket.request.cycle.RequestCycle.urlFor(RequestCycle.java:529)
    ... 51 more

Martin Grigorov

unread,
Jan 13, 2014, 11:01:04 AM1/13/14
to wicket-j...@googlegroups.com
Iterating over the entries is OK.
The question is : who is adding/removing entries in the same time ?
Usually the application adds entries in MyApp#init() method.


--
You received this message because you are subscribed to the Google Groups "wicket-jquery-ui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wicket-jquery-...@googlegroups.com.

Jan Dohrmann

unread,
Jan 13, 2014, 11:14:57 AM1/13/14
to wicket-j...@googlegroups.com
The application has only one page, the page adds 10 panels (list), each panel has one editor. If I run this slow (one call pr 10 seconds) no problem. When I call the page 10 times in one second I get the exception and only with the following editor code

final WysiwygEditor embededEditor = new WysiwygEditor("embededEditor", new PropertyModel<String>(noteModel, "x.y"))

Jan Dohrmann

unread,
Jan 13, 2014, 11:24:24 AM1/13/14
to wicket-j...@googlegroups.com
OK I simplified the case. One page with one editor - 100 calls to the page creates the exception.

Martin Grigorov

unread,
Jan 13, 2014, 2:19:01 PM1/13/14
to wicket-j...@googlegroups.com
OK. It is not Wicket issue :-)

wicket-jquery-ui-plugins/src/main/java/com/googlecode/wicket/jquery/ui/plugins/wysiwyg/WysiwygBehavior.java
76: guard.addPattern("+*.eot");
77: guard.addPattern("+*.woff");
78: guard.addPattern("+*.ttf");

Those should be added just once. Preferably when the app starts.
See IInitializer#init(Application)


Martin Grigorov
Wicket Training and Consulting


Sebastien

unread,
Jan 13, 2014, 3:52:11 PM1/13/14
to wicket-j...@googlegroups.com
Hi Martin,

Thanks you very much for your investigation!! I will take care of this...
I will try using a wicket.properties file with an initializer... The only thing is that only one wicket.properties file can be defined, at the root jar/default package level (IIRC), and the wysiwyg editor is not the only plugin in wicket-jquery-ui-plugin, so the architecture would probably be a little bit weird... And worst if a future plugin need an initializer... Except if several initializers can be defined in the same file (which I don't know)

Thanks again, and thank you Jan for reporting ! :)
Sebastien



Jan Dohrmann

unread,
Jan 13, 2014, 4:06:08 PM1/13/14
to wicket-j...@googlegroups.com
Hi Sebastien and Martin,

I tried to add the file extensions to the guard in the application init method - see below. It does not work for me. The point is that I can run the application without errors when I create an editor once per second but if I try to create 50 editors per second the exception appears.

Do you have any idea what could cause the problem only under stress? I have time to investigate if I could get a hint.

Best Regards
Jan


@Override
    protected void init()
    {
        super.init();
        IPackageResourceGuard packageResourceGuard = getResourceSettings().getPackageResourceGuard();
        if (packageResourceGuard instanceof SecurePackageResourceGuard)
        {
            SecurePackageResourceGuard guard = (SecurePackageResourceGuard) packageResourceGuard;
            guard.addPattern("+*.eot");
            guard.addPattern("+*.woff");
            guard.addPattern("+*.ttf");

Martin Grigorov

unread,
Jan 13, 2014, 3:56:48 PM1/13/14
to wicket-j...@googlegroups.com
Each .jar can have an initializer (by defining it in /wicket.properties). This initializer can configure many things :-)

Martin Grigorov
Wicket Training and Consulting


Martin Grigorov

unread,
Jan 13, 2014, 4:10:04 PM1/13/14
to wicket-j...@googlegroups.com

Martin Grigorov
Wicket Training and Consulting


Jan Dohrmann

unread,
Jan 13, 2014, 5:07:28 PM1/13/14
to wicket-j...@googlegroups.com, mgri...@apache.org
Txs Martin,

Now I could make a patch  - have a release in two weeks from now. Looking forward for 6.13.0

Best Regards
Jan

Sebastien

unread,
Jan 13, 2014, 5:09:40 PM1/13/14
to wicket-j...@googlegroups.com
I should be able to commit the fix in a few minutes and deploy 6.12.2-SNAPSHOT, so you can test it.
wicket-jquery-ui-6.13 should be released this week...

Sebastien.


Jan Dohrmann

unread,
Jan 13, 2014, 5:17:18 PM1/13/14
to wicket-j...@googlegroups.com
I would appreciate very much! I would stress test it at once. Both this and the Model bug.

Best Regards
Jan

Sebastien

unread,
Jan 13, 2014, 5:59:52 PM1/13/14
to wicket-j...@googlegroups.com
Hi Jan

I've deployed 6.13.0-SNAPSHOT (because I did already upgrade to wicket-6.13.0)

Please, be sure to read the changelog here:
https://github.com/sebfz1/wicket-jquery-ui/wiki/%5Bchangelog%5D-wicket-jquery-ui-6.13.0

To enable the snapshot repository (either in pom.xml or settings.xml)
<repositories>
    <repository>
        <id>sonatype-snapshots</id>
        <name>Sonatype Snapshots Repository</name>
        <url>http://oss.sonatype.org/content/repositories/snapshots/</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

Thanks & best regards,
Sebastien

Jan Dohrmann

unread,
Jan 13, 2014, 6:32:37 PM1/13/14
to wicket-j...@googlegroups.com
Txs Sebastien,

I tested the snapshot. Of coarse your changes on the editor works - also under stress test - great.

Without changing anything else as using the snapshot (was already on Wicket 6.13.0)  I got a strange behavior of panels with AjaxButtons. They render slower after 100 calls. Going from 41 ms per page to  800 ms per page. Any idea? Other components using Ajax are not influenced. If the AjaxButtons are removed rendering is fast.

I already started to profile to find the cause.... The reason I ask is "Button(s): minor enhancements" in your change log.

Best Regards
Jan

Sebastien

unread,
Jan 13, 2014, 6:52:59 PM1/13/14
to wicket-j...@googlegroups.com
Hi Jan,

In [Ajax]Button, I just did if (!JQueryIcon.isNone(this.getIcon())) in #onConfigure instead of if (this.getIcon() != null)
(commit 73964f0b2d4203c8760085cb335b4de15c8a4119)

IsNone is implemented as follow:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/JQueryIcon.java?source=c#L221

I don't think this can cause this lower performance behavior, the equality is resolved as compilation time (comparison between constants)...

I have to go bed right know, if not, my day will be a nightmare tomorrow :)

Talk to you tomorrow & thanks for your testing :)
Sebastien



--
You received this message because you are subscribed to the Google Groups "wicket-jquery-ui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wicket-jquery-...@googlegroups.com.

Jan Dohrmann

unread,
Jan 13, 2014, 7:00:03 PM1/13/14
to wicket-j...@googlegroups.com
Thank you for quick response. I will return. My too - it is late in Denmark.

Best Regards Jan

Martin Grigorov

unread,
Jan 14, 2014, 2:19:34 AM1/14/14
to wicket-j...@googlegroups.com
Jan,

What tool do you use to test your application under stress ?


Sebastien

unread,
Jan 14, 2014, 2:21:34 AM1/14/14
to wicket-j...@googlegroups.com
Actually, a mistake appear in my previous mail; the equality (by calling #equals) is not resolved at compil time. (furthermore the argument is not a constant)....


Jan Dohrmann

unread,
Jan 14, 2014, 4:25:39 AM1/14/14
to wicket-j...@googlegroups.com
Hi Martin,

I use JMeter.

Best Regards
Jan

Jan Dohrmann

unread,
Jan 15, 2014, 8:36:51 AM1/15/14
to wicket-j...@googlegroups.com
Hi Sebastien,

This is the wrong thread but I would let you now that I get exceptions from SelectableBehavior without any code change in my part. The exceptions is thrown when is Selectable is rendered.

final ListView<xxx> listView = new ListView<xxx>("listView", listModel)
{
 ....
}

final Selectable<xxx> selectableListView = new Selectable<xxx>("vvv", listModel)
        {
            private static final long serialVersionUID = 1L;

            @Override
            public void onSelect(AjaxRequestTarget target, List<xxx> items)
            {
                 ...
                target.add("ttt");
            }
        };
        selectableListView.setOutputMarkupId(true);

Best regards
Jan

Sebastien

unread,
Jan 15, 2014, 8:41:45 AM1/15/14
to wicket-j...@googlegroups.com
Hi Jan,

Yes, it would have been better to open a new thread (for users experiencing a similar issue) :)

What is the stack trace?
Is target.add("ttt"); the real code?

Thanks & best regards,
Sebastien.

Jan Dohrmann

unread,
Jan 15, 2014, 9:00:38 AM1/15/14
to wicket-j...@googlegroups.com
Here is the stack trace and it is not real code. Had to remove confidential info.

Best regards
Jan

SEVERE: Servlet.service() for servlet [default] in context with path [/cacs] threw exception [Filter execution threw an exception] with root cause
java.lang.IllegalAccessError: tried to access field com.googlecode.wicket.jquery.core.JQueryBehavior.selector from class com.googlecode.wicket.jquery.ui.interaction.selectable.SelectableBehavior
    at com.googlecode.wicket.jquery.ui.interaction.selectable.SelectableBehavior.access$000(SelectableBehavior.java:43)
    at com.googlecode.wicket.jquery.ui.interaction.selectable.SelectableBehavior$1.getCallbackFunctionBody(SelectableBehavior.java:149)
    at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.getCallbackFunction(AbstractDefaultAjaxBehavior.java:494)
    at com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior.getCallbackFunction(JQueryAjaxBehavior.java:213)
    at com.googlecode.wicket.jquery.ui.interaction.selectable.SelectableBehavior.onConfigure(SelectableBehavior.java:102)
    at org.apache.wicket.Component.configure(Component.java:1034)
    at org.apache.wicket.Component.internalBeforeRender(Component.java:914)
    at org.apache.wicket.Component.beforeRender(Component.java:991)
    at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1681)
    at org.apache.wicket.Component.onBeforeRender(Component.java:3851)
    at org.apache.wicket.markup.html.form.Form.onBeforeRender(Form.java:1756)
    at org.apache.wicket.Component.internalBeforeRender(Component.java:923)
    at org.apache.wicket.Component.beforeRender(Component.java:991)
    at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1681)
    at org.apache.wicket.Component.onBeforeRender(Component.java:3851)
    at org.apache.wicket.Component.internalBeforeRender(Component.java:923)
    at org.apache.wicket.Component.beforeRender(Component.java:991)
    at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1681)
    at org.apache.wicket.Component.onBeforeRender(Component.java:3851)
    at org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.onBeforeRender(ModalWindow.java:856)
    at org.apache.wicket.Component.internalBeforeRender(Component.java:923)
    at org.apache.wicket.Component.beforeRender(Component.java:991)
    at org.apache.wicket.Component.internalPrepareForRender(Component.java:2214)
    at org.apache.wicket.Component.prepareForRender(Component.java:2253)
    at org.apache.wicket.ajax.XmlAjaxResponse.writeComponent(XmlAjaxResponse.java:107)
    at org.apache.wicket.ajax.AbstractAjaxResponse.writeComponents(AbstractAjaxResponse.java:218)
    at org.apache.wicket.ajax.AbstractAjaxResponse.writeTo(AbstractAjaxResponse.java:150)
    at org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:359)

    at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:861)
    at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
    at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:97)

Sebastien

unread,
Jan 15, 2014, 9:06:15 AM1/15/14
to wicket-j...@googlegroups.com
Jan,

I see. I reverted the call to #getSelector by this.selector, which is (now/again) protected.
https://github.com/sebfz1/wicket-jquery-ui/commit/34917bc7104cb33a15df16964f1d2ce9e4d9ccd5#diff-3777521262c95362ea2e1fc3bdbcb897

Are you sure all wicket-jquery-ui version are the same ? This could explain the issue.

Thanks,
Sebastien.



--
You received this message because you are subscribed to the Google Groups "wicket-jquery-ui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wicket-jquery-...@googlegroups.com.

Jan Dohrmann

unread,
Jan 15, 2014, 9:19:14 AM1/15/14
to wicket-j...@googlegroups.com
Sebastien,
 
I prepared an new project with only a ListView and a SelectableListView and it fails. I am Maven driven and yes this should by right:

        <wicket-version>6.13.0</wicket-version>
        <wicket-jquery-version>6.13.0-SNAPSHOT</wicket-jquery-version>

I will debug content in the browser ...

Best Regards
Jan

Sebastien

unread,
Jan 15, 2014, 9:28:11 AM1/15/14
to wicket-j...@googlegroups.com
Hi Jan,

What you could also do:

> git clone https://github.com/sebfz1/wicket-jquery-ui.git
> cd wicket-jquery-ui
> mvn clean install
> cd wicket-jquery-ui-samples
> mvn jetty:run

goto http://localhost:8080/wicket-jquery-ui/selectable/DefaultSelectablePage

If it works (and as you will have rebuild the 6.13.0-SNAPSHOT locally), test again trough your app

Hope this helps
Sebastien.



Sebastien

unread,
Jan 15, 2014, 9:36:48 AM1/15/14
to wicket-j...@googlegroups.com

I checked the deployed snapshot and it seems to be ok actually...
https://oss.sonatype.org/content/repositories/snapshots/com/googlecode/wicket-jquery-ui/wicket-jquery-ui-core/6.13.0-SNAPSHOT/wicket-jquery-ui-core-6.13.0-20140113.222618-1-sources.jar

public class JQueryBehavior extends JQueryAbstractBehavior
{
    ...

    protected String selector = null;
    protected final String method;
    protected final Options options;


Jan Dohrmann

unread,
Jan 15, 2014, 9:46:30 AM1/15/14
to wicket-j...@googlegroups.com
Hi Sebastien,

Thank you for the above - you were right had to rebuild it locally.

By the way - I found the reason for the slower response time when using 100 AjaxButtons on a Page. The total memory used from the new Wicket version and Wicket-jquery is a little bit larger than before and that loaded a little bit slower which resulted in a more current threads in the server and the server reached it maximum of configured threads.

Thank you for all your support. I will test your new code because I depend on it and hope that your effort will be paid back.

Best Regards
Jan

Jan Dohrmann

unread,
Jan 15, 2014, 9:58:10 AM1/15/14
to wicket-j...@googlegroups.com
And the reason for the needed local rebuild was an Kendo Editor which loaded the 6.12.0 wicket-jquery-core. SNAP-SHOT is fine.

Best Regards
Jan

Sebastien

unread,
Jan 15, 2014, 10:01:37 AM1/15/14
to wicket-j...@googlegroups.com
Jan,

Ok, that completely explains the issue, many thanks for the update !

Do you have a kind of reports about the stress tests ? I don't think there is deep changes in this new version of wicket-jquery-ui and I would be interested to know if some things could be optimized...

You are welcome, I do not expect much from the effort I made on this project, except that users are happy to use it ! :)
(and maybe one day the core team will find the project interesting/mature enough to make it gain the Apache level... :p )

Best regards,
Sebastien.

Jan Dohrmann

unread,
Jan 15, 2014, 11:27:17 AM1/15/14
to wicket-j...@googlegroups.com
Sebastien,

The stress test report is not generic. It is ordered by the customer and just verifies that 800 customers can be online and working at the same time. I used the stress test to find the bottlenecks in the code. I am new to Wicket and wanted to know the consequence of "losing" the session from hibernate persist objects due to LoadableDetachableModels.

Without any real numbers at hand it looks like Wicket code and code with Spring MVC (and handcrafted jQuery) run at the same speed. I know because I converted some old code from Spring MVC.

The next project will be more complex and require even more testing. I will think at re-use and sharing when I start this.

Best Regards
Jan

Martin Grigorov

unread,
Jan 15, 2014, 2:39:25 PM1/15/14
to wicket-j...@googlegroups.com
The project I work on is used by 200k concurrent users. At peak times there are ~500k.
That doesn't mean there are no places to improve in Wicket though! :-)
I'll be glad to investigate any finding you may have!


--
You received this message because you are subscribed to the Google Groups "wicket-jquery-ui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wicket-jquery-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages