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
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 RequiredTextField 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