listview produce duplicate value.
Hi My listview is printing duplicate valueswhy?? I found that my get method is working well. just printing result is incorrect??? is it a bug?? -- View this message in context: http://www.nabble.com/listview-produce-duplicate-value.-tp20136280p20136280.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: go back problem
Hi I dont know whether this question is too easy or hard??? Since I'm a newbie of wicket, I dont know whether there are built-in functions for the Back link like the browsers do. Could anyone give me, at least, some ideas?? I'm still trapped by this possibly fish quesion.Thanks a lot for any help. overseastars wrote: Hi all I'm learning to use the library example on the wicket website. But I found that once I got some results by search and I clicked one link to go into that detail page, then I actually could go back to the previous page. The example on the wicket website just provides a link to home, not a real Back link. For example, I'm searching some hotels. I input a keyword in the search bar and then get a list of accommodations. Then I click on one record and I get a list of rooms of that accommodation. Now if I click on one room it will go to the detail page of that room. What if I want to go back to the previous page containing a list of rooms? Furthermore, what if I want to go back to that page including a list of accommodation?? I just put a small piece of my code here. this is the method from the wicket example page. How can I make a back link? I really need this. otherwise my mentor will kill my marks..:-( Please help me. Many thanks~~ public static BookmarkablePageLink link(final String name, final Accommodation accommodation) { clickedAccommodation = accommodation; final BookmarkablePageLink link = new BookmarkablePageLink(name, RoomResultListPage.class); if (accommodation != null) { link.setParameter(aid, accommodation.getAid()); link.add(new Label(name, new Model(accommodation.getName(; } else { link.add(new Label(name, No matched rooms - xingxing)); link.setEnabled(false); } return link; } -- View this message in context: http://www.nabble.com/%22go-back%22-problem-tp20057504p20104879.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: where is wicket-contrib-gmap3 1.3.4
Sorry I got some of my words missing. I mean the latest wicket-contrib-gmap2-1.4 is not compatible with wicket-1.3.4. So the only way is to checkout the svn and DIY that jar file??? overseastars wrote: Hi I'm using wicket 1.3.4 which is not compatible with wicket-contrib-gmap2 Could anyone please tell me where i can find that jar file -- View this message in context: http://www.nabble.com/where-is-wicket-contrib-gmap3-1.3.4-tp20063260p20063753.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: where is wicket-contrib-gmap3 1.3.4
Thanks for replying Martin Funk-3 wrote: 2008/10/20 overseastars [EMAIL PROTECTED] Sorry I got some of my words missing. I mean the latest wicket-contrib-gmap2-1.4 is not compatible with wicket-1.3.4. So the only way is to checkout the svn and DIY that jar file??? If you wan't to stay 'on the edge' you can check out trunk, modify the dependency to wicket in the build.xml to the version you need and let the compiler guide you to the places that need to be patched. It's only a couple of places were the use of generics needs to be droped. Sorry for the inconveniance. mf overseastars wrote: Hi I'm using wicket 1.3.4 which is not compatible with wicket-contrib-gmap2 Could anyone please tell me where i can find that jar file -- View this message in context: http://www.nabble.com/where-is-wicket-contrib-gmap3-1.3.4-tp20063260p20063753.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/where-is-wicket-contrib-gmap3-1.3.4-tp20063260p20074366.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket war file has problems with tomcat
Hi igor I dont know how to fix this. I already copyied all jar files under WEB-INF to tomcat6's lib folder. igor.vaynberg wrote: looks like you are missing slf4j jars in your war? -igor On Mon, Oct 20, 2008 at 10:18 AM, overseastars [EMAIL PROTECTED] wrote: Hi all I dont know why but my war file cannot run on tomcat6. Could anyone show me a way to fix the problem? I just checked the log under tomcat. it gave me the following. I actually already copy all jar files under the WEB-INF/lib to the lib folder under tomcat home. Something else needed? I've no idea. Thanks in advance.. 21/10/2008 04:01:53 org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter WicketFilter java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.wicket.jmx.Initializer.clinit(Initializer.java:55) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at java.lang.Class.newInstance0(Class.java:350) at java.lang.Class.newInstance(Class.java:303) at org.apache.wicket.util.lang.Objects.newInstance(Objects.java:1011) at org.apache.wicket.Application.addInitializer(Application.java:755) at org.apache.wicket.Application.load(Application.java:829) at org.apache.wicket.Application.initializeComponents(Application.java:608) at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:567) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) 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:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 21/10/2008 04:01:54 org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() 21/10/2008 04:01:54 org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() 21/10/2008 04:03:56 org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextDestroyed() 21/10/2008 04:03:56 org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextDestroyed() 21/10/2008 04:04:06 org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter WicketFilter java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.wicket.jmx.Initializer.clinit(Initializer.java:55) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39
go back problem
Hi all I'm learning to use the library example on the wicket website. But I found that once I got some results by search and I clicked one link to go into that detail page, then I actually could go back to the previous page. The example on the wicket website just provides a link to home, not a real Back link. For example, I'm searching some hotels. I input a keyword in the search bar and then get a list of accommodations. Then I click on one record and I get a list of rooms of that accommodation. Now if I click on one room it will go to the detail page of that room. What if I want to go back to the previous page containing a list of rooms? Furthermore, what if I want to go back to that page including a list of accommodation?? I just put a small piece of my code here. this is the method from the wicket example page. How can I make a back link? I really need this. otherwise my mentor will kill my marks..:-( Please help me. Many thanks~~ public static BookmarkablePageLink link(final String name, final Accommodation accommodation) { clickedAccommodation = accommodation; final BookmarkablePageLink link = new BookmarkablePageLink(name, RoomResultListPage.class); if (accommodation != null) { link.setParameter(aid, accommodation.getAid()); link.add(new Label(name, new Model(accommodation.getName(; } else { link.add(new Label(name, No matched rooms - xingxing)); link.setEnabled(false); } return link; } -- View this message in context: http://www.nabble.com/%22go-back%22-problem-tp20057504p20057504.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
where is wicket-contrib-gmap3 1.3.4
Hi I'm using wicket 1.3.4 which is not compatible with wicket-contrib-gmap2 Could anyone please tell me where i can find that jar file -- View this message in context: http://www.nabble.com/where-is-wicket-contrib-gmap3-1.3.4-tp20063260p20063260.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AjaxFormComponentUpdatingBehavior problem
Any idea???I'm trapped by this problem..and no idea. overseastars wrote: Hi all I'm having problems with using AjaxFormComponentUpdatingBehavior. I'd like to make to ListChoices which contain a list of countries and cities. For example, if I select one item in the first ListChoice and the second ListChoice should display the related cities. Since I dont know how to get some lists of cities, I just arbitrarily pick up one list to use. the following is part of my code. My case is that it actually works when the frontpage is opened at the first time. However, after the first click, the second doesnt work and that getModelObjectAsString gives me null value. And if I refresh the page, two lists both become empty. Could someone please help me out?? Thanks in advance. BTW, I also wanna know how to get some lists of cities. :-DMany thanks.. private String countries; private String countries1; private ListChoice countryListChoice; private ListChoice countryListChoice1; private ListString tl; private ListString testlist; public SearchForm(String id) { super(id); setModel(new CompoundPropertyModel()); tl = CountryListChoice.getCOUNTRIES(); testlist = CountryListChoice.getCOUNTRIES(); setOutputMarkupId(true); CountryListChoice clc = new CountryListChoice(); countryListChoice = new ListChoice(countries, new PropertyModel(this, countries), tl, clc.getRenderer()); countryListChoice.setOutputMarkupId(true); add(countryListChoice); CountryListChoice clc1 = new CountryListChoice(); countryListChoice1 = new ListChoice(countries1, new PropertyModel(this, countries1), testlist, clc.getRenderer()); countryListChoice1.setOutputMarkupId(true); add(countryListChoice1); countryListChoice.add(new MyAjaxFormComponentUpdatingBehavior(onChange){ /* (non-Javadoc) * @see com.smartbooking.wicket.component.MyAjaxFormComponentUpdatingBehavior#onUpdate(org.apache.wicket.ajax.AjaxRequestTarget) */ @Override protected void onUpdate(AjaxRequestTarget target) { // TODO Auto-generated method stub if(countryListChoice.getModelObject() != null){ testlist.clear(); String c = countryListChoice.getModelObjectAsString(); System.out.println(\n\nour c : + c + \n\n); testlist.add(c); }else{ testlist.clear(); testlist.add(xing said null); System.out.println(\n\n really null!!! \n\n); } target.addComponent(countryListChoice1); }}); } /** * @return the countries */ public String getCountries() { return countries; } /** * @param countries the countries to set */ public void setCountries(String countries) { this.countries = countries; } /** * @return the countries1 */ public String getCountries1() { return countries1; } /** * @param countries1 the countries1 to set */ public void setCountries1(String countries1) { this.countries1 = countries1; } -- View this message in context: http://www.nabble.com/AjaxFormComponentUpdatingBehavior-problem-tp20032008p20045781.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AjaxFormComponentUpdatingBehavior problem
Ah..thanks a lotAlthoug I google it, I didnt find that. But I think my code contains just this and others are not relevant. igor.vaynberg wrote: first, you did not show all your code. second, there is too much code to read through in an email and figure out whats wrong, create a quickstart project. third, there is already an example that shows how to do this properly: http://www.wicketstuff.org/wicket13/ajax/choice -igor On Sat, Oct 18, 2008 at 3:32 AM, overseastars [EMAIL PROTECTED] wrote: Any idea???I'm trapped by this problem..and no idea. overseastars wrote: Hi all I'm having problems with using AjaxFormComponentUpdatingBehavior. I'd like to make to ListChoices which contain a list of countries and cities. For example, if I select one item in the first ListChoice and the second ListChoice should display the related cities. Since I dont know how to get some lists of cities, I just arbitrarily pick up one list to use. the following is part of my code. My case is that it actually works when the frontpage is opened at the first time. However, after the first click, the second doesnt work and that getModelObjectAsString gives me null value. And if I refresh the page, two lists both become empty. Could someone please help me out?? Thanks in advance. BTW, I also wanna know how to get some lists of cities. :-DMany thanks.. private String countries; private String countries1; private ListChoice countryListChoice; private ListChoice countryListChoice1; private ListString tl; private ListString testlist; public SearchForm(String id) { super(id); setModel(new CompoundPropertyModel()); tl = CountryListChoice.getCOUNTRIES(); testlist = CountryListChoice.getCOUNTRIES(); setOutputMarkupId(true); CountryListChoice clc = new CountryListChoice(); countryListChoice = new ListChoice(countries, new PropertyModel(this, countries), tl, clc.getRenderer()); countryListChoice.setOutputMarkupId(true); add(countryListChoice); CountryListChoice clc1 = new CountryListChoice(); countryListChoice1 = new ListChoice(countries1, new PropertyModel(this, countries1), testlist, clc.getRenderer()); countryListChoice1.setOutputMarkupId(true); add(countryListChoice1); countryListChoice.add(new MyAjaxFormComponentUpdatingBehavior(onChange){ /* (non-Javadoc) * @see com.smartbooking.wicket.component.MyAjaxFormComponentUpdatingBehavior#onUpdate(org.apache.wicket.ajax.AjaxRequestTarget) */ @Override protected void onUpdate(AjaxRequestTarget target) { // TODO Auto-generated method stub if(countryListChoice.getModelObject() != null){ testlist.clear(); String c = countryListChoice.getModelObjectAsString(); System.out.println(\n\nour c : + c + \n\n); testlist.add(c); }else{ testlist.clear(); testlist.add(xing said null); System.out.println(\n\n really null!!! \n\n); } target.addComponent(countryListChoice1); }}); } /** * @return the countries */ public String getCountries() { return countries; } /** * @param countries the countries to set */ public void setCountries(String countries) { this.countries = countries; } /** * @return the countries1 */ public String getCountries1() { return countries1; } /** * @param countries1 the countries1 to set */ public void setCountries1(String countries1) { this.countries1 = countries1; } -- View this message in context: http://www.nabble.com/AjaxFormComponentUpdatingBehavior-problem-tp20032008p20045781.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/AjaxFormComponentUpdatingBehavior
Re: question on PageableLiveView
Thanks for replying. I think that is the display trick because that is a html link tag the wicket id of which is room_type. I dont know how but it work when I redo it. -- View this message in context: http://www.nabble.com/question-on-PageableLiveView-tp20011877p20031865.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AjaxFormComponentUpdatingBehavior problem
Hi all I'm having problems with using AjaxFormComponentUpdatingBehavior. I'd like to make to ListChoices which contain a list of countries and cities. For example, if I select one item in the first ListChoice and the second ListChoice should display the related cities. Since I dont know how to get some lists of cities, I just arbitrarily pick up one list to use. the following is part of my code. My case is that it actually works when the frontpage is opened at the first time. However, after the first click, the second doesnt work and that getModelObjectAsString gives me null value. Could someone please help me out?? Thanks in advance. BTW, I also wanna know how to get some lists of cities. :-DMany thanks.. private String countries; private String countries1; private ListChoice countryListChoice; private ListChoice countryListChoice1; private ListString tl; private ListString testlist; public SearchForm(String id) { super(id); setModel(new CompoundPropertyModel()); tl = CountryListChoice.getCOUNTRIES(); testlist = CountryListChoice.getCOUNTRIES(); setOutputMarkupId(true); CountryListChoice clc = new CountryListChoice(); countryListChoice = new ListChoice(countries, new PropertyModel(this, countries), tl, clc.getRenderer()); countryListChoice.setOutputMarkupId(true); add(countryListChoice); CountryListChoice clc1 = new CountryListChoice(); countryListChoice1 = new ListChoice(countries1, new PropertyModel(this, countries1), testlist, clc.getRenderer()); countryListChoice1.setOutputMarkupId(true); add(countryListChoice1); countryListChoice.add(new MyAjaxFormComponentUpdatingBehavior(onChange){ /* (non-Javadoc) * @see com.smartbooking.wicket.component.MyAjaxFormComponentUpdatingBehavior#onUpdate(org.apache.wicket.ajax.AjaxRequestTarget) */ @Override protected void onUpdate(AjaxRequestTarget target) { // TODO Auto-generated method stub if(countryListChoice.getModelObject() != null){ testlist.clear(); String c = countryListChoice.getModelObjectAsString(); System.out.println(\n\nour c : + c + \n\n); testlist.add(c); }else{ testlist.clear(); testlist.add(xing said null); System.out.println(\n\n really null!!! \n\n); } target.addComponent(countryListChoice1); }}); } /** * @return the countries */ public String getCountries() { return countries; } /** * @param countries the countries to set */ public void setCountries(String countries) { this.countries = countries; } /** * @return the countries1 */ public String getCountries1() { return countries1; } /** * @param countries1 the countries1 to set */ public void setCountries1(String countries1) { this.countries1 = countries1; } -- View this message in context: http://www.nabble.com/AjaxFormComponentUpdatingBehavior-problem-tp20032008p20032008.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat doesnt work with wicket
I dont know exactly the problem. But I went to the logs folder under tomcat home folder and find nothing there. no files.actually. also according to the console on eclipse, I think it doesnt start the wicket development model at all. overseastars wrote: Hi all I have this strange problem now. If i use jetty, everything is find. But if I wanna run wicket application on tomcat in eclipse, it doesnt work. Any ideas to solve this? Do I need to do sth with tomcat??? I'm a newbie. So is the question.. -- View this message in context: http://www.nabble.com/tomcat-doesnt-work-with-wicket-tp20032073p20032357.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
question on PageableLiveView
Hi all Here's just newbie's quesion on using PageableListView. I'm trying to use PageableLiveView in my project. But it doesnt work. The following is the error I got. As I can see, I do have that room_type component in the html file. It just doesnt work. Since I dont understand how PageableListView works, I just mimic the library example on the wicket website. Now I need this to show my search result and I dont know any other ways to make pageable list. This is quite urgent to me. I need it to finish my assignment. Could any buddy please help me out Many thanks.. === WicketMessage: The component(s) below failed to render. A common problem is that you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered). 1. [Component id = room_type, page = com.smartbooking.wicket.page.RoomResultListPage, path = 1:rooms:0:description:room_type.Label, isVisible = true, isVersioned = true] 2. [Component id = room_type, page = com.smartbooking.wicket.page.RoomResultListPage, path = 1:rooms:1:description:room_type.Label, isVisible = true, isVersioned = true] Root cause: org.apache.wicket.WicketRuntimeException: The component(s) below failed to render. A common problem is that you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered). 1. [Component id = room_type, page = com.smartbooking.wicket.page.RoomResultListPage, path = 1:rooms:0:description:room_type.Label, isVisible = true, isVersioned = true] 2. [Component id = room_type, page = com.smartbooking.wicket.page.RoomResultListPage, path = 1:rooms:1:description:room_type.Label, isVisible = true, isVersioned = true] at org.apache.wicket.Page.checkRendering(Page.java:1115) ... Code: ** public class RoomResultListPage extends WebPage { public RoomResultListPage(final PageParameters parameters) { final PageableListView listView; add(listView = new MyPageableListView(rooms, new PropertyModel(this, rooms), 2){ @Override protected void populateItem(final ListItem listitem) { final Room room = (Room)listitem.getModelObject(); listitem.add(RoomDetails.link(details, room)); listitem.add(RoomDetails.link(description, room)); } }); add(new PagingNavigator(navigator, listView)); } public List getRooms() { List sample = new ArrayList(); Room room1 = new Room(); room1.setRid(1L); room1.setRoom_type(single); room1.setDescription(test1); Room room2 = new Room(); room2.setRid(2L); room2.setRoom_type(double); room2.setDescription(test2); Room room3 = new Room(); room3.setRid(3L); room3.setRoom_type(xing); room3.setDescription(test3); sample.add(room1); sample.add(room2); sample.add(room3); return sample; } } *** public final class RoomDetails extends WebPage { public RoomDetails(final PageParameters pp){ } public RoomDetails(final Room room) { // TODO Auto-generated constructor stub add(new Label(room_type, room.getRoom_type())); add(new Label(description, room.getDescription())); } public static BookmarkablePageLink link(final String name, final Room room) { final BookmarkablePageLink link = new BookmarkablePageLink(name, RoomDetails.class); if (room != null) { link.setParameter(rid, room.getRid()); link.add(new Label(room_type, new Model(room))); } else { link.add(new Label(room_type, No matched room type)); link.setEnabled(false); } return link; } } ** table width = 100% tr thRoom Type/th thDescription/th /tr tr wicket:id=rooms td # Huckleberry Finn /td td Mark Twain /td /tr
About helloworld
Hi All I dont believe even a helloworld in wicket is so hard. I just simply created a new dynamic web project in eclipse and add that wicket1.3.4 jar file into the build path. Then I follow the helloworld sample and copy all three files into the project, like two java and one html file into the source and changed the web.xml. finally i got nothing but a http404 error. Can anyone give a really useful tutorial ? all I need is just a helloworld now, with wicket 1.3.4...Thanks a lot. -- View this message in context: http://www.nabble.com/About-helloworld-tp19766150p19766150.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
wicket and hibernate
Hi I just wanna know how to integrate wicket and hibernate?? can someone give me a simple example even just one entity is ok. I have my entities(hibernate annotation) ready and I have no ideas of making them work together. If any buddy can send me an example project, I will really appreciate it. Thanks in advance. Regards -- View this message in context: http://www.nabble.com/wicket-and-hibernate-tp19767474p19767474.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: About helloworld
Thanks Jeremy. thanks for your recommendations. Since they didnt show exactly how to setup their *special* environment, all three tutorials are not really helpful to make a small helloworld wicket run in eclipse as a dynamic web project..I actually failed many times even if I followed exactly what they say. Anyway, I figured this out by myself. But I still wanna say thank you. Jeremy Thomerson-5 wrote: I would recommend starting with one of these locations: QuickStart (creates your project and everything needed for a Hello World with Maven): http://wicket.apache.org/quickstart.html Wicket in Action (a must-have resource if you're going to do Wicket programming): http://manning.com/dashorst Hello World instructions: http://wicket.apache.org/examplehelloworld.html -- Jeremy Thomerson http://www.wickettraining.com On Wed, Oct 1, 2008 at 1:10 PM, overseastars [EMAIL PROTECTED] wrote: Hi All I dont believe even a helloworld in wicket is so hard. I just simply created a new dynamic web project in eclipse and add that wicket1.3.4 jar file into the build path. Then I follow the helloworld sample and copy all three files into the project, like two java and one html file into the source and changed the web.xml. finally i got nothing but a http404 error. Can anyone give a really useful tutorial ? all I need is just a helloworld now, with wicket 1.3.4...Thanks a lot. -- View this message in context: http://www.nabble.com/About-helloworld-tp19766150p19766150.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/About-helloworld-tp19766150p19767595.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket and hibernate
Hi Flavius Very impressive. Many thanks. I learnt a lot. But I still have a question. For example, I know I should use Dao to access the persistence layer. Let's say I have 2 entities which means two classes in java. I put them in the source folder. Once I start the server, I guess they wont help me create the schema and tables because there should be a config file hibernate.cfg.xml. Now I dont have that file, I have a HibernateUtil.java which contains codes like following: public static void main(String[] args) { // TODO Auto-generated method stub // Configuration config = new Configuration().configure(); AnnotationConfiguration config = new AnnotationConfiguration(); config.addAnnotatedClass(com.xingxing.autotable.User.class); config.addAnnotatedClass(com.xingxing.autotable.Address.class); config.addAnnotatedClass(com.xingxing.autotable.Person.class); config.addAnnotatedClass(com.xingxing.autotable.CreditCard.class); config.setProperty(hibernate.show_sql, true); config.setProperty(hibernate.format_sql, true); config.setProperty(hibernate.dialect, org.hibernate.dialect.MySQLDialect); config.setProperty(hibernate.connection.driver_class, com.mysql.jdbc.Driver); // config.setProperty(hibernate.connection.createDataBaseIfNotExist, true); config.setProperty(hibernate.connection.url, jdbc:mysql://localhost/test?createDatabaseIfNotExist=true); config.setProperty(hibernate.connection.autocommit, true); config.setProperty(hibernate.connection.username, root); config.setProperty(hibernate.connection.password, passw0rd); config.setProperty(c3p0.min_size, 5); config.setProperty(c3p0.max_size, 20); config.setProperty(c3p0.timeout, 1800); config.setProperty(c3p0.max_statements, 50); config.setProperty(hibernate.hbm2dll.auto, create); System.out.println(Creating Tables.); SchemaExport schemaExport = new SchemaExport(config); schemaExport.create(true, true); } How can I just this code to run my Eclipse Dynamic Web Project so that it will create the schema and tables I need more java files?? Or I have to use hibernate.cfg.xml file ?? Even if the above is not a Main function, I guess I have to call this part from somewhere in wicket layer? Would you please show me a way.. Regards Flavius wrote: Here's how I do it. I have my wicket layer call a service layer, which calls a DAO. I'm not a big fan of a lot of layers and I like to keep my projects flat. So, if you want a list of users on a page, for example, you can use any of the canned wicket tables. Those are pretty nice. I use DefaultDataTable unless I need something special. So in your page class you do something like DefaultDataTable defaultDataTable = new DefaultDataTable(table, columnsList, new SortableUserDataProvider(userFilter), 10); If this doesn't make sense look at the DefaultDataTable.java class in the wicket examples. In my SortableUserDataProvider, I pass in a filter obj depending on what the user is asking for. This includes any search criteria, sort options, paging, etc. My SortableUserDataProvider calls my service. That preps the hibernate query and calls my dao. So for the SortableUserDataProvider you want to override the iterator() method, something like: public IteratorUser iterator(int first, int count) { SortParam sp = getSort(); userFilter.setFirstRecord(first); userFilter.setRecordsToReturn(count); userFilter.setSortCol(sp.getProperty()); userFilter.setSortAsc(sp.isAscending()); return UserService.getUsers(userFilter).iterator(); } I prep my queries in my service layer. So something like Criteria userCriteria = session.createCriteria(User.class) .setFirstResult(filter.getFirstRecord()) //other filter info here as needed ListUser userList = userCriteria.list(); Hibernate returns models and lists of models, and wicket uses models and lists of models. The only catch with this is your web layer is getting hibernate aware models, not POJOs. So if it's a closed system where nobody else hits your hibernate code, you're fine. If the service layer is an SOA type arch, you'll need to convert your hibernate models (or the list), to equivalent pojos on select and vice-versa on saves. The only thing I did which I regret was I defined my collections in hibernate as Lists instead of sets. I did this because wicket takes a list as a param in a lot of places and Lists are generally easier to work with. But