BUGFIX createTag() on FormField subclasses should use getTabIndex() instead of getTabIndexHTML() as createTag() is responsible for generating the HTML, and all we need is the tabindex value

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62490 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2008-09-16 23:14:31 +00:00
parent 5524225ead
commit 955d500a95
5 changed files with 7 additions and 5 deletions

View File

@ -18,13 +18,14 @@ class AjaxFormAction extends FormAction {
$this->ajaxAction = $ajaxAction ? $ajaxAction : $action;
parent::__construct($action, $title, $form);
}
function Field() {
return $this->createTag('input', array(
'class' => "ajaxAction-$this->ajaxAction action",
'id' => $this->id(),
'type' => 'submit',
'value' => $this->title,
'tabindex' => $this->getTabIndexHTML()
'tabindex' => $this->getTabIndex()
));
}

View File

@ -44,7 +44,7 @@ class AjaxUniqueTextField extends TextField {
'id' => $this->id(),
'name' => $this->Name(),
'value' => $this->Value(),
'tabindex' => $this->getTabIndexHTML(),
'tabindex' => $this->getTabIndex(),
'maxlength' => ($this->maxLength) ? $this->maxLength : null
);

View File

@ -26,7 +26,7 @@ class AutocompleteTextField extends TextField {
'id' => $this->id(),
'name' => $this->name,
'value' => $this->Value(),
'tabindex' => $this->getTabIndexHTML(),
'tabindex' => $this->getTabIndex(),
'size' => $this->maxLength ? min( $this->maxLength, 30 ) : 30
);
if($this->maxLength) $attributes['maxlength'] = $this->maxLength;

View File

@ -17,7 +17,7 @@ class CheckboxFieldDisabled extends CheckboxField {
'class' => $this->extraClass() . " text",
'id' => $this->id(),
'name' => $this->Name(),
'tabindex' => $this->getTabIndexHTML(),
'tabindex' => $this->getTabIndex(),
'checked' => ($this->value) ? 'checked' : false,
'disabled' => 'disabled'
);

View File

@ -19,6 +19,7 @@ class ConfirmedFormAction extends FormAction {
$this->confirmation = $confirmation;
parent::__construct($action, $title, $form);
}
function Field() {
$attributes = array(
'type' => 'submit',
@ -26,7 +27,7 @@ class ConfirmedFormAction extends FormAction {
'id' => $this->id(),
'name' => $this->Name(),
'value' => $this->attrTitle(),
'tabindex' => $this->getTabIndexHTML(),
'tabindex' => $this->getTabIndex(),
'onclick' => "return confirm('$this->confirmation');"
);