Re: CompoundPropertyModel binding direction
Hi Lucio, your LabelAndField and DetailFormComponentPanel both extend FormComponentPanel. Thus they will take part in form processing and try to push a value into their model. Since there are no properties singlePanelForCurrentRow and detailEditorPanel the model update will fail. FormComponentPanels are an advanced concept and I'd recommend you extend org.apache.wicket.markup.html.panel.Panel until you really need the features of a FormComponentPanel. BTW your HomePage shouldn't keep a reference to another page (i.e. DetailPage), since Wicket serialized pages separately. Hope this helps Sven On 03/18/2013 10:23 PM, Lucio Crusca wrote: I'm trying to use CompoundPropertyModel in a form I dynamically create with a RepeatingView. I use the CompoundPropertyModel#bind method to bind each input tag to the corresponding java bean property. Binding from java bean to html does work (the fields get filled), while the other way around (onSubmit) does break... the reported error is no get method defined ... singlePanelForCurrentRow, where singlePanelForCurrentRow is the wicket:id I use to attach the repeating input tags. I don't know what to search for on Google, because searching obvious terms (CompoundPropertyModel binding and the like) yelds trivial examples, but nothing similar to my needs. Here is a quickstart demonstrating the issue, try clicking submit: http://www.virtualbit.it/download/sparsi/example.zip Thanks in advance Lucio. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Gmap3 Geocoding shows Status 610
I tried to fix it by using the json library from json.org: dependency groupIdorg.json/groupId artifactIdjson/artifactId version20090211/version /dependency I changed GeoCoder.java, GeoCoderException.java, and improved GeoCoderTest.java which run without complains. Sorry, I never committed to github or any other open source project. If you think I should do so, please give me some short instruction what I should do. Dieter Tremel The central part of Geocoder is private final String output = OUTPUT_JSON; public GLatLng decode(String response) throws GeocoderException { try { JSONObject jsonResponse = new JSONObject(response); GeocoderException.GeocoderStatus status = GeocoderException.GeocoderStatus.valueOf(jsonResponse.getString(status)); if (status != GeocoderException.GeocoderStatus.OK) { throw new GeocoderException(status); } JSONArray results = jsonResponse.getJSONArray(results); JSONObject location = results.getJSONObject(0).getJSONObject(geometry).getJSONObject(location); return new GLatLng(location.getDouble(lat), location.getDouble(lng)); } catch (JSONException ex) { Logger.getLogger(Geocoder.class.getName()).log(Level.SEVERE, null, ex); throw new GeocoderException(GeocoderException.GeocoderStatus.PARSER_ERROR); } } public String encode(final String address) { //changed since this was Google API V2, see https://developers.google.com/maps/documentation/geocoding/ //return http://maps.google.com/maps/geo?q=; + urlEncode(address) + output= + output; StringBuilder sb = new StringBuilder(http://maps.googleapis.com/maps/api/geocode/;); sb.append(output); sb.append(?); sb.append(address=).append(urlEncode(address)); sb.append(sensor=false); return sb.toString(); } Am 18.03.2013 15:27, schrieb Dieter Tremel: Am 16.03.2013 22:43, schrieb Vishal Popat: I am using GMap3 from here: https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/gmap3-parent/gmap3. My Geocoding has recently stopped working and is showing Status 610. Google searching shows that this is all related to GMap2 being deprecated etc (There maybe other reasons why I am getting a 610). However, when looking here: https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/gmap3-parent/gmap3/src/main/java/org/wicketstuff/gmap/geocoder/Geocoder.java. The encoding url looks like it is from Gmap v2 (see here: https://developers.google.com/maps/documentation/geocoding/index), which would explain the 610. Am I mistaken? Hello Vishal, I have the same problem and think you are right. Geocoder#encode in Version 6.5.0 uses an old URL and parses the return value as CSV, whereas https://developers.google.com/maps/documentation/geocoding/ only talks about JSON and XML return values. The unit test of Geocoder fails with error code 610. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: CompoundPropertyModel binding direction
In data Tuesday 19 March 2013 09:42:54, Sven Meier ha scritto: Hi Lucio, FormComponentPanels are an advanced concept and I'd recommend you extend org.apache.wicket.markup.html.panel.Panel until you really need the features of a FormComponentPanel. Thanks that solved the problem. BTW your HomePage shouldn't keep a reference to another page (i.e. DetailPage), since Wicket serialized pages separately. Well, to be honest I don't understand the full meaning of the sentence (why my design conflicts with Wicket serialization), but let's leave that to Google, I'll have a look. However I'm curious to know if a possible solution would be to create the DetailPage instance inside the onClick method of the Link, so that it becomes a local variable that gets collected asap. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: CompoundPropertyModel binding direction
However I'm curious to know if a possible solution would be to create the DetailPage instance inside the onClick method of the Link, so that it becomes a local variable that gets collected asap. Sure, that's perfectly fine. Sven On 03/19/2013 11:39 AM, Lucio Crusca wrote: In data Tuesday 19 March 2013 09:42:54, Sven Meier ha scritto: Hi Lucio, FormComponentPanels are an advanced concept and I'd recommend you extend org.apache.wicket.markup.html.panel.Panel until you really need the features of a FormComponentPanel. Thanks that solved the problem. BTW your HomePage shouldn't keep a reference to another page (i.e. DetailPage), since Wicket serialized pages separately. Well, to be honest I don't understand the full meaning of the sentence (why my design conflicts with Wicket serialization), but let's leave that to Google, I'll have a look. However I'm curious to know if a possible solution would be to create the DetailPage instance inside the onClick method of the Link, so that it becomes a local variable that gets collected asap. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Gmap3 Geocoding shows Status 610
Hi Dieter, Welcome to the Open Source community! :-) You can follow the guide at https://help.github.com/articles/fork-a-repo to send a Pull Request with your fix. If you have not time for this then please send me the changes in .patch format and I will apply them for you. On Tue, Mar 19, 2013 at 11:37 AM, Dieter Tremel tre...@tremel-computer.dewrote: I tried to fix it by using the json library from json.org: dependency groupIdorg.json/groupId artifactIdjson/artifactId version20090211/version /dependency I changed GeoCoder.java, GeoCoderException.java, and improved GeoCoderTest.java which run without complains. Sorry, I never committed to github or any other open source project. If you think I should do so, please give me some short instruction what I should do. Dieter Tremel The central part of Geocoder is private final String output = OUTPUT_JSON; public GLatLng decode(String response) throws GeocoderException { try { JSONObject jsonResponse = new JSONObject(response); GeocoderException.GeocoderStatus status = GeocoderException.GeocoderStatus.valueOf(jsonResponse.getString(status)); if (status != GeocoderException.GeocoderStatus.OK) { throw new GeocoderException(status); } JSONArray results = jsonResponse.getJSONArray(results); JSONObject location = results.getJSONObject(0).getJSONObject(geometry).getJSONObject(location); return new GLatLng(location.getDouble(lat), location.getDouble(lng)); } catch (JSONException ex) { Logger.getLogger(Geocoder.class.getName()).log(Level.SEVERE, null, ex); throw new GeocoderException(GeocoderException.GeocoderStatus.PARSER_ERROR); } } public String encode(final String address) { //changed since this was Google API V2, see https://developers.google.com/maps/documentation/geocoding/ //return http://maps.google.com/maps/geo?q=; + urlEncode(address) + output= + output; StringBuilder sb = new StringBuilder(http://maps.googleapis.com/maps/api/geocode/;); sb.append(output); sb.append(?); sb.append(address=).append(urlEncode(address)); sb.append(sensor=false); return sb.toString(); } Am 18.03.2013 15:27, schrieb Dieter Tremel: Am 16.03.2013 22:43, schrieb Vishal Popat: I am using GMap3 from here: https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/gmap3-parent/gmap3. My Geocoding has recently stopped working and is showing Status 610. Google searching shows that this is all related to GMap2 being deprecated etc (There maybe other reasons why I am getting a 610). However, when looking here: https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/gmap3-parent/gmap3/src/main/java/org/wicketstuff/gmap/geocoder/Geocoder.java. The encoding url looks like it is from Gmap v2 (see here: https://developers.google.com/maps/documentation/geocoding/index), which would explain the 610. Am I mistaken? Hello Vishal, I have the same problem and think you are right. Geocoder#encode in Version 6.5.0 uses an old URL and parses the return value as CSV, whereas https://developers.google.com/maps/documentation/geocoding/ only talks about JSON and XML return values. The unit test of Geocoder fails with error code 610. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Prioritize header items in html templates
Hi, I think this is not possible. wicket:head is just a convenience. The full power is in the Java based header contributors. On Tue, Mar 19, 2013 at 2:42 PM, Pointbreak pointbreak+wicketst...@ml1.netwrote: Is there a way (in Wicket 6) to prioritize items in wicket:head/head elements to get them inside the head of the final page before all code contributed header items? I.e. something like PriorityHeaderItem, but applied to the markup of an item in the wicket:head of a template? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Prioritize header items in html templates
The Java based header contributions are for css, and javascript mostly. Is there a practical way to get title, meta, and other 'special' tags appear before contributed headeritems in the head then? On Tue, Mar 19, 2013, at 13:48, Martin Grigorov wrote: Hi, I think this is not possible. wicket:head is just a convenience. The full power is in the Java based header contributors. On Tue, Mar 19, 2013 at 2:42 PM, Pointbreak pointbreak+wicketst...@ml1.netwrote: Is there a way (in Wicket 6) to prioritize items in wicket:head/head elements to get them inside the head of the final page before all code contributed header items? I.e. something like PriorityHeaderItem, but applied to the markup of an item in the wicket:head of a template? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Prioritize header items in html templates
You can use StringHeaderItem.forString(meta ...) and wrap it in PriotityHeaderItem/FilterHeaderItem if needed. On Tue, Mar 19, 2013 at 3:03 PM, Pointbreak pointbreak+wicketst...@ml1.netwrote: The Java based header contributions are for css, and javascript mostly. Is there a practical way to get title, meta, and other 'special' tags appear before contributed headeritems in the head then? On Tue, Mar 19, 2013, at 13:48, Martin Grigorov wrote: Hi, I think this is not possible. wicket:head is just a convenience. The full power is in the Java based header contributors. On Tue, Mar 19, 2013 at 2:42 PM, Pointbreak pointbreak+wicketst...@ml1.netwrote: Is there a way (in Wicket 6) to prioritize items in wicket:head/head elements to get them inside the head of the final page before all code contributed header items? I.e. something like PriorityHeaderItem, but applied to the markup of an item in the wicket:head of a template? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
[wicketstuff-gmap3] bug in the info. window close behavior
Hi, Calling the *GInfoWindow.isOpen()* always returns true despite of being closed. Cheers, Daku
Re: [wicketstuff-gmap3] bug in the info. window close behavior
Hi, Please create a Pull Request with the improvement. Thanks! On Tue, Mar 19, 2013 at 4:20 PM, lambdad...@gmail.com lambdad...@googlemail.com wrote: Hi, Calling the *GInfoWindow.isOpen()* always returns true despite of being closed. Cheers, Daku -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Gmap3 Geocoding shows Status 610
Am 19.03.2013 13:25, schrieb Martin Grigorov: Welcome to the Open Source community! :-) You can follow the guide at https://help.github.com/articles/fork-a-repo to send a Pull Request with your fix. If you have not time for this then please send me the changes in .patch format and I will apply them for you. Hi Martin, After some drops of sweat I succeeded in https://github.com/wicketstuff/core/pull/203 Hope I did it all well. Would be glad if my changes are accepted and I can contribute. By the way, this is a great community here in this list, I am often surprised how fast and well the users get help. Thank to all for it. Dieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Gmap3 Geocoding shows Status 610
On Tue, Mar 19, 2013 at 5:09 PM, Dieter Tremel tre...@tremel-computer.dewrote: Am 19.03.2013 13:25, schrieb Martin Grigorov: Welcome to the Open Source community! :-) You can follow the guide at https://help.github.com/articles/fork-a-repoto send a Pull Request with your fix. If you have not time for this then please send me the changes in .patch format and I will apply them for you. Hi Martin, After some drops of sweat I succeeded in https://github.com/wicketstuff/core/pull/203 Hope I did it all well. Would be glad if my changes are accepted and I can contribute. By the way, this is a great community here in this list, I am often surprised how fast and well the users get help. Thank to all for it. Your PR is merged! Thank you! Dieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
TableTree#addTopToolbar(AbstractToolbar abstractToolbar)
Hi TableTree has been moved to wicket-core now and both addTopToolbar(AbstractToolbar abstractToolbar) and addBottomToolbar(AbstractToolbar abstractToolbar) has been removed from TableTree in Wicket-tree. I was wondering what method can be used instead to add an AbstractToolbar to the tree? Many thanks Ramin -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/TableTree-addTopToolbar-AbstractToolbar-abstractToolbar-tp4657354.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketObjects - Could not resolve class [images]
Ok, I have resolved it by passing a correct icon path to the GIcon constructor, that is /images/marker_red.png On Tue, Mar 19, 2013 at 6:11 PM, lambdad...@gmail.com lambdad...@googlemail.com wrote: Hi, I have a page which shows two panels, containing a simple panel with some text on it on the left hand side while gmap3 on the right hand side. Both the panels are occupy 50% of the page. As soon as I open that page, it clearly shows the text panel, however the expected markers are simply not there and map is fully zoomed out. Furthermore, the exception (see below) can be seen on the server side. This is how I initialize the markers' icons GIcon ico = new GIcon(images/marker_green.png).setSize( new GSize(20, 34)).setAnchor(new GPoint(9, 34)); Surprising if the given map is shown under different page, it shows everything as expected. 2013-03-19 17:52:33,614 86 [810158789@qtp-177506381-1] WARN WicketObjects - Could not resolve class [images] java.lang.ClassNotFoundException: images at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:401) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.apache.wicket.application.AbstractClassResolver.resolveClass(AbstractClassResolver.java:108) at org.apache.wicket.core.util.lang.WicketObjects.resolveClass(WicketObjects.java:72) at org.apache.wicket.core.request.mapper.AbstractComponentMapper.getPageClass(AbstractComponentMapper.java:139) at org.apache.wicket.core.request.mapper.BookmarkableMapper.parseRequest(BookmarkableMapper.java:110) at org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.mapRequest(AbstractBookmarkableMapper.java:282) at org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:152) at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:183) at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:208) at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:282) at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:244) at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:267) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) Thanks, Lambda
Re: Prioritize header items in html templates
Hi, On Tue, Mar 19, 2013 at 2:07 PM, Martin Grigorov mgrigo...@apache.org wrote: You can use StringHeaderItem.forString(meta ...) and wrap it in PriotityHeaderItem/FilterHeaderItem if needed. We had the same question. Starting with Wicket 6, title and so on are lost in the resources lines. It was quite nice to have them on top of the head and the resources at the bottom of the head, especially when a customer starts to look at the HTML produced. I'm not sure having all these tags in the Java code is a good solution for this issue. It's mostly cosmetic so it's probably not worth spending too much time on this but if there is an easy solution for this issue, it might be worth it. -- Guillaume - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: TableTree#addTopToolbar(AbstractToolbar abstractToolbar)
tableTree.getTable().add*Toolbar() Sven On 03/19/2013 05:09 PM, Ramin wrote: Hi TableTree has been moved to wicket-core now and both addTopToolbar(AbstractToolbar abstractToolbar) and addBottomToolbar(AbstractToolbar abstractToolbar) has been removed from TableTree in Wicket-tree. I was wondering what method can be used instead to add an AbstractToolbar to the tree? Many thanks Ramin -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/TableTree-addTopToolbar-AbstractToolbar-abstractToolbar-tp4657354.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: bind the treenode with the object
Hi David, it's not clear to me where you need help here. Sven On 03/19/2013 07:35 PM, david.li wrote: hello. I use the wicket tree component in my project.I bind the tree node with the modelbean class。I wang the treenode display the modelbean value and get the treenode key via the nodeclick event. Can anyone offer a solution for that? - david -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/bind-the-treenode-with-the-object-tp4657359.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Prioritize header items in html templates
Actually I think it is possible to have them on the top. All entries from wicket:head are handled by PageHeaderItem at runtime. So you can use custom FilteringHeaderResponse that lifts PageHeaderItem to PriorityHeaderItem. On Tue, Mar 19, 2013 at 7:42 PM, Guillaume Smet guillaume.s...@gmail.comwrote: Hi, On Tue, Mar 19, 2013 at 2:07 PM, Martin Grigorov mgrigo...@apache.org wrote: You can use StringHeaderItem.forString(meta ...) and wrap it in PriotityHeaderItem/FilterHeaderItem if needed. We had the same question. Starting with Wicket 6, title and so on are lost in the resources lines. It was quite nice to have them on top of the head and the resources at the bottom of the head, especially when a customer starts to look at the HTML produced. I'm not sure having all these tags in the Java code is a good solution for this issue. It's mostly cosmetic so it's probably not worth spending too much time on this but if there is an easy solution for this issue, it might be worth it. -- Guillaume - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: Serialization of DAO
How does wicket know which module to inject? ___ Stephen Walsh | http://connectwithawalsh.com On Sun, Mar 17, 2013 at 12:59 PM, Dan Retzlaff dretzl...@gmail.com wrote: Wicket only injects Components and Behaviors by default. To inject into anything else, call Injector.get().inject(this) in its constructor. On Fri, Mar 15, 2013 at 2:27 PM, Stephen Walsh step...@connectwithawalsh.com wrote: I have a much better understanding on this now. Are there any plans to support injection on LDMs, or is there a suggested work around for this? It seems like you'd want a DAO service to get an object from the DB within a custom model so you can return that back to your component. ___ Stephen Walsh | http://connectwithawalsh.com On Thu, Mar 14, 2013 at 5:03 PM, Martin Grigorov mgrigo...@apache.org wrote: Take a look at wicket-examples and the unit tests in wicket-guice module. On Thu, Mar 14, 2013 at 10:53 PM, Stephen Walsh step...@connectwithawalsh.com wrote: Any other thoughts on this? ___ Stephen Walsh | http://connectwithawalsh.com On Thu, Mar 14, 2013 at 10:30 AM, Stephen Walsh step...@connectwithawalsh.com wrote: Thanks, Martin. I intialize here, (which I just realized is not the best spot): private void setUpMongo() { mongo = MongoUtil.getMongo(); morphia = new Morphia().map(Blog.class).map(Person.class); blogDAO = new BlogDAO(mongo, morphia); } I am using the Wicket Guice module, and I think your second point is what I was getting at. From learning about Guice ( http://www.youtube.com/watch?feature=player_embeddedv=hBVJbzAagfs ), I thought the point was to initialize once and then reuse wherever needed. I figured initialization would happen in the application class. Maybe I'm misunderstanding. If it's supposed to happen in the application class, then I don't really have need for a module because I don't have an interface in this case, right? Thanks for the help on this. ___ Stephen Walsh | http://connectwithawalsh.com On Thu, Mar 14, 2013 at 3:20 AM, Martin Grigorov mgrigo...@apache.org wrote: Hi, I don't see how you initialize blogDAO. If you don't use wicket-ioc module then you will need to lookup the DAO from the application whenever you need it: public void onSubmit() { BlogDAO blogDao = MyApplication.get().getBlogDAO(); blogDao.save(blog); } This way you wont keep reference to it in the page/component and it wont be serialized. If you use wicket-guice module then you can do: @Inject private BlogDAO blogDao; and use it anywhere. Wicket will use Guice to lookup the bean at component creation but the bean will be wrapped in a serializable proxy. That is a lightweight proxy will be (de)serialized with the page. This is the recommended way. wicket-string works the same way. wicket-cdi leaves the proxy creation to the CDI implementation. On Thu, Mar 14, 2013 at 5:19 AM, Stephen Walsh step...@connectwithawalsh.com wrote: I'm attempting to implement Guice for my DAO connections as my JBoss server keeps running out of memory. Not entirely sure why that is, but I'm hoping this is at least part of it. I read through http://markmail.org/message/sz64l4eytzc3ctkh and understand why the DAO needs to be serialized, and I also followed https://cwiki.apache.org/confluence/display/WICKET/Wicket%2C+Guice+and+Ibatis+exampleto try and figure out where and how exactly to inject my DAO. My DAO already extends a basic DAO class that has all of the basics for getting stuff from the database. Neither of these are interfaces (not sure if this is a problem or not). My DAO works just fine in panels, but as soon as it's on a page, it throws the not seralizable exception. Regardless it doesn't really solve the problem of really only needing one DAO for the whole application instead of creating one whenever it's needed in every place that it's needed. If I understand dependency injection, then this is the whole point. Here's my class. Hopefully someone can point me in the right direction for this page and my application class: public class EditBlogEntry extends BasePage { private Logger logger = LoggerFactory.getLogger(EditBlogEntry.class); private Mongo mongo;