From 0fb75d64f8dbcc98b4c06e7556125b94bf612819 Mon Sep 17 00:00:00 2001 From: Jens Klaer Date: Wed, 20 May 2015 15:54:33 +0200 Subject: made TJuiControl options changeable during callback - TJuiControlOptions are now stored in viewstate and tracked by the new TJuiCallbackPageStateTracker class extending the default viewstate tracker class - TJuiCallbackPageStateTracker registers endscripts automatically for each changed option for the clientside changes, added some normalized getter for that --- framework/Web/UI/JuiControls/TJuiAutoComplete.php | 24 ++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'framework/Web/UI/JuiControls/TJuiAutoComplete.php') diff --git a/framework/Web/UI/JuiControls/TJuiAutoComplete.php b/framework/Web/UI/JuiControls/TJuiAutoComplete.php index f6663057..768f041e 100644 --- a/framework/Web/UI/JuiControls/TJuiAutoComplete.php +++ b/framework/Web/UI/JuiControls/TJuiAutoComplete.php @@ -101,15 +101,33 @@ class TJuiAutoComplete extends TActiveTextBox implements INamingContainer, IJuiO $this->setAdapter(new TJuiControlAdapter($this)); } + /** + * @return string the name of the jQueryUI widget method + */ + public function getWidget() + { + return 'autocomplete'; + } + + /** + * @return string the clientid of the jQueryUI widget element + */ + public function getWidgetID() + { + return $this->getClientID(); + } + /** * Object containing defined javascript options * @return TJuiControlOptions */ public function getOptions() { - static $options; - if($options===null) - $options=new TJuiControlOptions($this); + if (($options=$this->getViewState('JuiOptions'))===null) + { + $options=new TJuiControlOptions($this); + $this->setViewState('JuiOptions', $options); + } return $options; } -- cgit v1.2.3