Changeset 1023

Show
Ignore:
Timestamp:
07/18/08 23:18:09 (4 months ago)
Author:
laurentj
Message:

ticket #641: jFormsControlDataSource should not define defaultValue=array as it is not valid on a menulist

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/forms/jFormsCompiler_jf_1_0.class.php

    r907 r1023  
    398398            $hasSelectedValues = true; 
    399399        }elseif(isset($attributes['selectedvalue'])){ 
    400             $source[]='$ctrl->defaultValue=array(\''. str_replace("'","\\'", (string)$control['selectedvalue']) .'\');'; 
     400            if ($controltype == 'menulist' ||  $controltype == 'radiobuttons') { 
     401                $source[]='$ctrl->defaultValue=\''. str_replace("'","\\'", (string)$control['selectedvalue']) .'\';'; 
     402            } else { 
     403                $source[]='$ctrl->defaultValue=array(\''. str_replace("'","\\'", (string)$control['selectedvalue']) .'\');'; 
     404            } 
    401405            $hasSelectedValues = true; 
    402406            unset($attributes['selectedvalue']); 
  • trunk/lib/jelix/forms/jFormsControl.class.php

    r906 r1023  
    440440class jFormsControlRadiobuttons extends jFormsControlDatasource { 
    441441    public $type="radiobuttons"; 
     442    public $defaultValue=''; 
    442443 
    443444    function check($form){ 
     
    456457class jFormsControlMenulist extends jFormsControlRadiobuttons { 
    457458    public $type="menulist"; 
    458 
    459  
    460  
     459    public $defaultValue=''; 
     460
     461 
     462 
Download in other formats: Unified Diff Zip Archive