wicket

How can I get a Spring bean injected in my custom Wicket model class?

依然范特西╮ 提交于 2019-11-29 06:06:36
In a custom Wicket class, not unlike the following, I'm using a service bean which should be injected by Spring, as defined with the SpringBean annotation (from the wicket-spring project). public class ReportExportFileModel extends AbstractReadOnlyModel<File> { @SpringBean(name = "reportService") ReportService reportService; ReportDto reportDto; ReportExportFileModel(ReportDto reportDto) { this.reportDto = reportDto; } @Override public File getObject() { try { return reportService.generatePentahoReport(reportDto); } catch (ReportGenerationException e) { // ... } } } However, this doesn't work:

AOP or APT for overriding methods from super classes

江枫思渺然 提交于 2019-11-29 05:13:19
I have a large library of wicket components that are annotated with a custom annotation @ReferencedResource or another annotation @ReferencedResources , that has a ReferencedResouce[] value() parameter to allow multiple annotations. Here is a sample code snippet: @ReferencedResources({ @ReferencedResource(value = Libraries.MOO_TOOLS, type = ResourceType.JAVASCRIPT), @ReferencedResource(value = "behaviors/promoteSelectOptions", type = ResourceType.JAVASCRIPT) }) public class PromoteSelectOptionsBehavior extends AbstractBehavior{ ... } So far, I use apt to check that the referenced resources

How to solve could not create the virtual machine error of Java Virtual Machine Launcher?

家住魔仙堡 提交于 2019-11-29 04:46:44
问题 I am working on java wicket framework and Apache tomcat. Here I have Problem when i tried to start tomcat it shows Java Virtual Machine Launcher pop window "Could not create the Java Virtual Machine". After clicking on "OK" button on Pop window it shows the error on console. Error occurred during initialization of VM. Could not reserve enough space for object heap. Please give me any reference or suggestions. Thanks in Advance. 回答1: Error: sony@sony-VPCEH25EN:~$ java --version Picked up JAVA

making entire row of a wicket datatable clickable

雨燕双飞 提交于 2019-11-29 04:10:01
Is it possible to make the entire row of a Wicket DataTable clickable ? if so, how ? I've seen examples of how to make a cell clickable by extending the PropertyColumn class, which is fairly easy but can't find an easy solution for the entire row. this do the work. //override this method of the DataTable class @Override protected Item<T> newRowItem(String id, int index, final IModel<T> model) { Item<T> rowItem = new Item<T>(id, index, model); rowItem.add(new AjaxEventBehavior("onclick") { private static final long serialVersionUID = 6720512493017210281L; @Override protected void onEvent

Your experience with Scala+Wicket

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 15:39:27
问题 Could you share your experience of using Scala and Wicket together? Do they fit naturally to each other? Do you get advantage of using Scala (and FP) with Wicket over using Java? Why did (would) you prefer Wicket over Lift? 回答1: For those interested in looking at code, I re-implemented the Seam "Hotel Booking" demo in Scala + Wicket here: Browse | SVN - the Java + Wicket version is here: Browse | SVN I used the (not yet final) Scala 2.8 and the NetBeans plugin. Was meaning to blog in detail

jquery not proceeding to next page

匆匆过客 提交于 2019-11-28 14:46:02
i have jquery, but it is not going to next page, it always display images and waits, never proceed to next page. HTML code: <div id="toHide" class="pb-text-align-center"> <img style="display: inline" src="img/load.gif" /> <form wicket:id="safeForm" class="clearfix"> <input type="hidden" wicket:id="submitted" value="false" /> </form> </div> HTML view source: <SCRIPT type="text/javascript"> var $ = jQuery.noConflict(); $('.toHide').show().doTimeout(100,function() { $('.toHide').find('safeForma3').submit();}); </SCRIPT> wicket code: static private class SafeSubmitBehaviour extends

Wicket: how to render page programmatically and get result as string?

╄→尐↘猪︶ㄣ 提交于 2019-11-28 11:13:28
I'm in the process of converting an app to use i18n/l10n on all its pages. I'm very happy with Wicket's support for this, and it's going well so far. The one tricky part I've run into is the following: We have a text file that is used as an HTML template to send email when users perform a certain operation on the site. When the user clicks a particular link, I read in this template manually, do some text substitutions like "Dear $USERNAME" , and send the result as an HTML email to the user. In order to support the 10 or so languages we're targeting, I'll either have to maintain 10 copies of

Anonymous inner classes in C#

半城伤御伤魂 提交于 2019-11-28 10:45:05
I'm in the process of writing a C# Wicket implementation in order to deepen my understanding of C# and Wicket. One of the issues we're running into is that Wicket makes heavy use of anonymous inner classes, and C# has no anonymous inner classes. So, for example, in Wicket, you define a Link like this: Link link = new Link("id") { @Override void onClick() { setResponsePage(...); } }; Since Link is an abstract class, it forces the implementor to implement an onClick method. However, in C#, since there are no anonymous inner classes, there is no way to do this. As an alternative, you could use

Access maven project version in Spring config files

狂风中的少年 提交于 2019-11-28 09:29:40
I would like to display the currently running version of my web application in the page. The project is based on Maven, Spring, and Wicket. I'd like to somehow get the value of maven's ${project.version} and use it in my spring XML files, similarly to the way I use the Spring PropertyPlaceholderConfigurer to read a property file for settings that I use in my application. If I had the maven project.version available as a variable in my Spring config, I could do something like this: <bean id="applicationBean" class="com.mysite.web.WicketApplication"> <property name="version"><value>${project

Object equality in context of hibernate / webapp

落花浮王杯 提交于 2019-11-28 07:39:58
How do you handle object equality for java objects managed by hibernate? In the 'hibernate in action' book they say that one should favor business keys over surrogate keys. Most of the time, i do not have a business key. Think of addresses mapped to a person. The addresses are keeped in a Set and displayed in a Wicket RefreshingView (with a ReuseIfEquals strategy). I could either use the surrogate id or use all fields in the equals() and hashCode() functions. The problem is that those fields change during the lifetime ob the object. Either because the user entered some data or the id changes