wicket

Wicket calling a lengthy operation and updating through ajax

非 Y 不嫁゛ 提交于 2019-12-06 05:11:55
问题 Based on this SO question, I've come to an understanding that Wicket queues subsequent AJAX requests. Now my page is ridden with several AJAX requests and I'd like to add one more that spawns a lengthy operation. public void populateItem(final Item item) { final MyObject object = (MyObject) item.getModelObject(); // ... a couple of fields Label statusLabel = new Label("status", new AbstractReadOnlyModel() { @Override public Object getObject() { return someService.doSomeLengthyOperation(); } }

Dynamic <optgroup> support in wicket

為{幸葍}努か 提交于 2019-12-06 04:40:45
问题 I'm looking to render a <select> tag in my page using wicket, but group the options with <optgroup> , this was discussed on Separator in a Wicket DropDownChoice, but in the solutions there the <optgroup> assume that the <optgroup> tags are static, I'm wanting to pull both the options and the groups from a database. 回答1: Use two nested repeaters to iterate over your groups and options: <select wicket:id="select"> <optgroup wicket:id="group"> <option wicket:id="option"></option> </optgroup> <

Why doesn't my (spring)HibernateTransactionManager work in wicket?

这一生的挚爱 提交于 2019-12-06 04:16:06
I tried to shorten this to what I think is relevant, I hope it's sufficient and not overwhelming. Please help! I'm converting a small wicket+databinder+hibernate web application to use wicket+spring+hibernate . I have a DAO service class, with a hibernate SessionFactory injected by Spring. I am able to do read-only operations using the session factory (autocommit is on by default). What I want to do is use the HibernateTransactionManager and the @Transactional annotation to do a transactional operation. I define a DAO service implementation, which uses an injected SessionFactory in a method

How can I begin using Wicket? [closed]

假如想象 提交于 2019-12-06 02:55:11
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . I installed Wicket per the rules of the Wicket site. How do I run Wicket within my IDE, Eclipse? I have added all the necessary plug-ins. Nishant I expect you have configured as per quick-start guide here: http://wicket.apache.org/start

Close ModalWindow on keypress

牧云@^-^@ 提交于 2019-12-06 01:44:27
问题 I would like to be able to close a ModalWindow when the user presses a key, in my case ESC. I have a Javascript listener for the keypress which calls the click event of the cancel button's ID: jQuery("#"+modalWindowInfo.closeButtonId).click(); Is this the correct way to do it? I am wondering because it works in Chrome but not in FF, but it could be due my specific implementation. 回答1: The 'right' way to do it is to call the server, then close it with the response. You can do this with an ajax

Wicket: how to handle long running tasks

隐身守侯 提交于 2019-12-06 01:38:57
问题 I've setup a Wicket + Hibernate + Spring Web application that involves gathering some data (having some files generated and returned), storing this in a database, creating some images and displaying all this on a webpage. This all works fine for short runs, but sometimes gathering the data (which involves some remote number crunching) takes too long (20+ minutes) and times out. I've tried to resolve this using two approaches, but both of them show some problems. The first approach was using

Components not reloading on url change in Wicket 1.5(.2)?

放肆的年华 提交于 2019-12-05 23:32:06
I navigate to my application the first time with following URL: .../homepage/?0&user= x In debug mode I see wicket is nicely instantiating my panels and such (obviously). if I change the URL to: .../homepage/?0&user= y then nothing happens, the panels are not re-initialized (for the new user => data of user x is still shown) nor are LoadableDetachable -or other models invoked. However, if I change the URL to: .../homepage/? 1 &user=y then all panels are nicely initialized for user y One step further, if you change the URL back to .../homepage/? 0 &user= y then again the data for user x is

Using javascript (bootstrap) in Wicket

风流意气都作罢 提交于 2019-12-05 21:28:03
First I added the JavaScript in Wicket correctly with a JavaScript resource reference. response.renderJavaScriptReference("http://code.jquery.com/jquery-latest.js"); response.renderJavaScriptReference(new JavaScriptResourceReference(JSAccessor.class,"bootstrap.js")); response.renderJavaScriptReference(new JavaScriptResourceReference(JSAccessor.class,"bootstrap.min.js")); Second I added the bootstrap CSS to wicket with CSS resource reference. response.renderCSSReference(new CssResourceReference(CssAccessor.class, "bootstrap.css")); response.renderCSSReference(new CssResourceReference

Wicket @SpringBean doesn't create serializable proxy

梦想与她 提交于 2019-12-05 20:46:44
@SpringBean PDLocalizerLogic loc; When using above I receive java.io.NotSerializableException. This is because loc is not serializable, but this shouldn't be problem because spring beans are a serializable proxies. I'm using wicket-spring library, and as injector SpringComponentInjector, where wrapInProxies is by default set to true, so I think that proxies should be created, but they aren't. On the page https://cwiki.apache.org/WICKET/spring.html#Spring-AnnotationbasedApproach is written: Using annotation-based approach, you should not worry about serialization/deserialization of the injected

Should I put html and java files in the same package (folder) in Apache Wicket?

左心房为你撑大大i 提交于 2019-12-05 19:45:36
I wonder if there is an example which html files and java files are resides in different folders. perilandmishap I don't recommend using a separate page directory unless you are quite comfortable with how resource streams work, which I am not. The vast majority of wicket projects I have seen keep class and html files in the source directory. I tried separating them myself but then found that getting my hands on other resources, like images and such, was a hassle; so, I wound up putting those resources in the package directory - in the end I had resources in several different places and it was