wicket

Wicket dynamically add components to form

半腔热情 提交于 2019-12-05 16:18:29
I'm having trouble adding components to a form dynamically. What I'm trying to do is: Give the user a drop-down list with items he can choose like name, age, ... When a user presses add: there comes a (label + inputbox) in 1 component wich allows him to put in the value. You might think I could hide those components wich aren't selected but the user is also able to add values to the drop-down list. The problem I have is how to add and remove components (label+ inputbox) without having wicket:ids in the HTML? This is what I'm trying to add: <wicket:panel> <div wicket:id="hldValue"> <label

How do I keep entities (or their associations) attached to the current persistence context across multiple requests (using Wicket & JPA)?

↘锁芯ラ 提交于 2019-12-05 15:37:40
问题 I am working on a Wicket-based web app on Java EE. I am trying to find a way to ensure that any entities used as model objects are always attached to the current EntityManager before Wicket tries to render any components. This way, when the components grab data from their model, the data can be lazily-loaded by the entity as needed. There are lots of tutorials out there, and some posts on here, referring to LoadableDetachableModels (LDM) as the solution. This has worked for us when we don't

Can a wicket:child tag be nested under another Component on the Page?

孤人 提交于 2019-12-05 15:02:20
In Wicket 1.4, I'm trying to allow child pages to alter a CSS class on a tag in the parent page, which I do all the time. What is odd about this case is that the tag I want to target wraps the child page markup . Here's a simplified snip of what I tried: ParentPage.html <div id="main" wicket:id="main"> <wicket:child /> </div> ParentPage.java public abstract class ParentPage { private WebMarkupContainer main; protected ParentPage() { main = new WebMarkupContainer("main"); add(main); } public void setClassAttr(String cssClass){ main.add(SimpleAttributeModifier("class", cssClass); } } ChildPage

Passing information safely between Wicket and Hibernate in long running conversations

柔情痞子 提交于 2019-12-05 10:53:36
We are using Wicket with Hibernate in the background. As part of out UI we have quite long running conversations spanning multiple requests before the updated information is written back to the database. To avoid getting hibernate errors with detached objects we are now using value objects to transfer info from the service layer to Wicket. However we now end up with an explosion of almost the same objects : e.g. Answer (mapped entity saved in hibernate) AnswerVO (immutable value object) AnswerModel (A mutable bean in the session domain) IModel wrapped Wicket Model and usually this gets wrapped

How does Wicket setResponsePage() method work?

拟墨画扇 提交于 2019-12-05 10:46:06
When learning about JSP and servlets, I heard about redirect and dispatch. Which of them does Wicket's setResponsePage() perform? What setResponsePage does is dependent on a couple of factors: how many times you call setResponsePage, which variant of the setResponsePage you call and what render strategy you use. You can call setResponsePage many times during a request. Wicket uses the last one to work with. There are two variants of setResponsePage: with a Page instance and with a Page class and PageParameters . The latter sends a redirect to a bookmarkable URL to the browser. The former will,

Can the Wicket modal window be customized?

与世无争的帅哥 提交于 2019-12-05 10:03:39
I need to add a button to the title bar of a Wicket modal window. I can't find anything useful in the Wicket API that will help me. Is there any way to customize the title bar in this way? According /org/apache/wicket/extension/ajax/markup/html/modal/res/modal.js you can't modify modal window decorator by wicket api because modal window markup defined entirely in javascript. So as always you can select simple but bad way and replace modal.js by your own, or you can hardly true way changing modal window after show using js to modify span with class "w_captionText". Or may be (i'm not test it)

Using Wicket to display an image stored as BLOB in MYSQL db

自作多情 提交于 2019-12-05 09:14:09
问题 I currently have a blob in my mysql db that contains an image. What i want is to display this image to the user. I cannot place it in a directory structure as the blob may be anything from an image to a piece of html so there is logic involved as to whether it is a piece of html or an image etc. I was thinking of checking the BLOB to see if it is an image and it can output it to a temporary directory then load it as a resource but then I noticed wicket has a BlobImageResource class however I

Three tier layered application using Wicket + Spring + Hibernate. How would you handle transactions?

房东的猫 提交于 2019-12-05 06:02:23
问题 I'm thinking about using the Open Session In View (OSIV) filter or interceptor that comes with Spring, as it seems like a convenient way for me as a developer. If that's what you recommend, do you recommend using a filter or an interceptor and why? I'm also wondering how it will mix with HibernateTemplate and if I will lose the ability to mark methods as @Transactional(readOnly = true) etc and thus lose the ability to get some more fine grained transaction control? Is there some kind of best

Wicket & CSS resources

别等时光非礼了梦想. 提交于 2019-12-05 04:02:02
I've been looking around and I can't find a dummy's guide to adding my own CSS to a Wicket website project. But before I start... I'm fairly new to proper java development, so when I say "Dummy's guide" I really mean it! Simple and clear explanations for me here are very much appreciated! I started with this guide here ( http://wicket.apache.org/start/quickstart.html ) and have that running fine. Next up, I want to add my own CSS and start messing about with it. And I'm getting nowhere fast. Mainly because I haven't got a clue how to do this in java (I come from a C#/asp.net background).

Why does running multiple Wicket applications cause AJAX conflicts?

你。 提交于 2019-12-05 02:13:47
When I open two Wicket web applications in the same browser, it seems there are AJAX conflicts as I see a full page refresh in place of a partial refresh. This is true even if the applications are on different servers and port numbers. I only use the out-of-the-box JavaScript provided by Wicket ( tabbedPanel , onTimerAutoRefresh ). Perhaps it is something related to the fallback function. When only one web application is open, it works without any problems. I don't have a problem on the examples site, so I think something is wrong with the configuration of my application. wicket-ajax.js , line