power-media / prado3

Automatically exported from code.google.com/p/prado3
Other
0 stars 0 forks source link

Error TClientScript 'ctl0$ctl1' must be enclosed within TForm. #409

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Download last version from http://prado3.googlecode.com/svn/trunk
2. Excecute any prado application with the new framework
3. I get the next error

TClientScript 'ctl0$ctl1' must be enclosed within TForm.

/framework/Web/UI/TPage.php (971)

0960:         return $this->_inFormRender;
0961:     }
0962: 
0963:     /**
0964:      * Ensures the control is rendered within a form.
0965:      * @param TControl the control to be rendered
0966:      * @throws TConfigurationException if the control is outside of the 
form
0967:      */
0968:     public function ensureRenderInForm($control)
0969:     {
0970:         if(!$this->getIsCallback() && !$this->_inFormRender)
0971:             throw new 
TConfigurationException('page_control_outofform',get_class($control), $control 
? $control->getUniqueID() : null);
0972:     }
0973: 
0974:     /**
0975:      * @internal This method is invoked by TForm at the beginning of its 
rendering
0976:      */
0977:     public function beginFormRender($writer)
0978:     {
0979:         if($this->_formRendered)
0980:             throw new TConfigurationException('page_form_duplicated');
0981:         $this->_formRendered=true;
0982:         
$this->getClientScript()->registerHiddenField(self::FIELD_PAGESTATE,$this->getCl
ientState());
0983:         $this->_inFormRender=true;

Stack Trace

#0 /var/www/prado-3.1.11/framework/Web/UI/TClientScriptManager.php(723): 
TPage->ensureRenderInForm(Object(TClientScript))
#1 /var/www/prado-3.1.11/framework/Web/UI/WebControls/TClientScript.php(128): 
TClientScriptManager->flushScriptFiles(Object(THtmlWriter), 
Object(TClientScript))
#2 /var/www/prado-3.1.11/framework/Web/UI/TControl.php(1550): 
TClientScript->render(Object(THtmlWriter))
#3 /var/www/prado-3.1.11/framework/Web/UI/TControl.php(1581): 
TControl->renderControl(Object(THtmlWriter))
#4 /var/www/prado-3.1.11/framework/Web/UI/TControl.php(1563): 
TControl->renderChildren(Object(THtmlWriter))
#5 /var/www/prado-3.1.11/framework/Web/UI/TControl.php(1550): 
TControl->render(Object(THtmlWriter))
#6 /var/www/prado-3.1.11/framework/Web/UI/TControl.php(1581): 
TControl->renderControl(Object(THtmlWriter))
#7 /var/www/prado-3.1.11/framework/Web/UI/TControl.php(1563): 
TControl->renderChildren(Object(THtmlWriter))
#8 /var/www/prado-3.1.11/framework/Web/UI/TControl.php(1550): 
TControl->render(Object(THtmlWriter))
#9 /var/www/prado-3.1.11/framework/Web/UI/TPage.php(237): 
TControl->renderControl(Object(THtmlWriter))
#10 /var/www/prado-3.1.11/framework/Web/UI/TPage.php(203): 
TPage->processNormalRequest(Object(THtmlWriter))
#11 /var/www/prado-3.1.11/framework/Web/Services/TPageService.php(524): 
TPage->run(Object(THtmlWriter))
#12 /var/www/prado-3.1.11/framework/Web/Services/TPageService.php(470): 
TPageService->runPage(Object(Home), Array)
#13 /var/www/prado-3.1.11/framework/TApplication.php(1189): TPageService->run()
#14 /var/www/prado-3.1.11/framework/TApplication.php(406): 
TApplication->runService()
#15 /home/jaime/Documentos/Tu Mascota Web/Fuentes/TMW/index.php(23): 
TApplication->run()
#16 {main}

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by jaimea.g...@gmail.com on 20 Jun 2012 at 11:59

GoogleCodeExporter commented 8 years ago
As the error message suggests, you need to put enclose any TClientScript inside 
a TForm in order to make them work properly. I suppose you already checked for 
that, so the problem could either be caused by having other forms in the same 
page or by some parsing error in the page. Can you post a testcase application 
showing the error?

Original comment by ctrlal...@gmail.com on 25 Jun 2012 at 10:19

GoogleCodeExporter commented 8 years ago

Original comment by ctrlal...@gmail.com on 25 Jun 2012 at 1:56

GoogleCodeExporter commented 8 years ago
Closing for lack of feedback, please reopen if necessary

Original comment by ctrlal...@gmail.com on 3 Jul 2012 at 6:47