Show
Ignore:
Timestamp:
07/31/05 19:59:27 (3 years ago)
Author:
schst
Message:

Use a RadioGroup? and an Enum element in the example.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/examples/example_datasrc_countries.php

    r267 r278  
    4848            ), 
    4949        ), 
     50        'country2' => array( 
     51            'type' => 'RadioGroup', 
     52            'attributes' => array( 
     53                'required'      =>  'yes', 
     54                'display'       =>  'yes', 
     55                'edit'          =>  'yes', 
     56                'label'         =>  'Area', 
     57                'title'         =>  'Area', 
     58                'style'         =>  'width:200px;', 
     59                'description'   =>  'Choose your country', 
     60                'values'        =>  array(), 
     61            ), 
     62        ), 
    5063    ); 
    5164     
     
    5669    $form->setLocale('de'); 
    5770     
     71 
     72    $countries = &patForms::createDatasource('Countries');   
     73 
    5874    // get the element 
    5975    $el =& $form->getElementByName('country'); 
    60  
    61     $countries = &patForms::createDatasource('Countries'); 
    6276     
    6377    // tell the element to use the datasource object 
    6478    $el->setDataSource($countries); 
    6579 
     80    // get the element 
     81    $el2 =& $form->getElementByName('country2'); 
     82     
     83    // tell the element to use the datasource object 
     84    $el2->setDataSource($countries); 
     85     
    6686    // PROCESS FORM ------------------------------------------------------ 
    6787