• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

The field type "select+multi" does not work, albeit there is partial code support in Form.pm. The patch below does the rest:

*** Form.pm~   Thu Jul 20 03:18:11 2006
--- Form.pm   Sun Aug  6 08:45:38 2006
***************
*** 476,487 ****
                                  -name => $name,
                                  -default => "\n".$value );
  
!     } elsif( $type eq 'select' ) {
          $options = $fieldDef->{value};
          ASSERT( ref( $options )) if DEBUG;
          my $choices = '';
          foreach $item ( @$options ) {
!             $selected = ( $item eq $value );
              $item =~ s/<nop/&lt\;nop/go;
              if( $selected ) {
                  $choices .= CGI::option({ selected=>'selected' }, $item );
--- 476,487 ----
                                  -name => $name,
                                  -default => "\n".$value );
  
!     } elsif( $type =~ /select/ ) {
          $options = $fieldDef->{value};
          ASSERT( ref( $options )) if DEBUG;
          my $choices = '';
          foreach $item ( @$options ) {
!        $selected = ( $value =~ /(^|,\s*)$item(\s*,|$)/ );
              $item =~ s/<nop/&lt\;nop/go;
              if( $selected ) {
                  $choices .= CGI::option({ selected=>'selected' }, $item );
***************
*** 489,495 ****
                  $choices .= CGI::option( $item );
              }
          }
!         $value = CGI::Select( { name=>$name, size=>$size }, $choices );
  
      } elsif( $type =~ /^checkbox/ ) {
          $options = $fieldDef->{value};
--- 489,499 ----
                  $choices .= CGI::option( $item );
              }
          }
!    if ( $type =~ /\+multi/ ) {
!      $value = CGI::Select( { name=>$name, multiple=>undef, size=>$size }, $choices );
!    } else {
!      $value = CGI::Select( { name=>$name, size=>$size }, $choices );
!    }
  
      } elsif( $type =~ /^checkbox/ ) {
          $options = $fieldDef->{value};

-- TW

Any reason why you do not check in this code change to SVN?

Are you not sure about the fix? Or do you not have access to the core?

-- KJL

I have been running this on our site, so I am sure. I just wanted to get feedback whether this is desired... Maybe there is some weird reason why the code did not get finished that I don't understand... --TW

Maybe have a look at the TWiki:Plugins.ExtendedSelectPlugin which has even more really useful code that cold go in here.

-- MD

Excellent suggestion. This plugin is a rather small, but very usefull enhancement to TWikiForms, and can be made slightly more consistent when integrated. The only feature I wonder about is "select+shrink". --TW


Finally got around to doing this. Handled shrink rather differently, using a range on the size (a solution not available to plugins).

CC

4.1.0 released

KJL

ItemTemplate
Summary Multiselect for forms does not work
ReportedBy TWiki:Main.ThomasWeigert
Codebase 4.0.2, ~twiki4
SVN Range TWiki-4.1-beta1, Mon, 24 Jul 2006, build 11161
AppliesTo Engine
Component

Priority Normal
CurrentState Closed
WaitingFor

Checkins 11620 11621 11623
TargetRelease minor
Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r12 - 2007-01-16 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback