wicket

Implementing javascript events to Wicket

人走茶凉 提交于 2019-12-01 11:00:02
I'm new to ria-development and working with the Ajax Slider example . I can't figure out how to work with javascript events. Here in the example the onValueChanged-event is preimplemented. How do I implement say onchange- or onSlider-event? All help greatly appreciated! public abstract class AjaxSlider extends WebMarkupContainer { private static final long serialVersionUID = 1L; public AjaxSlider(String id) { super(id); super.setOutputMarkupId(true); } public JQUIComponentBehaivor<SliderOptions> getSlideBehaviors() { List behaviors = getBehaviors(); for(Object behavior : behaviors){ if

Is there an activity indicator in Wicket?

我的未来我决定 提交于 2019-12-01 10:23:27
问题 I'll make this short: Is there a way / library in Wicket to show an activity indicator? You know, the spinning thing that moves while the user is waiting for something, or is it just a javascript thing? Thanks for your help. 回答1: If this is an ajax operation then you can look at the implementations of IAjaxIndicatorAware . These implementations will show a 'spinner' while the operation is processing. e.g. IndicatingAjaxButton and IndicatingAjaxLink You could also look at AjaxIndicatorAppender

Wicket- RequiredFieldValidator for AjaxEditableLabel

时光毁灭记忆、已成空白 提交于 2019-12-01 09:55:24
问题 At first I want to say, although RequiredFieldValidator is used in .NET but I use this term for wicket as I want to mean a Label (color: red and text: *) which will be be displayed beside AjaxEditableLabel when the editor of the AjaxEditableLabel will be blank. I have set AjaxEditableLabel.setRequired(true) and it is working, i.e., the Form cannot be submitted. But I am not able to track that red star Label beside the AjaxEditableLabel. What I did so far is : private class

Implementing javascript events to Wicket

房东的猫 提交于 2019-12-01 09:36:44
问题 I'm new to ria-development and working with the Ajax Slider example. I can't figure out how to work with javascript events. Here in the example the onValueChanged-event is preimplemented. How do I implement say onchange- or onSlider-event? All help greatly appreciated! public abstract class AjaxSlider extends WebMarkupContainer { private static final long serialVersionUID = 1L; public AjaxSlider(String id) { super(id); super.setOutputMarkupId(true); } public JQUIComponentBehaivor

Wicket 1.5 Javascript File in Body Tag

蓝咒 提交于 2019-12-01 09:33:16
I need to put a script-tag inside the body, because the javascript doesn't work in the head tag. As of Wicket 1.5 the following code is not longer supported: add(new JavaScriptReference("wz_tooltip", new JavaScriptResourceReference(BaseTemplate.class, "wz_tooltip.js"))); This is because the class JavaScriptReference no longer exists. I can't obviously use the new renderHead method. My workaround so far: WebMarkupContainer script = new WebMarkupContainer("script"); script.add(new AttributeAppender("type", Model.of("text/javascript"))); script.add(new AttributeAppender("src", Model.of("wz

Wicket 1.5 Javascript File in Body Tag

左心房为你撑大大i 提交于 2019-12-01 07:45:51
问题 I need to put a script-tag inside the body, because the javascript doesn't work in the head tag. As of Wicket 1.5 the following code is not longer supported: add(new JavaScriptReference("wz_tooltip", new JavaScriptResourceReference(BaseTemplate.class, "wz_tooltip.js"))); This is because the class JavaScriptReference no longer exists. I can't obviously use the new renderHead method. My workaround so far: WebMarkupContainer script = new WebMarkupContainer("script"); script.add(new

Generating commented-out content with Wicket

谁说我不能喝 提交于 2019-12-01 04:34:23
For debug reasons, and on a whim, I'd like to include certain information in a Wicket page's HTML output that is enclosed in HTML comments . The output would be something like... <!-- <div wicket:id="foo"> 1234 </div> --> ...where "1234" is some interesting, dynamically created piece of information. I have tried, to no avail: <!-- <div wicket:id="foo"></div> --> → Wicket complains that element with id "foo" is missing from the HTML page enclose in <wicket:remove> → such sections cannot contain elements with wicket:id label.setVisible(false) → Wicket doesn't output the label at all new Label(

How to insert 'sub-rows' into a Wicket DataTable

末鹿安然 提交于 2019-12-01 01:54:54
问题 I have an AjaxFallbackDefaultDataTable which contains one row per test result. A test result may have a note attached to it, which needs to be displayed prominently below the test result, hopefully giving a table similar to the following: | Test | Result | Appraisal | |------|--------|-----------| | 1 | 20.0 | PASS | | 2 | 1.50 | FAIL | | Note: This is an epic fail| | 3 | 19.4 | PASS | | 4 | 14.9 | PASS | Is there any way to achieve this row insertion (preferably with column spanning) using

Can you make a TextField<BigDecimal> accept both , and . as decimal separator?

喜夏-厌秋 提交于 2019-12-01 01:39:52
问题 In a Wicket app, I have a decimal number text field: TextField<BigDecimal> f = new TextField<BigDecimal>("f", new PropertyModel<BigDecimal>(model, "share")); I want it to always accept both . (dot) and , (comma) as decimal separator ( regardless of browser's locale settings). For showing the value, session's locale is used [which in our case is forced to be "fi" (-> comma)], but here I'm interested in what the field accepts as input. My question is, do I have to change the field to TextField

Wicket http post, get raw data from servletrequest?

三世轮回 提交于 2019-12-01 01:19:51
I try do POST some data to a Wicket WebPage. This works fine if the data is in a form. However, I want to post the data with jQuery's ajax-post. I am unable to get this data in my Page-constructor. This is my jquery command: $.ajax({ type: "post", cache: false, url: "http://localhost:8888/testjson", data: JSON.stringify({"aap":"noot"), contentType: 'application/json', success: function(ydata){alert("aap");}, failure: function(errMsg) {alert(errMsg);}, contentType: false, dataType: "json" }); The /testjson is a mounted WebPage. public TestJsonApiPage( PageParameters pp ) { try { byte[] data =