New neos ,please help,edit blog and post as the same time

hi,I am new neos dev,also I am a new phper
I have read example kickstart package neos.blog.In the example,we can edit post ,but now I want to edit blog and post .
My code Lick this:
<f:section name=“Content”>
<f:form action=“update” object="{product}" objectName=“product”>



  1. Title
    <f:form.textfield property=“title” id=“title” />
  2.         <li>
                <label for="alias">Alias</label>
                <f:form.textfield property="alias" id="alias" />
            </li>
        
            <li>
                <label for="category">Category</label>
                <f:form.textfield property="category" id="category" />
            </li>
        
            <li>
                <label for="brand">Brand</label>
                <f:form.textfield property="brand" id="brand" />
            </li>
            <f:for each="{product.stocks}"  as="stock">
                <li>
                    <label for="depot">depot</label>
                    <f:form.textfield name="product[stoscks][0][stock][depot]" value="{stock.depot}" id="depot" />
                </li>
                <li>
                    <label for="amount">amount</label>
                    <f:form.textfield  name="product[stoscks][0][stock][amount]" value="{stock.amount}" id="amount" />
                </li>
                <li>
                    <label for="remark">remark</label>
                    <f:form.textfield  name="product[stoscks][0][stock][remark]" value="{stock.remark}" id="remark" />
                </li>
            </f:for> 
            <li>
                <f:form.submit value="Update" />
            </li>
        </ol>
    </f:form>
    

    </f:section>

    when I click update button ,I just updated the product message ,the stock message is still old .how I should do ?
    thanks

Your field names for the stocks seem wrong.

Without knowing your code further the following for each in the template could work. Otherwise you may want to show more of your model.

    <f:for each="{product.stocks}"  as="stock" key="index">
        <li>
            <label for="depot">depot</label>
            <f:form.textfield name="product[stocks][{index}][stock][depot]" value="{stock.depot}" id="depot" />
        </li>
        <li>
            <label for="amount">amount</label>
            <f:form.textfield  name="product[stocks][{index}][amount]" value="{stock.amount}" id="amount" />
        </li>
        <li>
            <label for="remark">remark</label>
            <f:form.textfield  name="product[stocks][{index}][remark]" value="{stock.remark}" id="remark" />
        </li>
    </f:for>

thanks for your help,but I had done like this.The result is

Exception while property mapping for target type “Pim\Product\Domain\Model\Product”, at property path “stocks.0”: Property “stock” was not found in target object of type “Pim\Product\Domain\Model\Stock”.

Nested Exception
Property “stock” was not found in target object of type “Pim\Product\Domain\Model\Stock”.

I show my code to let you know .
my php code
class Product{
/**

  • The stocks contained in this product
  • @ORM\OneToMany(mappedBy=“product”)
  • @ORM\OrderBy({“amount” = “DESC”})
  • @var Collection
    */
    protected $stocks;

public function setStock(Stock $stock){
$this->stocks->add($stock);
}

/**

  • Adds a stock to this product
  • @param Stock $stock
  • @return void
    */
    public function addStock(Stock $stock)
    {
    $this->stocks->add($stock);
    }

/**

  • Removes a stock from this product
  • @param Stock $stock
  • @return void
    */
    public function removeStock(Stock $stock)
    {
    $this->stocks->removeElement($stock);
    }
    }

class Stock{
/**

  • @Flow\Validate(type=“NotEmpty”)
  • @ORM\ManyToOne(inversedBy=“stocks”)
  • @var Product
    */
    protected $product;

/**

  • @return Product
    */
    public function getProduct()
    {
    return $this->product;
    }

/**

  • @param Product $product
  • @return void
    */
    public function setProduct($product)
    {
    $this->product = $product;
    }
    }
    if this only can use for one to one object not array?
    Thanks