Hi Carl

After I used Checkboxgroup in my customized element, it appears that name, id and attributes_xml are missing. I am not sure if I have done something wrong, below is the code:

sub setup {
   my $self = shift;
   $self->container_tag( 'div' );
   $self->attributes( { class => 'scrollable' } );


   my $c = $self->form->stash->{ context };

   my $units = $c->model( 'Activities::Unit' )->search();

   my %checked = eval {
       map { $_->unit->unit_id => $_->unit->unit_id }
           $c->stash->{ activities }->outcomes;
   };

   $self->options(
       [   map {
               {
                   value => $_->unit_id,
                   label => join( ' -- ', $_->subject->name, $_->name ),
                   default => $checked{ $_->unit_id } || undef,
                   name => 'subject',
                   id   => 'subject_' . $_->unit_id,
                   attributes_xml => {
                       onClick =>
"if ( this.checked == true) {showOutcomes(this.id)} else {removeBox(this.id)}"
                   }
               }
               } $units->all
       ]
   );

   return $self->next::method( @_ );
}


Please advise.  Thanks

Ke Wei

_______________________________________________
HTML-FormFu mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to