Bugs item #1197005, was opened at 2005-05-06 20:35
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=684975&aid=1197005&group_id=119783

Category: core
Group: 1.0.0-rc2
Status: Open
Resolution: None
Priority: 5
Submitted By: Joseph Toth (weazelb0y)
Assigned to: Nobody/Anonymous (nobody)
Summary: feedback inside Form

Initial Comment:
When I add a feedback panel to a Form and I display the
errors inside the form tags <span wicket:id="errors"
id="errors" class="errors"/>
I get duplicate error messages.  I get "please enter
your email address please enter your email address"

If I move outside the form it works fine.

/*
 * Created on Apr 21, 2005
 *
 * TODO To change the template for this generated file
go to
 * Window - Preferences - Java - Code Style - Code
Templates
 */
package xxx;

import java.util.Arrays;
import java.util.Calendar;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import wicket.markup.html.WebPage;
import wicket.markup.html.form.DropDownChoice;
import wicket.markup.html.form.Form;
import wicket.markup.html.form.RequiredTextField;
import wicket.markup.html.form.model.ChoiceList;
import wicket.markup.html.form.validation.IntegerValidator;
import wicket.markup.html.panel.FeedbackPanel;
import wicket.model.CompoundPropertyModel;

/**
 * @author jtoth
 * 
 */
public class HomePage extends WebPage {

        private static Log log =
LogFactory.getLog(HomePage.class);

        public HomePage() {
                FeedbackPanel feedback = new FeedbackPanel("errors");
                add(feedback);
                add(new RegistrationForm("registrationForm",
                                feedback));
        }

        private final static class RegistrationForm extends Form {

                public RegistrationForm(String id, FeedbackPanel
feedback) {
                        super(id, new CompoundPropertyModel(new
RegistrationFormModel()),
                                        feedback);

                        // Create model of 12 months for drop-down
                        ChoiceList months = new
ChoiceList(Arrays.asList("Jan", "Feb",
                                        "Mar", "Apr", "May", "June", "July", 
"Aug",
"Sept", "Oct",
                                        "Nov", "Dec"));
                        add(new DropDownChoice("month", getModel(), months));

                        // Create model 31 days for drop-down
                        ChoiceList days = new ChoiceList();
                        for (int i = 1; i <= 31; i++) {
                                days.add(i);
                        }
                        add(new DropDownChoice("day", getModel(), days));

                        // Create model with last 100 years for drop-down
                        ChoiceList years = new ChoiceList();
                        int year = Calendar.getInstance().get(Calendar.YEAR);
                        for (int i = 0; i <= 100; i++) {
                                years.add(year - i);
                        }
                        add(new DropDownChoice("year", getModel(), years));

                        add(new RequiredTextField("emailAddress"));

                        // emailAddressField.add(new
EmailAddressPatternValidator());
                        // emailAddressField.setFValidateCode("3");
                        // emailAddressField.setFValidateMsg("BEARS!!!");

                        // add(new RadioChoice("genderId", model, c) );

                        // new DropDownChoice("localeSelect", new
PropertyModel(this,
                        // "locale"), LOCALES)

                        add(new RequiredTextField("postalCode", getModel())
                                        .add(IntegerValidator.range(1, 10)));
                }

                public void onSubmit() {
                        RegistrationFormModel registrationModel =
(RegistrationFormModel) getModelObject();
                        log.debug(registrationModel);
                }
        }
}


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=684975&aid=1197005&group_id=119783


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to