XF 2.3 Can't write value from select to db

Hi guys!
I have stupid problem and can't save value from select to DB in my first addon.
With text and textarea fields I have no problem - everything correct storing in DB.
This is part of XML template with my code:
Code:
<xf:selectrow name="category" value="{$block.block_category}" class="input--inline input--autoSize" >
            <xf:option value="val1" label="" />
            <xf:option value="val2" label="" />
            <xf:option value="val3"  label="" />           
        </xf:selectrow>

And this is a setter:
PHP:
    public function setCategory($category)
    {
        $this->block->block_category = $category;
    }

What's I lost?
 
Correct code for my case - name should be name="block_category":
Code:
<xf:selectrow name="block_category" value="{$block.block_category}" class="input--inline input--autoSize" >
            <xf:option value="val1" label="" />
            <xf:option value="val2" label="" />
            <xf:option value="val3"  label="" />           
        </xf:selectrow>
 
Last edited:
Back
Top Bottom