wicket

Wicket checkbox that automatically submits its changed value to domain object

∥☆過路亽.° 提交于 2019-12-03 06:30:29
What's the cleanest way I can make a checkbox automatically submit the form it belongs to in Wicket? I don't want to include a submit button at all. The checkbox is backed by a boolean field in a domain object ("Account" in this case). Simplified example with irrelevant parts omitted: EntityModel<Account> accModel = new EntityModel<Account>(Account.class, id); PropertyModel<Boolean> model = new PropertyModel<Boolean>(accModel, "enabled"); CheckBox checkBox = new CheckBox("cb", model); Form form = new Form("form"); form.add(checkBox); add(form); HTML: <form wicket:id="form" id="form" action="">

Dynamically add components to ListView in Wicket

倾然丶 夕夏残阳落幕 提交于 2019-12-03 03:52:54
I want to make a form with "Add" button. After pressing "Add" button new panel adds to the wicket ListView element. How do I do that? I want to be able add unlimited number of rows. EDIT: InteractivePanelPage.html <table> <tr> <td><a href="#" wicket:id="addPanelLink">Add Panel</a></td> </tr> <tr wicket:id="interactiveListView"> <td> <span wicket:id="interactiveItemPanel"></span> </td> </tr> </table> InteractivePanelPage.java // ... imports public class InteractivePanelPage extends WebPage { public LinkedList<InteractivePanel> interactivePanels = new LinkedList<InteractivePanel>(); private

Wicket, page stack, and memory usage

假装没事ソ 提交于 2019-12-03 03:47:10
A Wicket application serializes and caches all pages to support stateful components, as well as for supporting the back button, among other possible reasons. I have an application which uses setResponsePage to navigate from screen to screen. Over a pretty short amount of time the session gets rather large because all of the prior pages are stored in the session. For the most part, I only need the session to contain the current page, for obvious reasons, and perhaps the last 2 or 3 pages to allow easy navigation using the browser's back button. Can I force a page to expire after I have

How do I call Java code from JavaScript code in Wicket?

房东的猫 提交于 2019-12-02 22:56:59
If I can do this, how do I call Java code (methods for instance) from within JavaScript code, in Wicket. erk. The correct answer would be ajax call backs. You can either manually code the js to hook into the wicket js, or you can setup the callbacks from wicket components in java. For example, from AjaxLazyLoadPanel: component.add( new AbstractDefaultAjaxBehavior() { @Override protected void respond(AjaxRequestTarget target) { // your code here } @Override public void renderHead(IHeaderResponse response) { super.renderHead( response ); response.renderOnDomReadyJavascript( getCallbackScript()

Spring roo Vs (Wicket and Spring)

烈酒焚心 提交于 2019-12-02 21:44:39
Spring roo is new framework and I found it very interesting. I have been working on web application for last 3-4 years and Always found JSPs are hard to maintain across teams if everyone is not disciplined enough about separation of markup and serverside logic. I have used JackBe/BackBase in last projects and I enjoyed xml templates working as views. This was much better than JSPs. But I couldnt automate webtests through selenium for backbase. I would be surely using Spring MVC (-view), Hibernate on the backend. I found Wicket as good alternative. Have you used wicket along with Spring and

Does it make sense to use Google Web Toolkit (GWT) as a full-blown Java web framework?

风格不统一 提交于 2019-12-02 20:59:39
I am interested in the possibility that GWT could serve as the basis for my entire presentation layer. I would be interested to know if anyone has tried this successfully - or unsuccessfully - and could persuade or unpersuade me from attempting this. I worked with GWT about a year ago. At the time it seemed like a great idea, with a number of caveats: I had "gotcha" problems with some parts of the API, that were probably related to the fact that you're coding as if you're in java when in fact you're actually writing for a separately compiled environment that acts like java, so you make some

Getting a Wicket text box's value in an AJAX onchange event

匆匆过客 提交于 2019-12-02 20:45:33
When a user enters a number in a Wicket text field, I need to capture the value entered on an AJAX onchange event. How can I do this? Use an OnChangeAjaxBehavior , and your component model will be updated automatically. You can query the value by using component.getDefaultModelObject() add(new TextField<String>(id, someModel) .add(new OnChangeAjaxBehavior(){ private static final long serialVersionUID = 2462233190993745889L; @Override protected void onUpdate(final AjaxRequestTarget target){ // Maybe you want to update some components here? // Access the updated model object: final Object value

Wicket vs Vaadin

孤人 提交于 2019-12-02 15:24:33
I am torn between Wicket and Vaadin. I am starting a micro-isv and need to make a choice of web framework. I have narrowed down my choices to Wicket and Vaadin. I have used both frameworks and I love them both. however I need to make a choice. If If I choose Vaadin: I wont have to worry much about the look and feel. It comes with nice themes. I will do all my programming in Java which am very good at and wont have to spend time hacking CSS which am not very good at. And most of the components that I will need for a business applications are there OUT OF THE BOX including, desktop like layout,

DefaultTreeModel and Wicket Tree: setAsksAllowsChildren doesn't work

偶尔善良 提交于 2019-12-02 14:32:48
问题 I'm using Wicket's Tree component in a web app. But empty folders are shown in a file-way. Just like this: Bellow is where I use the DefaultTreeModel and Tree: PDMinterface pdmI = new PDMinterface(); DefaultMutabletreeNode rootTreeNode = pdmI.getDocTree(); //文档树根结点,由PDM接口提供 DefaultTreeModel treeModel = new DefaultTreeModel(rootTreeNode); treeModel.setAsksAllowsChildren(true); and I'm sure that folder5 is set to allow children: public DefaultMutableTreeNode getDocTree(){ DefaultMutableTreeNode

Wicket Dropdown with Autocomplete and Categories

五迷三道 提交于 2019-12-02 09:54:57
I need an autocomplete with a dropdown with results categorised like in HTML select - optgroup with keyboard navigation. I tried to implement a wicket Select component with groups based on this: Separator in a Wicket DropDownChoice with a textfield for search, but can't jump to select with "Arrow down". Any other ideas? I think you best option is Select2 (example: https://select2.github.io/examples.html#themes-templating-responsive-design ) and its Wicket integration: https://github.com/wicketstuff/core/tree/master/select2-parent 来源: https://stackoverflow.com/questions/36357655/wicket-dropdown