<?php
class BeltEditPanel extends BeltEditPanelBase {
// Specify the Location of the Template (feel free to modify) for this Panel
protected $strTemplate = 'generated/BeltEditPanel.tpl.php';
public $txtColor;
public function __construct($objParentObject, $strClosePanelMethod, $objBelt = null, $strControlId = null) {
try {
parent::__construct($objParentObject, $strClosePanelMethod, $objBelt, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->txtColor_Create();
$this->btnSave_Create();
}
protected function txtColor_Create() {
$this->txtColor = new QTextBox($this);
$this->txtColor->Name = QApplication::Translate('Color');
$this->txtColor->Text = $this->objBelt->Color;
$this->txtColor->Required = true;
$this->txtColor->MaxLength = Belt::ColorMaxLength;
QApplication::ExecuteJavaScript(sprintf("document.getElementById('%s').focus()", $this->txtColor->ControlId));
}
}
?>
Im trying to focus the marker on the textbox but its not working. I get an error everytime. Any thoughts?
The Wierd thing is that this works no problem if I put the QApplication line in the BeltEditBase however when I override the function I get an error of
document.getElementById(“c12”) has no properties on line 192 in file xxx/xxx/_core/post.js