The component I am aiming for is something like the palette component in
Velocity. I'm interested in the contents of the boxes and not which
elements that are selected. What I do at the moment is just to use one
multi select box and use the selected items, does the job, but do not
feel as nice...

I would really like to avoid roundtrips to the server for something that
could be solved in the browser. The Ajax approach might be interesting
though.

Code? At the moment my code around this is in a mess, after several
iterations trying to get something to work. I take it that client side
is the html? I have attached the html (it has to be put inside a form)
and javascript to move things between the boxes.

Jan-Petter ::-Q

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Eelco
Hillenius
Sent: 17. juni 2005 08:30
To: [email protected]
Subject: Re: [Wicket-user] ListMultipleChoice

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.getAvailableDomainRole
s());
>
> 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.ja
va:348_)
>
> at 
>
wicket.protocol.http.WebRequestCycle.invokeInterface(_WebRequestCycle.ja
va:387_)
>
> at 
>
wicket.protocol.http.WebRequestCycle.callComponentListener(_WebRequestCy
cle.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(_WebApplication
Handler.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(_WebApplicationCo
ntext.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:21
8_)
>
> 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.ja
va:39_)
>
> at 
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(_DelegatingMethodAccesso
rImpl.java:25_)
>
> at java.lang.reflect.Method.invoke(_Method.java:324_)
>
> at 
>
wicket.protocol.http.WebRequestCycle.invokeInterface(_WebRequestCycle.ja
va: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:15
4_)
>
> at 
>
wicket.markup.html.form.ListMultipleChoice.updateModel(_ListMultipleChoi
ce.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
Available Elements   Selected Elements
ELEMENT 1 ELEMENT 2 ELEMENT 3 ELEMENT 4 >" value="Flytt >>"/>

>" value="Alle >>"/>

Attachment: option.js
Description: option.js

Reply via email to