[Wicket-user] Re: Rating component added to wicket 1.2 branch

2006-05-26 Thread Martijn Dashorst
Here's a sceenshot of the rating panel.MartijnOn 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-examplesYou can find the example in src/wicket/examples/ajax/builtin/RatingsPage.javaFeatures 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 implementationExample 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


-- Download Wicket 1.2 now! Write Ajax applications without touching _javascript_!-- http://wicketframework.org


rating.gif
Description: GIF image


Re: [Wicket-user] Re: Rating component added to wicket 1.2 branch

2006-05-26 Thread Johan Compagner
2.0?On 5/26/06, Martijn Dashorst [EMAIL PROTECTED] wrote:
Here's a sceenshot of the rating panel.MartijnOn 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-examplesYou can find the example in src/wicket/examples/ajax/builtin/RatingsPage.javaFeatures 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 implementationExample 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


-- Download Wicket 1.2 now! Write Ajax applications without touching _javascript_!-- 
http://wicketframework.org




[Wicket-user] Re: Rating component added to wicket 1.2 branch

2006-05-26 Thread Jonathan Locke
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-examplesYou can find the example in src/wicket/examples/ajax/builtin/RatingsPage.javaFeatures 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 implementationExample 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





Re: [Wicket-user] Re: Rating component added to wicket 1.2 branch

2006-05-26 Thread Andrew Berman
What does the HTML and _javascript_ look like? I just wrote a Ratings class (requires Prototype) in _javascript_ which does it similarly to how Yahoo's ratings work, except that when you mouse over the star it not only changes colors, but it also has a tooltip with the meaning of the star. It uses hidden radio buttons for the form so clicking a rating changes the radio button and then in Wicket I just use a standard RadioChoice object.
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-examplesYou can find the example in src/wicket/examples/ajax/builtin/RatingsPage.javaFeatures 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 implementationExample 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







Re: [Wicket-user] Re: Rating component added to wicket 1.2 branch

2006-05-26 Thread Andrew Berman
I just looked in SVN at your code. My solution is a bit simpler and I'm willing to donate it if you want. It uses pure CSS to change the star, no AJAX involved at all. You can customize the image by changing the CSS since it uses background-image. It uses one image...it's based on this:
http://komodomedia.com/blog/index.php/2006/01/09/css-star-rating-part-deux/On 5/26/06, 
Andrew Berman [EMAIL PROTECTED] wrote:
What does the HTML and _javascript_ look like? I just wrote a Ratings class (requires Prototype) in _javascript_ which does it similarly to how Yahoo's ratings work, except that when you mouse over the star it not only changes colors, but it also has a tooltip with the meaning of the star. It uses hidden radio buttons for the form so clicking a rating changes the radio button and then in Wicket I just use a standard RadioChoice object.
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-examplesYou can find the example in src/wicket/examples/ajax/builtin/RatingsPage.javaFeatures 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 implementationExample 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









Re: [Wicket-user] Re: Rating component added to wicket 1.2 branch

2006-05-26 Thread Martijn Dashorst
It is very basic in that it doesn't highlight on mouse overs, and no tooltip. There is no dependency on libraries other than Wicket and no _javascript_ trickery involved. You're welcome to supply additional functionality if you wish :-)
You can see the markup here (along with the java file and resouces):http://svn.sourceforge.net/viewcvs.cgi/wicket/branches/WICKET_1_2/wicket-extensions/src/java/wicket/extensions/
MartijnOn 5/26/06, Andrew Berman [EMAIL PROTECTED] wrote:
What does the HTML and _javascript_ look like? I just wrote a Ratings class (requires Prototype) in _javascript_ which does it similarly to how Yahoo's ratings work, except that when you mouse over the star it not only changes colors, but it also has a tooltip with the meaning of the star. It uses hidden radio buttons for the form so clicking a rating changes the radio button and then in Wicket I just use a standard RadioChoice object.
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-examplesYou can find the example in src/wicket/examples/ajax/builtin/RatingsPage.javaFeatures 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 implementationExample 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






-- Download Wicket 1.2 now! Write Ajax applications without touching _javascript_!-- http://wicketframework.org


Re: [Wicket-user] Re: Rating component added to wicket 1.2 branch

