Hmmm, interesting... Wicket components are by default created with the idea that the model is managed at the server side.

The best solution is probably to combine this with roundtrips; so each time you push a button, it would remove from one and add to the other side. Combined with ajax, that might be a pretty robust solution. Another solution might be to have 'auto growing' lists, that try to synchronize their models with what comes in.

Could you please send us some code fragments (especially the client side ones)?

Johan, have you made such a component yet?

Eelco


Kruger Jan Petter wrote:

I’m trying to implement a page with two selection lists. The purpose is to have a control where one can move selected choices between the two lists.

With a little javascript the movement of items between the lists is easy, but the problem arises when the form embedding the lists is submitted. If the

Content in the lists are changed, wicket gives me a runtime exception. I guess this has something to do with the change in number of elements in the lists, and

some checks against the model. I have used a ListMulitpleChoice control like

new ListMultipleChoice("availableDomainRoles",userWeb.getAvailableDomainRoles());

I could create a class that extends ListMultipleChoice. Are there any samples doing this, or are there another approach to this that I have missed ?

[2005-06-16 14:20:20,510] ERROR [PoolThread-49] RequestCycle.onRuntimeException(561) | Unexpected runtime exception [page = null]

_wicket.WicketRuntimeException_: Method public abstract void wicket.markup.html.form.IFormSubmitListener.onFormSubmitted() of interface IFormSubmitListener threw an exception

at wicket.protocol.http.WebRequestCycle.invokeInterface(_WebRequestCycle.java:348_)

at wicket.protocol.http.WebRequestCycle.invokeInterface(_WebRequestCycle.java:387_)

at wicket.protocol.http.WebRequestCycle.callComponentListener(_WebRequestCycle.java:284_)

at wicket.protocol.http.WebRequestCycle.parseRequest(_WebRequestCycle.java:122_)

at wicket.RequestCycle.request(_RequestCycle.java:372_)

at wicket.protocol.http.WicketServlet.doGet(_WicketServlet.java:221_)

at wicket.protocol.http.WicketServlet.doPost(_WicketServlet.java:245_)

at javax.servlet.http.HttpServlet.service(_HttpServlet.java:760_)

at javax.servlet.http.HttpServlet.service(_HttpServlet.java:853_)

at org.mortbay.jetty.servlet.ServletHolder.handle(_ServletHolder.java:358_)

at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(_WebApplicationHandler.java:294_)

at org.mortbay.jetty.servlet.ServletHandler.handle(_ServletHandler.java:567_)

at org.mortbay.http.HttpContext.handle(_HttpContext.java:1807_)

at org.mortbay.jetty.servlet.WebApplicationContext.handle(_WebApplicationContext.java:525_)

at org.mortbay.http.HttpContext.handle(_HttpContext.java:1757_)

at org.mortbay.http.HttpServer.service(_HttpServer.java:879_)

at org.mortbay.http.HttpConnection.service(_HttpConnection.java:790_)

at org.mortbay.http.HttpConnection.handleNext(_HttpConnection.java:961_)

at org.mortbay.http.HttpConnection.handle(_HttpConnection.java:807_)

at org.mortbay.http.SocketListener.handleConnection(_SocketListener.java:218_)

at org.mortbay.util.ThreadedServer.handle(_ThreadedServer.java:300_)

at org.mortbay.util.ThreadPool$PoolThread.run(_ThreadPool.java:511_)

Caused by: _java.lang.reflect.InvocationTargetException_

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 wicket.protocol.http.WebRequestCycle.invokeInterface(_WebRequestCycle.java:339_)

... 21 more

Caused by: _java.lang.IndexOutOfBoundsException_: Index: 0, Size: 0

at java.util.ArrayList.RangeCheck(_ArrayList.java:507_)

at java.util.ArrayList.get(_ArrayList.java:324_)

at wicket.markup.html.form.model.ChoiceList.get(_ChoiceList.java:188_)

at wicket.markup.html.form.model.ChoiceList.choiceForId(_ChoiceList.java:154_)

at wicket.markup.html.form.ListMultipleChoice.updateModel(_ListMultipleChoice.java:188_)

at wicket.markup.html.form.Form$12.formComponent(_Form.java:546_)

at wicket.markup.html.form.Form$6.component(_Form.java:411_)

at wicket.MarkupContainer.visitChildren(_MarkupContainer.java:499_)

at wicket.markup.html.form.Form.visitFormComponents(_Form.java:407_)

at wicket.markup.html.form.Form.updateFormComponentModels(_Form.java:538_)

at wicket.markup.html.form.Form.validate(_Form.java:386_)

at wicket.markup.html.form.Form.onValidate(_Form.java:337_)

at wicket.markup.html.form.Form.onFormSubmitted(_Form.java:223_)

... 26 more

Jan-Petter ::-Q




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to