summaryrefslogtreecommitdiff
path: root/framework/Web/UI
diff options
context:
space:
mode:
authorwei <>2006-09-30 01:49:58 +0000
committerwei <>2006-09-30 01:49:58 +0000
commit6b1d87352911e43672b46b7a65a3c90dd8e5b8b1 (patch)
treefb37b6b35d082aeee8f1aa96c0bc8824a74e5922 /framework/Web/UI
parentb64ee49dc56cbbecccadfc7908dd59ffb95fc0ff (diff)
Fixed #403
Diffstat (limited to 'framework/Web/UI')
-rw-r--r--framework/Web/UI/ActiveControls/TActiveListControlAdapter.php30
1 files changed, 27 insertions, 3 deletions
diff --git a/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php b/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php
index 9bdef077..49cb07c8 100644
--- a/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php
+++ b/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php
@@ -44,8 +44,11 @@ class TActiveListControlAdapter extends TActiveControlAdapter implements IListCo
public function setSelectedIndex($index)
{
if($this->canUpdateClientSide())
+ {
+ $this->updateListItems();
$this->getPage()->getCallbackClient()->select(
$this->getControl(), 'Index', $index);
+ }
}
/**
@@ -56,6 +59,7 @@ class TActiveListControlAdapter extends TActiveControlAdapter implements IListCo
{
if($this->canUpdateClientSide())
{
+ $this->updateListItems();
$n = $this->getControl()->getItemCount();
$list = array();
foreach($indices as $index)
@@ -77,8 +81,11 @@ class TActiveListControlAdapter extends TActiveControlAdapter implements IListCo
public function setSelectedValue($value)
{
if($this->canUpdateClientSide())
+ {
+ $this->updateListItems();
$this->getPage()->getCallbackClient()->select(
$this->getControl(), 'Value', $value);
+ }
}
/**
@@ -89,6 +96,7 @@ class TActiveListControlAdapter extends TActiveControlAdapter implements IListCo
{
if($this->canUpdateClientSide())
{
+ $this->updateListItems();
$list = array();
foreach($values as $value)
$list[] = $value;
@@ -104,7 +112,10 @@ class TActiveListControlAdapter extends TActiveControlAdapter implements IListCo
public function clearSelection()
{
if($this->canUpdateClientSide())
+ {
+ $this->updateListItems();
$this->getPage()->getCallbackClient()->select($this->getControl(), 'Clear');
+ }
}
/**
@@ -112,11 +123,14 @@ class TActiveListControlAdapter extends TActiveControlAdapter implements IListCo
*/
public function updateListItems()
{
- if($this->canUpdateClientSide() && $this->getControl()->getHasItems())
+ if($this->canUpdateClientSide())
{
$items = $this->getControl()->getItems();
- if($items instanceof TActiveListItemCollection && $items->getListHasChanged())
- $this->getPage()->getCallbackClient()->setListItems($this->getControl(), $items);
+ if($items instanceof TActiveListItemCollection
+ && $items->getListHasChanged())
+ {
+ $items->updateClientSide();
+ }
}
}
}
@@ -183,6 +197,16 @@ class TActiveListItemCollection extends TListItemCollection
}
/**
+ * Update client-side list items.
+ */
+ public function updateClientSide()
+ {
+ $client = $this->getControl()->getPage()->getCallbackClient();
+ $client->setListItems($this->getControl(), $this);
+ $this->_hasChanged=false;
+ }
+
+ /**
* Inserts an item into the collection.
* The new option is added on the client-side during callback.
* @param integer the location where the item will be inserted.