wicket-6

Wicket 6 to 8 upgrade: RadioGroup.onSelectionChanged() replacement

微笑、不失礼 提交于 2021-01-28 00:33:35
问题 We have inherited a large code base that uses Wicket 6 where we have a RadioGroup of preferred contact type choices (SMS, e-mail, etc). When a Radio for SMS is selected, a TextField for phone number is made visible, same for e-mail and so on. This has been implemented by adding an AjaxEventBehavior for "onclick" event to each Radio . The onEvent(AjaxRequestTarget) method calls RadioGroup.onSelectionChanged() and updates the visibility of each TextField : radioSms = new Radio<>("sms", ...);

Wicket form “ServletRequest does not contain multipart content”

狂风中的少年 提交于 2021-01-27 14:25:51
问题 I have a wicket form that has a file upload box on it. Sometimes this file upload box is hidden because the user isn't required to attach documentation. I have called setMultiPart(true) on the form object , but I still (but only rarely) get this error: java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where

Call Wicket 6 Code from Javascript and return value

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 18:59:32
问题 I have managed to call my Wicket 6 Java code from Javascript using option A in this example: https://stackoverflow.com/a/42612027/1047418 However, I have not been able to find examples for returning data from the Java side back to JavaScript (the generated JavaScript callback function does not even include a return statement). How can this be achieved? Edit: I am not trying to set an attribute in Java and as I've already explained, calling Wicket from JavaScript is not the problem here. I am

Concurrency Control configurarion using Spring Security in Wicket 6.7.0

北慕城南 提交于 2019-12-11 19:19:27
问题 I followed the below example to integrated the spring security in wicket. https://github.com/thombergs/wicket-spring-security-example. I changed spring-security.xml file to configure the concurrency control as follows. <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www

Wicket 6: Howto inject a javascript function via AbstractDefaultAjaxBehavior?

隐身守侯 提交于 2019-12-10 19:50:07
问题 I have a page that has a JavaScript file attached to it. The JavaScript has a function that, at the end should call a function that has been injected by Wicket through AbstractDefaultAjaxBehavior. The JavaScript looks like this: function updateAmount(amount){ // do some calculations on amount saveAmount(amount); } The injected function should look something like this: function saveAmount(amount){ Wicket.Ajax.post({ u: '${callbackUrl}', dep: function(){ return [{name:'amount','value':amount}];

Spring ReloadableResourceBundleMessageSource bean unable to find external properties

百般思念 提交于 2019-12-06 12:24:42
问题 I've tried to use the Mkyong's guide to access external properties file, without any success. This is my bean definition in web-osgi-context.xml file located in WEB-INF: <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basenames"> <list> <value>classpath:bundles/resource</value> <value>classpath:bundles/override</value> <value>file:c:/test/messages</value> </list> </property> <property name="cacheSeconds" value="10"/>

Spring ReloadableResourceBundleMessageSource bean unable to find external properties

≡放荡痞女 提交于 2019-12-04 20:00:04
I've tried to use the Mkyong's guide to access external properties file, without any success. This is my bean definition in web-osgi-context.xml file located in WEB-INF: <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basenames"> <list> <value>classpath:bundles/resource</value> <value>classpath:bundles/override</value> <value>file:c:/test/messages</value> </list> </property> <property name="cacheSeconds" value="10"/> </bean> Accessing the bean: @SpringBean private ReloadableResourceBundleMessageSource messageSource;

Wicket 6 - Capturing HttpServletRequest parameters in Multipart form?

浪尽此生 提交于 2019-12-02 21:24:58
问题 USing Wicket 6.17 and servlet 2.5, I have a form that allows file upload, and also has ReCaptcha (using Recaptcha4j). When the form has ReCaptcha without file upload, it works properly using the code: final HttpServletRequest servletRequest = (HttpServletRequest ) ((WebRequest) getRequest()).getContainerRequest(); final String remoteAddress = servletRequest.getRemoteAddr(); final String challengeField = servletRequest.getParameter("recaptcha_challenge_field"); final String responseField =