Show values in TDropDownList in PRADO.
Posted
by Muhammad Sajid
on Stack Overflow
See other posts from Stack Overflow
or by Muhammad Sajid
Published on 2010-05-19T09:37:20Z
Indexed on
2010/05/19
9:40 UTC
Read the original article
Hit count: 267
I m new to PRADO, I have a file Home.page with code:
<%@ Title="Contact List" %>
<h1>Contact List</h1>
<a href="<%= $this->Service->constructUrl('insert')%>">Create New Contact</a>
<br/>
<com:TForm>
<com:TDropDownList ID="personInfo">
<com:TListItem Value="value 1" Text="item 1" />
<com:TListItem Value="value 2" Text="item 2" Selected="true" />
<com:TListItem Value="value 3" Text="item 3" />
<com:TListItem Value="value 4" Text="item 4" />
</com:TDropDownList>
</com:TForm>
& Home.php with code
<?php
class Home extends TPage
{
/**
* Populates the datagrid with user lists.
* This method is invoked by the framework when initializing the page
* @param mixed event parameter
*/
public function onInit($param)
{
parent::onInit($param);
// fetches all data account information
$rec = ContactRecord::finder()->findAll();
}
}
?>
the $rec contain array of all values.
Now I want to show all name in Dropdown list. I tried my best but fail. Can anyone help me? Thanks
© Stack Overflow or respective owner