Re: CheckBoxMultipleChoice used in a Wizard Panel

2012-05-17 Thread nunofaria11
Hi there, 
I am having the same problem you had regarding a CheckBoxMultipleChoice used
in a Wizard Panel: the list within the model containing the chosen items is
always empty. Were you able to solve that problem? And if so, how?

Thanks
Nuno

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-a-form-field-at-run-time-is-it-possible-tp1877626p4642679.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: CheckBoxMultipleChoice used in a Wizard Panel

2010-01-19 Thread Igor Vaynberg
if there were no validation errors the selected list should be
available in the model.

-igor

On Tue, Jan 19, 2010 at 5:48 AM, Riccardo Trombini
riccardo.tromb...@csnc.ch wrote:
 Hi !

 I am having problems with a CheckBoxMultipleChoice which I use in a
 DynamicWizardStep. I am not able to access the list with the checked
 boxes. I try to access on the list by adding an AbstractFormValidator
 and overwriting the method validate.


 public final class DetailWriteArticleStep extends
 CustomDynamicWizardStep {

        private IDynamicWizardStep nextStep;
        private RequiredTextFieldString titel;

        public DetailWriteArticleStep(...) {
                ...

                final Input input = new Input(article.getCategory());
                CheckBoxMultipleChoice categoriySelect = new
 CheckBoxMultipleChoice(choices,
                                access.getCategories(),
                                new ChoiceRenderer(categoryName,
 categoryId));
        categoriySelect.setDefaultModelObject(input);
                add(categoriySelect);
                System.out.println( input.choices.size());

                add(new AbstractFormValidator() {
                public void validate(Form? form) {

 System.out.println(article.getCategory().size());
                        }
                }
 }


 public class Input implements IClusterable{

    /** the selected choices. */
    public List choices = new ArrayList();

    /** adds pre-selected items to the choices list */
    public Input(Article article){
        for(int i = 0 ; i  article.getCategory().size() ; i++){
                this.choices.add(article.getCategory().get(i));
        }
    }

    /** adds pre-selected items to the choices list */
    public Input(ArrayList list){
        for(int i = 0 ; i  list.size() ; i++){
                this.choices.add(list.get(i));
        }
    }
 }



 I also tried to add the Object article with the property Category as
 the propertyModel of the CheckBoxMultipleChoice but this worked
 neighter. The size of the List was always 0.

 Can anyone help me ?

 Thx !

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org