Re: AjaxFallbackDefaultDataTable: cell not receiving event after sorting

2013-06-09 Thread dlock
Hi Sven.
I created a QuickStart as per your suggestion and in the process of writing
it I discovered what the issue was.

Basically the mark-up had an erroneous enclosure tag defined which was
causing the problem.  

*div wicket:enclosure=table*


   * /div*

Removing the enclosure tag rectified the problem.  

At least now I know how to create a QuickStart :)

Thanks for you help.

View this message in context:
Sent from the Users forum mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

Re: Quick fix for the dreaded org.hibernate.LazyInitializationException with WicketTester

2013-06-09 Thread vzog
I managed to make a similar workaround to enable reopening of session in unit
tests using your approach. I'm using wicket 6.7, hibernate 4 and spring
please let me know if you have any problem in this configuration
Thanks a lot

Leon Nieuwoudt wrote
 Hi all,
 After about 5 minutes of omfg not that error again, I think I found a
 quick hack to avoid org.hibernate.LazyInitializationException with
 WicketTester. I've checked everywhere on the lists but didn't find a
 solution, so apologies if someone else already posted this. There may also
 be a better way to do it.
 If I can explain it properly:
 * I have an abstract BaseAdminApplication class that extends
 and does the standard application configurations (mounting/stuff), but no
 Spring injection configuration yet.
 * Then I have a SpringAdminApplication that extends from
 BaseAdminApplication. This is referenced for the normal
 applicationContext.xml, and correctly configures Spring Injection.
 * There is another subclass, called JUnitAdminApplication, that also
 from BaseAdminApplication. This is referenced in the Unit Testing
 application context.
 * The JUnitAdminApplication mimics the OSIV pattern, inside Wicket's
 WebSession.attach() and .detach() methods.
 * Configure Spring Injection outside of the WebApplication. For some
 there were odd errors when configuring during the WebApplication.init()
 I do hope it makes sense. Unfortunately I can't give out all the code, but
 I'm sure it'll set the next person on the right track before redoing tests
 with Selenium at the 11th hour. So far there are no strange surprises,
 package com.SECRETAPP.web;
 import ..;
 public class JUnitAdminApplication extends BaseAdminApplication {
 SessionFactory sessionFactory;
 public Session newSession(Request request, Response response) {
 return new WebSession(request) {
 protected void attach() {
 // Do the attach magic that I don't care about right now
 // Force the creation of a new Hibernate session using
 SessionFactoryUtils.getSession(sessionFactory, true);
 // Force the session to be closed only when we tell it to
 // By default, the Hibernate session is closed somewhere
 // the request cycle. Similar to OpenSessionInViewFilter
 protected void detach() {
 // Only close the Hibernate Session now, after all
 is done
 // Other code...
 In com/SECRETAPP/web/BaseTester-context.xml ..
 context:component-scan base-package=com.SECRETAPP /
 bean id=wicketApplication

 In my WicketTestBase abstract class...
 public abstract class WicketTestBase {
 // Stripped code
 protected WicketTester createTester() {
 if(tester != null) {
 return tester;
 WebApplication app = (WebApplication)
 tester = new WicketTester(app) {
 public ServletContext newServletContext(String path) {
 MockServletContext servletContext = (MockServletContext)
 return servletContext;
 SpringComponentInjector(tester.getApplication(), applicationContext,
 // Stripped code
 return tester;

View this message in context:
Sent from the Users forum mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

Wicket context menu component

2013-06-09 Thread bronius

I needed context menu component, but surprisingly it does not exit for
current version, so decided to roll my own, even though i have very little
Wicket experience and know absolutely nothing about jquery, so im like that
dog :) 

Anyway I managed to get something working like this (maybe it will be
helpful for someone or maybe someone smarter will show me my mistakes):
1. Added dependency.
2. Chosen to use this jquery plugin:
3. After spending some time I managed to create Behavior like this:

public class ContextMenuBehavior extends JQueryAbstractBehavior {

private static final long serialVersionUID = 1L;

private String selector;

private ListMenuItem menuItems;

public ContextMenuBehavior(String selector, ListMenuItem menuItems) {
this.selector = selector;
this.menuItems = menuItems;

add(new JavaScriptResourceReference(ContextMenuBehavior.class,
add(new JavaScriptResourceReference(ContextMenuBehavior.class,
add(new CssResourceReference(ContextMenuBehavior.class,

protected String $() {
// build menu items for jquery
StringBuilder items = new StringBuilder(items: {);
int nbOfMenuItems = menuItems.size();
for (int i = 0; i  nbOfMenuItems; i++) {
MenuItem menuItem = menuItems.get(i);
items.append(').append(menuItem.getId()).append(': {name:
').append(menuItem.getTitle().getObject()).append(', icon:
if (i  nbOfMenuItems - 1) {
return String.format($(function(){$.contextMenu({selector: '%s',
callback: function(key, options) {var m = 'clicked: ' + key; window.console
 console.log(m) || alert(m); }, %s});});, selector, items.toString());


4. $() method just prints jquery context menu initialization stuff from

5. Now when add this behavior to Page and add div class=userContextMenu to
html right click on it gives me context menu so its working. Clicking on
menu also shows me simple alert message as it is in callback parameter.

6. So far so good, but now Im interested in how to link this to wicket
component listener. I will put this menu on multiple links, so i would like
to receive both on which link user clicked for context menu and which menu
item he have chosen. How would you implement this? Also am I even on the
right track? Is it good approach? Im sorry if this is stupid question :)

View this message in context:
Sent from the Users forum mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

Apache Wicket + Ace Editor

2013-06-09 Thread Shengche Hsiao
Hello everyone

I want to integrate ace editor into my wicket project, but after gooogled I
failed to do it.
Is anyone give my some advise?

We do this not because it is easy. We do this because it is hard.
View this message in context:
Sent from the Users forum mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail: