Archive for category Wicket

Wicket Tutorial, part 7 – editing and removing item locations

Tags: , ,

Welcome back to our practical Wicket tutorial series. I apologize for long break after last post (shame on me as it was published more than 1,5 month ago) but I had many unplanned things with higher priority: Wicket demo appplication  on 33rdDegree conference to prepare, a conference itself and most time-consuming one, I damaged knee ligament during football match and after that everyday for three weeks I was driving to the hospital for rehabilitation so day became too short to write something here. But now everything seems to be ok and I have some spare time to continue Wicket tutorial subject.

Today we will add two new features: editing and removing locations from our application. Currently we don’t have any items connected with locations so deleting shouldn’t be too complicated. Later on, when we add some items, we will have to rework this functionality but now it shouldn’t bother us too much.

Continue reading this post …


Be Sociable, Share!

Our short Wicket talk at Web frameworks shootout, 33rdDegree conference

Tags: , ,

If you, by any chance, are one of the 33rdDegree conference participants and you are interested in developing web applications using Java/JVM environment you should also be interested in one of the BOF sessions on Wednesday during the conference: Web frameworks shootout.

We (Paul Szulc with me as a support) will be presenting Wicket framework and its nice features which help Java Developers to build web applications easily and with a lot of fun! :) At this BOF session you will have an opportunity to see more short and concise presentations of the following new and cool web frameworks: Play, Lift, and Grails,  so a lot of new knowledge are waiting there for you :)

Of course if you want to talk with me about Wicket or anything else, don’t hesitate and catch me anytime during 33rdDegree.


Be Sociable, Share!

Wicket tutorial series – building web application from scratch

Tags: , ,

This post aggregates the  series of Wicket tutorial articles from this blog. But as this tutorial is still not finished and new posts will be published in the near future, please return here again to find new parts or (simpler) just add my RSS to your reader.

Wicket tutorial series

    1. Wicket Tutorial, part 1 – setting up project with Spring 3, JPA 2 and MySQL

    2. Wicket Tutorial, part 2 – adding common layout to the project

    3. Wicket Tutorial, part 3 – first form in our application

    4. Wicket Tutorial, part 4 – custom validator for unique entity name

    5. Wicket tutorial, part 5 – generic unique entity validator

    6. Wicket Tutorial, part 6 – listing locations in a simple manner

    7. Wicket Tutorial, part 7 – editing and removing item locations

 

 

You might also be interested in post Wicket – useful links with other good tutorials, presentations and tools I found useful while learning and using Wicket.


Be Sociable, Share!

Wicket Tutorial, part 6 – listing locations in a simple manner

Tags: , , ,

Today we will add simple listing view for locations added to the database in previous posts.  I said ‘simple’ as there are some more sophisticated ways to show many items using Wicket but probably we will not have many locations to show in our application so simple view without pagination should be ok. More complicated way (DataTable component) will be covered in the future when we will add ‘listing items’ feature’.

Continue reading this post …


Be Sociable, Share!

Wicket tutorial, part 5 – generic unique entity validator

Tags: , , ,

As I promised in the previous post, today we will focus on transforming our unique name validator in Wicket to generic one. So now, let’s simply list what we are going to achieve;

  • validator should validate any entity object in our project
  • validator should check unique value of any property from validated object
  • error message should be generic too but customization should be easy

Continue reading this post …


Be Sociable, Share!

Wicket Tutorial, part 4 – custom validator for unique entity name

Tags: , , ,

Welcome back to our Wicket tutorial series! :) As I mentioned in previous post, today we will concentrate on building validator stopping user from adding item location with non-unique name. At first we will start with non-generic but working validator and then we will try to make is as flexible as possible. Ok, so let’s write some code!

Problem

As you might remember, currently we have Wicket form with basic validation checking existence of name field and whether its length is in proper range or not:

		Form<AddLocationPage> addLocationForm = new Form<AddLocationPage>("addLocationForm",
				new CompoundPropertyModel<AddLocationPage>(this));
		add(addLocationForm);

		Label nameLabel = new Label("nameLabel", "Location name");
		addLocationForm.add(nameLabel);

		RequiredTextField<String> nameField = new RequiredTextField<String>("name");
		nameField.add(LengthBetweenValidator.lengthBetween(MIN_LOCATION_NAME_LENGTH, MAX_LOCATION_NAME_LENGTH));
		addLocationForm.add(nameField);

		Button submitButton = new Button("submitButton") {
			@Override
			public void onSubmit() {
				Location location = new Location(name);
				locationService.save(location);

				getSession().info("Location added successfully");
				setResponsePage(LocationsPage.class);
			}
		};
		addLocationForm.add(submitButton);

Continue reading this post …


Be Sociable, Share!