Where do you set the value of the model?
It looks to me like you need to get rid of rating double in the panel
and use that as the model value.
Something like this:
protected boolean onIsStarActive(int star)
{
return star < ((int)(model_rating.getObject()+ 0.5));
}
protected void onRated(int rating, AjaxRequestTarget target)
{
model_rating.setObject(rating)
}
Note i skipped all casts / type checks etc.
Try reading
http://www.theserverside.com/tt/articles/content/IntroducingApacheWicket/article.html
Maurice
On Fri, Apr 4, 2008 at 10:21 AM, Fabien D. <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I have a problem to get back the value of a rating panel. It displays well.
>
> This is the déclaration :
>
> RatingPanel rating = new
> RatingPanel(str_rating,model_rating,5,true){
> private double rating = 0;
>
> 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;
> }
> };
> rating.setRatingLabelVisible(false);
> this.form_evaluation.add(rating);
>
> And in the method on submit of my form :
> protected void onSubmit() {
> log.info(""+model_rating.getObject());
> setResponsePage(new
> ProjetPage("ajoutinftechnique"));
> }
>
> But the value is null, so how i can get back the value of this special panel
> ?
>
> Thank you in advance for your help.
>
>
> --
> View this message in context:
> http://www.nabble.com/Get-back-value-for-a-RatingPanel-tp16488179p16488179.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]