the extensions is such a great playground to showcase what wicket can do. sure, it's easy enough with wicket to "roll your own" components, but the more suff that's available "out of the box", the more likely users are to pick up and play with wicket.
on that note, i'm still waiting for an ajax enabled tree component.... =)
On 5/26/06, Jonathan Locke <
[EMAIL PROTECTED]> wrote:
awesome! thanks!On 5/26/06, Martijn Dashorst < [EMAIL PROTECTED]> wrote:All,
I just wanted to let you know that I implemented a rating component in wicket-extensions, and it is in the wicket 1.2 branch, as such it will be part of the next Wicket 1.2 maintenance release. It will also be added to the trunk in the near future. If you want to check it out, and see its usage, you'll have to check out the code from SVN, located under
branches/WICKET_1_2/wicket-extensions and
branches/WICKET_1_2/wicket-examples
You can find the example in src/wicket/examples/ajax/builtin/RatingsPage.java
Features of the component:
- use your own icons for the images
- allow a user to vote only once (the implementation is up to you)
- customize the styling
- customizable rating system (it's all in the model, so ratings from 1-10, 1-5, F-A, are all possible)
- label showing the absolute value of the rating (3.7 from 5 votes) can be turned off, or replaced with your own implementation
Example code:
add(new RatingPanel("rating", new PropertyModel(rating, "rating"), 5, new PropertyModel(
rating1, "nrOfVotes"), true)
{
protected boolean onIsStarActive(int star)
{
return RatingsPage.rating1.isActive(star);
}
protected void onRated(int rating, AjaxRequestTarget target)
{
RatingsPage.rating1.addRating(rating);
}
});
I know that Jonathan Locke was anxious to get this component, so Jonathan, this one is for you!
Martijn
--
Download Wicket 1.2 now! Write Ajax applications without touching _javascript_!
-- http://wicketframework.org
