populateItem(...) {
   ...
   TestForm.this.add(new TestFormValidator(checkbox, choice));
}

should do the trick.

Martijn

On 6/23/06, itsliang <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have a form that uses ListView to generate some form components, but I
> don't know how to use a form validator to validate those nested components.
> Here is the example:
>
> public class TestForm extends Form {
>
>         public TestForm(String arg0) {
>                 ListView lv = new ListView("list") {
>                         protected void populateItem(ListItem item) {
>                                 CheckBox checkBox = new CheckBox("check");
>                                 item.add(checkBox);
>                                 DropDownChoice choice = new 
> DropDownChoice("choice");
>                                 item.add(choice);
>                         }
>                 };
>         }
>
>         private class TestFormValidator extends AbstractFormValidator {
>
>                 private final FormComponent[] formComponents;
>
>                 public TestFormValidator(FormComponent checkBox, 
> FormComponent choice) {
>                         this.formComponents = new FormComponents[] {checkBox, 
> choice};
>                 }
>
>                 public FormComponent[] getDependentFormComponents() {
>                 }
>
>                 public void validate(Form arg0) {
>                 }
>
>         }
>
> }
>
> Can anybody tell me how to add both checkBox component and choice component
> into TestFormValidator?
>
> Regards,
> Chih-liang Chang
> --
> View this message in context: 
> http://www.nabble.com/How-to-add-components-nested-in-the-list-view-to-a-IFormValidator--t1834645.html#a5006956
> Sent from the Wicket - User forum at Nabble.com.
>
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


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

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to