wicket

Wicket Wizard gives false information in method isComplete();

一世执手 提交于 2019-12-25 06:02:08
问题 in addition to a previous question, I'm trying to do my own implementation of a Wicket Wizard with a step overview. Now the problem is, that isComplete(); seems to return true, even if the step hasn't been finished. I made 3 wizardsteps and then I'm running this code: public class MainWizard extends Wizard{ private static final long serialVersionUID = 1L; private List<IWizardStep> steps = new ArrayList<IWizardStep>(); private Component overview = newOverviewBar("overview"); private

Wicket+Spring+JPA+Hibernate: No Persistence Unit Found

心已入冬 提交于 2019-12-25 04:56:23
问题 I'm developing a web application using Wicket+Spring+JPA+Hibernate. This is my first project with this setup and I think I've probably made some mistakes. I get the following error: No persistence unit called "ApplicationEntityManager" found. My persistence.xml file looks like this: <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns

Accessing javascript (Jquery) variables from Apache Wicket

淺唱寂寞╮ 提交于 2019-12-25 04:20:00
问题 I'm a noob learning Wicket/Jquery. I'm trying to access JavaScript (Jquery) variables from Wicket. Here's an example I'm working with: Component slider = new WebMarkupContainer("slider").add(new SliderBehavior( new SliderOptions().changeEvent("alert('clicked!')").orientation(Orientation.HORIZONTAL).min(10).max(100).value(20))); I'm implementing here a jqwicket slider example. Instead of the "alert('clicked!')" event I would like to read the value of the slider to the java. All help

How to use a single transaction for a Wicket / Spring page view?

烂漫一生 提交于 2019-12-25 02:15:15
问题 My previous question How to wrap Wicket page rendering in a Spring / Hibernate transaction? has led me to thinking about transaction demarcation in Wicket. Whilst the example there was easily solved by moving business logic down into a Spring-managed layer, there are other places where this is not possible. I have a generic DAO class, implemented by Hibernate, with public class HibernateDAO<T> implements DAO<T> { protected final Class<T> entityClass; private final SessionFactory

RadioGroup getValue does not return correct selected value

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 22:06:06
问题 I'm running into a small issue with RadioGroup. My RadioGroup has the values true and false. The Radio types I have in my radiogGroup use a Model that stores true or false. On an Ajax onChange event I want to do some handling, and to do so I need to know the selected radio in my radioGroup and another identical radioGroup. The problem is getValue() only returns the initial value from my POJO. Whenever I click on a radio button to change the selected Radio getValue() it still returns the

How to wrap Wicket page rendering in a Spring / Hibernate transaction?

爷,独闯天下 提交于 2019-12-24 19:08:15
问题 My application loads entities from a Hibernate DAO, with OpenSessionInViewFilter to allow rendering. In some cases I want to make a minor change to a field - Long orderId ... link = new Link("cancel") { @Override public void onClick() { Order order = orderDAO.load(orderId); order.setCancelledTime(timeSource.getCurrentTime()); }; but such a change is not persisted, as the OSIV doesn't flush. It seems a real shame to have to call orderDOA.save(order) in these cases, but I don't want to go as

Wicket: can Checkgroup be Ajax enabled?

浪尽此生 提交于 2019-12-24 11:37:43
问题 I have a dynamic list of choices, each represented by a checkbox. I also have a "select all" check box that selects them all. i am using a CheckGoup, CheckGroupSelector and Check and everything works great. now there is a new requirement to change the state on some other controls on the page when some of the checkboxes are selected. I thought the simpliest is to Ajax-enable the Check but it seems its not possible. seems that Check does not allow you to add a AjaxFormComponentUpdatingBehavior

Wicket: how to use the BodyTagAttributeModifier class?

大城市里の小女人 提交于 2019-12-24 09:03:05
问题 i'm trying to dynamically add the class attribute to the body tag, and i came across this class. but i can't seem to understand how to use this class. i have something like this in my page class (or panel class, as i tried with that too): add(new BodyTagAttributeModifier("class", "homepage", this)); this doesn't even compile, saying there's something wrong with the 2nd parameter. but i think String is automatically considered a Model in wicket, like the Label class. am i missing something

Wicket TextField<BigDecimal> which by default shows 4 decimals but allows (easily) editing the exact value

故事扮演 提交于 2019-12-24 05:22:11
问题 We need to support high precision for certain numbers (interest rates) in an application, but we'd still like to show them rounded to 4 decimal places by default. So, in a table, some cells contain rates in a TextField<BigDecimal> where user can enter a value with any precision, but which shows the value with 4 decimal points. This is done with a custom BigDecimal converter (as documented in this answer). We also have a simple tooltip (title attribute) in place, showing the exact value (when

Wicket TextField<BigDecimal> which by default shows 4 decimals but allows (easily) editing the exact value

删除回忆录丶 提交于 2019-12-24 05:21:12
问题 We need to support high precision for certain numbers (interest rates) in an application, but we'd still like to show them rounded to 4 decimal places by default. So, in a table, some cells contain rates in a TextField<BigDecimal> where user can enter a value with any precision, but which shows the value with 4 decimal points. This is done with a custom BigDecimal converter (as documented in this answer). We also have a simple tooltip (title attribute) in place, showing the exact value (when