XF 2.0 Having issues with Xhr on one of my forms...

Jaxel

Well-known member
I've got a form on my page:
Code:
<xf:form action="{{ link('ewr-medio/add-keyword', $media) }}" class="block" ajax="true"
        data-xf-init="medio-tagger" data-replace="#media-keylinks">
    <xf:textbox name="keywords" ac="single" data-acurl="{{ link('ewr-medio/find-keyword') }}" />
</xf:form>

That executes my function:
Code:
public function actionAddKeyword(ParameterBag $params)
{
    if ($this->request()->isXhr())
    {
        return $this->view('EWR\Medio:Media\Keylinks', 'EWRmedio_media_keylinks', [
            'keylinks' => $this->getKeyLinkRepo()->findKeyLink()->fetch(),
        ]);
    }
    else
    {
        return $this->redirect($this->buildLink('ewr-medio', $media));
    }
}

Unfortunately, in my medio-tagger script, the contents of the returned HTML are of the "else" statement in my function, instead of the Xhr section.

What did I miss here?
 
Top Bottom