Class file: RegionDisplay.php
Template file: RegionDisplay.tpl
Template file: Sample1.page
Class file: Sample1.php
Template file: Sample2.page
Class file: Sample2.php
Template file: Sample3.page
Class file: Sample3.php
Template file: Sample4.page
Class file: Sample4.php
Template file: Sample5.page
Class file: Sample5.php

/Controls/Samples/TRepeater/Sample4.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
 
Prado::using('System.Collections.TDummyDataSource');
 
class Sample4 extends TPage
{
    public function onLoad($param)
    {
        parent::onLoad($param);
        if(!$this->IsPostBack)
        {
            // use a dummy data source to create 3 repeater items
            $this->Repeater->DataSource=new TDummyDataSource(3);
            $this->Repeater->dataBind();
        }
    }
 
    public function itemCreated($sender,$param)
    {
        // $param->Item refers to the newly created repeater item
        $param->Item->Style="width:300px; margin:10px; margin-left:0px";
    }
 
    public function buttonClicked($sender,$param)
    {
        $links=array();
        foreach($this->Repeater->Items as $textBox)
        {
            if($textBox->Text!=='')
                $links[]=$textBox->Text;
        }
        $this->Repeater2->DataSource=$links;
        $this->Repeater2->dataBind();
    }
}
 
?>