At a recent project we used the following tools & frameworks:
- Java JDK 6
- Wicket 1.4.8
- Spring 2.5
- Hibernate 3.2.5
- Mod4J 1.2.1
- Tomcat 6
- Oracle XE 10g
- Maven 2
- Eclipse Galileo
- JUnit 4.8.1
- DbUnit 2.4.7
- Subclipse SVN plugin
- Eclipse IAM (Integration for Apache Maven)
- Continuum Continuous Integration
Below are a couple of lessons learned which I remembered to write down:
- In a ModalWindow you'd probably want to use a AjaxSubmitLink, not a SubmitLink, if you want to use modalWindow.setWindowClosedCallback(). See here for explanation.
- ajaxrequesttarget.addComponent: addComponent name might be a bit confusing for beginners. It means "add the component to the list of components be re-rendered/refreshed".
- An AjaxSubmitLink doesn't update the model when setDefaultFormProcessing() is set to false. Not totally illogical, but you still might run it to it when you don't expect it.
- Here are tips to validate related fields. (In the original the example code is missing.)
- AjaxSubmitLink: if you get a "Component-targetted feedback message was left unrendered. This could be because you are missing a FeedbackPanel on the page" warning in your Tomcat server console, it seems you have to tell in the onError() of the AjaxSubmitLink which feedback panel(s) you want to have updated.
You get the warning even when you have feedback panels higher up in the tree of the (Base)Page. An example to update those panels could be:
Component infoFeedback = getPage().get("infoPanel");
Component warnFeedback = getPage().get("warningPanel");
Component errorFeedback = getPage().get("errorPanel");
This solution was inspired by these posts: post1, post2, post3, post4.
- To show/hide any HTML markup block dynamically, just wrap it with a WebMarkupContainer. In the code create that wrapper and make it visible or not depending on your requirements:
boolean makeVisible = false;
WebMarkupContainer blockContainer = new WebMarkupContainer("blockWrapper");
- Sometimes you might get a popup when using a ModalWinow that says "Reloading this page will cause modal window to disappear" when you don't expect it. Check the logs/console, you might just got an exception in your app (after which Wicket tries to redirect to the error page, which causes the popup to show; at least that's my reasoning).
- If JUnit can't find the Spring context.xml in the resources directory, then you have to add the resources dir to your Build path
- Does not really support LazyLoading so not very efficient for large "graphs" of data/dependencies. In those cases you could decide to skip the DTO layer and directly access the domain model.
- The Maven plugin IAM in Eclipse can be turned off for the Mod4J models project in Eclipse, otherwise it runs twice: once by Mod4J features, once by Maven (plugin).