2006-05-26 Thread Martijn Dashorst
The ajax is primarily used to submit the score. The refresh of the component(s) is an additional bonus. And it doesn't work for 6-10 star rating systems, or alternatives such as F-A.Also, it is possible to have different pictures for star 1, 2, 3, 4, 5, 6, 7 and so forth, depending on how far you want to go.
I like the tricks in the mentioned article, especially the way he has made it possible to show half of a star. However, I hardly find it simpler. There's some serious CSS hackery going on, and if you were to customize it to show other images than those provided by Wicket, you'll have to implement a lot of CSS yourself again.
The ajax return is still necessary, to update the width of the current-rating list item. So you won't gain much there either.Martijn
On 5/26/06, Andrew Berman [EMAIL PROTECTED] wrote:


I just looked in SVN at your code. My solution is a bit simpler and I'm willing to donate it if you want. It uses pure CSS to change the star, no AJAX involved at all. You can customize the image by changing the CSS since it uses background-image. It uses one image...it's based on this:
http://komodomedia.com/blog/index.php/2006/01/09/css-star-rating-part-deux/
On 5/26/06, 
Andrew Berman [EMAIL PROTECTED] wrote:



What does the HTML and _javascript_ look like? I just wrote a Ratings class (requires Prototype) in _javascript_ which does it similarly to how Yahoo's ratings work, except that when you mouse over the star it not only changes colors, but it also has a tooltip with the meaning of the star. It uses hidden radio buttons for the form so clicking a rating changes the radio button and then in Wicket I just use a standard RadioChoice object.
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-examplesYou can find the example in src/wicket/examples/ajax/builtin/RatingsPage.javaFeatures 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 implementationExample 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








-- Download Wicket 1.2 now! Write Ajax applications without touching _javascript_!-- 

http://wicketframework.org




Re: [Wicket-user] Re: Rating component added to wicket 1.2 branch

2006-05-26 Thread Ryan Sonnek
This is too cool!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-examplesYou can find the example in src/wicket/examples/ajax/builtin/RatingsPage.javaFeatures 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 implementationExample 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







Re: [Wicket-user] Re: Rating component added to wicket 1.2 branch

2006-05-26 Thread Andrew Berman
Fair enoughThe way I did it has far less CSS hacking, but it still requires some CSS knowledgeOn 5/26/06, Martijn Dashorst 
[EMAIL PROTECTED] wrote:The ajax is primarily used to submit the score. The refresh of the component(s) is an additional bonus. And it doesn't work for 6-10 star rating systems, or alternatives such as F-A.
Also, it is possible to have different pictures for star 1, 2, 3, 4, 5, 6, 7 and so forth, depending on how far you want to go.
I like the tricks in the mentioned article, especially the way he has made it possible to show half of a star. However, I hardly find it simpler. There's some serious CSS hackery going on, and if you were to customize it to show other images than those provided by Wicket, you'll have to implement a lot of CSS yourself again.
The ajax return is still necessary, to update the width of the current-rating list item. So you won't gain much there either.Martijn

On 5/26/06, Andrew Berman [EMAIL PROTECTED] wrote:



I just looked in SVN at your code. My solution is a bit simpler and I'm willing to donate it if you want. It uses pure CSS to change the star, no AJAX involved at all. You can customize the image by changing the CSS since it uses background-image. It uses one image...it's based on this:
http://komodomedia.com/blog/index.php/2006/01/09/css-star-rating-part-deux/
On 5/26/06, 
Andrew Berman [EMAIL PROTECTED] wrote:




What does the HTML and _javascript_ look like? I just wrote a Ratings class (requires Prototype) in _javascript_ which does it similarly to how Yahoo's ratings work, except that when you mouse over the star it not only changes colors, but it also has a tooltip with the meaning of the star. It uses hidden radio buttons for the form so clicking a rating changes the radio button and then in Wicket I just use a standard RadioChoice object.
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-examplesYou can find the example in src/wicket/examples/ajax/builtin/RatingsPage.javaFeatures 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 implementationExample 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








-- Download Wicket 1.2 now! Write Ajax applications without touching _javascript_!-- 


http://wicketframework.org