Can't there be simply $field instead of $this->getElement($field->shortname) ?