wicket

continueToOriginalDestination does not bring me back to originating page

不问归期 提交于 2019-12-08 07:16:46
问题 I am trying to sign into my application. First I throw the RestartResponseAtInterceptPageException (this is in a WicketPanel on my BasePage): add(new Link<String>("signin") { @Override public void onClick() { throw new RestartResponseAtInterceptPageException(SignIn.class); } }); The SignIn Page class contains a form (an inner private class) for the sign in, with the following submit button: add(new Button("signinButton") { @Override public void onSubmit() { final User user = model.getObject()

How to output the class tag when the component has a wicket:id?

独自空忆成欢 提交于 2019-12-08 07:07:26
问题 I'm a Wicket newbie. I wonder if someone could help me with the following: I have: .centredtab{ margin-left: auto; margin-right: auto; } and: <form class="centredtab"wicket:id="questionform"> but the class centredtab for the form is not being rendered. Is there a method in the Wicket API to ensure that this class attribute will be rendered in order that the form is centred? Thanks! 回答1: Wicket simple attribute appender to rescue you see here http://wicket.apache.org/apidocs/1.4/org/apache

How can I reuse code when two different wicket applications share common functionality

会有一股神秘感。 提交于 2019-12-08 05:45:38
问题 I have a Wicket AuthenticatedWebApplication which has several pages and features that need to be reused in a new AuthenticatedWebApplication that I have to develop. I am using Wicket 1.4, Spring and Hibernate. Both applications will even share the same look (except for Application logo) which is now implemented in a base page. Has anyone had a similar experience? I definitely don't want to recur to copy-paste code because the common functionality implements a workflow process which can and

Wicket countdown timer will not self-update

梦想与她 提交于 2019-12-08 05:08:22
问题 I would like to implement a countdown timer in Wicket. I have a clock class: public class Clock extends Label{ private static int time; public Clock(int mytime,String id,String message){ super(id,message); time=mytime; this.setDefaultModelObject(message); } public int getTimeLeft(){ return time; } public void decrement(){ time--; } } and here I attempt to update it every second: clock.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(1)){ protected void onTimer(AjaxRequestTarget target){

“Invalid lambda deserialization” when lambda used for interface implementation

南楼画角 提交于 2019-12-08 04:13:40
问题 I have a wicket project with lambda expressions. On one page when user clicks on back button my application crashes on: java.lang.IllegalArgumentException: Invalid lambda deserialization at x.y.z.MyPage$3.$deserializeLambda$(MyPage.java:1) In the page class (where I return) I'm using lambda expression for implementation of this interface: public interface Localizator extends Serializable { String getLocalizedString(String key); } And the lambda: protected void someMethod() { localize((String

Hibernate Session Closed Exception after fast subsequent requests

此生再无相见时 提交于 2019-12-08 04:05:45
问题 I get a Caused by: org.hibernate.SessionException: Session is closed! error when I click on a link before the whole page is loaded (or my guess, just inside the active hibernate session). All of my DAO classes are subclassing GenericDAO where i got this method: public Session getSession() { if (session == null || !session.isOpen()) { session = HibernateUtil.getSessionFactory().getCurrentSession(); } return session; } This is called from: public void beginTransaction() { transaction =

Wicket ModalWindow position

爷,独闯天下 提交于 2019-12-08 03:38:03
问题 I need to modify the position of the modal window before it gets displayed in the middle. I have a ajaxbutton which will open the modal window. In the onClick method I tried something like... target.appendJavaScript("$(\".wicket-modal\").css('width', 888+'px');"); or target.appendJavaScript("$(\"[id^=_wicket_window]\").css('top', 100+'px');"); and some more variations of it... It seems I can't manipulate the position of the ModalWindow before it gets displayed. But I can manipulate the

Wicket 6 IColumn How the name can be of type other than string?

余生颓废 提交于 2019-12-07 23:59:34
问题 Interface IColumn contains a method getSortProperty(), which returns a value of any type S. How the name can be of type other than string? /** * Returns the name of the property that this header sorts. If null is returned the header will * be unsortable. * * @return the sort property */ S getSortProperty(); http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/extensions/markup/html/repeater/data/table/IColumn.html In wicket older version 6: PropertyColumn<SomeClass> column =

After Wicket session timeout - pageParameters are null

坚强是说给别人听的谎言 提交于 2019-12-07 23:08:23
问题 I'm using wicket 6. My application is based on WebPages created with pageParameters in the constructor. I'm using also a pageParameter country that is a path-parameter defined with: mountPage("/${country}/pagepath", MyPage.class); I have many statefull forms in every page. I'm now trying to handle the case when the session expires (to reproduce this scenario I delete or modify the jsessionid cookie). After that I click a submit button in a page and I'd expect wicket to understand that the

Wicket ListView not refreshing

半世苍凉 提交于 2019-12-07 23:06:56
问题 I am taking my first steps with Apache Wicket and ran into the following problem. I have a ListView that displays a "delete" link right next to its entries. When the delete link is clicked, the entity represented by the list item is deleted from the database but the list itself does not get updated until I reload the page manually in the browser. IModel<List<SampleEntity>> sampleEntityListModel = new LoadableDetachableModel<List<SampleEntity>>() { @Override protected List<SampleEntity> load()