wicket

Is there a way to introduce Internet Explorer conditional comments using JavaScript?

隐身守侯 提交于 2019-12-07 20:00:36
问题 I have a segment of HTML code which includes a conditional comment: <!--[if IE]> <link rel="stylesheet" ...> <[endif]--> This code was tested and works correctly when included in the HEAD section of the page, on the initial page rendering. I would like to introduce the same conditional CSS to an existing page using JavaScript in an Ajax response. I have tried: var comment = document.createComment("[if IE]>\n<link rel=\"stylesheet\" ...>\n<[endif]"); Wicket.Head.addElement(comment); //this is

How can I bring Wicket 7 to work with java.time from Java 8?

对着背影说爱祢 提交于 2019-12-07 10:05:53
问题 I have lots of beans and all use LocalDate and LocalDateTime. The DateTextField in Wicket and all other widgets (like the DatePicker) only work on java.util.Date. Is there any way to inject a converter into Wicket 7 so that it uses LocalDate or LocalDateTime? The beans look like this: public class SomeBean { Long id = null; LocalDate since = null; // plus getters and setters } A Wicket form currently uses a CompoundPropertyModel CompoundPropertyModel<SomeBean> model = new CompundPropertyModel

Javascript in Wicket 1.5

為{幸葍}努か 提交于 2019-12-07 08:12:30
im looking for the Wicket 1.5 Way of doing the following tasks: Add a external .js File to header of the Page from a Panel. Add a <script>...</script> Tag at Bottom of Page from a Panel Add some Javascript to the onLoad Event of the Body tag There are lots of examples how to do this in Wicket 1.2 and 1.3 but these API are gone. Any good Wicket 1.5 Articles aboutJavascript/Ajax would be great. HaBaLeS found it out himself: add(new Behavior(){ private final ResourceReference SOME_JS = new JavaScriptResourceReference(ChartTestPage.class, "some.js"); @Override public void renderHead(Component

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

99封情书 提交于 2019-12-07 07:14:25
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 will change. What can I do to keep my applications modular, and achieve my goal? My company does this all

How does Wicket setResponsePage() method work?

限于喜欢 提交于 2019-12-07 06:57:55
问题 When learning about JSP and servlets, I heard about redirect and dispatch. Which of them does Wicket's setResponsePage() perform? 回答1: 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

Wicket: Where to add components? Constructor? Or onBeforeRender?

一笑奈何 提交于 2019-12-07 06:28:42
问题 I'm a Wicket newb. This may just be my ignorance of the Wicket lifecycle so please enlighten me! My understanding is that Wicket WebPage objects are instantiated once and then serialized. This has led to a point of confusion for me, see below. Currently I have a template class which I intend to subclass. I followed the example in the Wicket docs demonstrating how to override the template's behavior in the subclass: protected void onBeforeRender() { add(new Label("title", getTitle())); super

How to make a wicket link appear as an image?

爷,独闯天下 提交于 2019-12-07 04:32:32
问题 I am trying to make a wicket link appear as an image instead of text. I am creating an external link and then placing it on the page. add(new ExternalLink("link", url, "Page name")); <a wicket:id="link"></a> My problem is that I can't put the image in place of "Page name" because it will just set the html as text. I also tried to span a wicket id instead and it also is rendered as text. Can anyone help? 回答1: For a static image: <a wicket:id="link"><img src="myImg.jpg" alt="My Image" /></a>

Wicket countdown timer will not self-update

不问归期 提交于 2019-12-06 22:05:29
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){ clock.decrement(); target.addComponent(clock); } }); This doesn't work because onTimer is a final

Hibernate Session Closed Exception after fast subsequent requests

[亡魂溺海] 提交于 2019-12-06 15:39:19
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 = getSession().beginTransaction(); } and finally commited: public void commit() { if (transaction != null)

How to make weblogic form authentication in wicket

淺唱寂寞╮ 提交于 2019-12-06 15:28:29
I want make weblogic form validation in wicket but I dont know how to create login page. I followed this tutorial where is example in jsp: http://docs.oracle.com/cd/E13222_01/wls/docs100/security/thin_client.html#wp1057581 I create similar form in wicket but I dont know what should I do when I push submit button. There is some action called "j_security_check" but i dont know how should i implement it in java and wicket UPDATE: I am using weblogic 10.something and I cant use newest I try to create my own impelemtation but when I try to use login wicket throw exception: java.lang