You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Fabien D." <du...@hotmail.com> on 2008/05/05 15:34:10 UTC
RatingPanel and ResetLink
Hi everybody,
I try to add a reset link for the rate to my RatingPanel.
I have done this :
# Reset rating
And in my class :
final RatingPanel rating = new RatingPanel("rating1", new
Model(),5,true){
private static final long serialVersionUID = 1L;
private Integer rating = 0;
public void setRate(Integer rate){
rating = rate;
}
protected String getActiveStarUrl(int iteration){
return WICKETSTAR1;
}
protected String getInactiveStarUrl(int iteration){
return WICKETSTAR0;
}
protected boolean onIsStarActive(int star)
{
return star < ((int)(rating + 0.5));
}
protected void onRated(int rating, AjaxRequestTarget target)
{
this.rating = rating;
model.setObject(this.rating);
}
};
rating.setRatingLabelVisible(false);
rating.add(new Link("reset1"){
private static final long serialVersionUID = 1L;
public void onClick(){
}
});
Moreover for the method onClick I don't know how to reset the rate because
my public method setRate is not accissible... I want to try this :
rating.getModel().setObject(0);
If you can help me, thank you in advance
--
View this message in context: http://www.nabble.com/RatingPanel-and-ResetLink-tp17061505p17061505.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: RatingPanel and ResetLink
Posted by "Fabien D." <du...@hotmail.com>.
I have forgot to do this reset link, I have just done this :
protected void onRated(int rating, AjaxRequestTarget target)
{
if (this.rating == rating)
this.rating = this.rating-1;
else
this.rating = rating;
model.setObject(this.rating);
}
--
View this message in context: http://www.nabble.com/RatingPanel-and-ResetLink-tp17061505p17064195.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org