Thank you for your answer.
Where should i else start looking ?
I think that i checked everything, the form finally shrinked down and now it really simple:

<t:saveState value="#{CategoryBean.editmode}"/>
<h:form>
<h:inputText id="name" value="#{CategoryBean.category.name}" required="true" maxlength="255" />
  <h:message for="name" style="color: red" />

<h:commandLink action="#{CategoryBean.submit}" value="Save" styleClass="cl" /> <h:commandLink action="#{CategoryBean.delete}" value="Delete" styleClass="dl" rendered="#{CategoryBean.editmode}" />
</h:form>

and commandLink actions:

    public String delete() throws SQLException {
        CategoryDAO dao = SqlMapDAOFactory.getCategoryDAO();
        int deleted = dao.deleteById(category.getId().intValue());
        return "category_list";
    }

    public String submit() throws SQLException {
        CategoryDAO dao = SqlMapDAOFactory.getCategoryDAO();
        dao.update(category);
        return "category_list";
    }


But "Delete" button stops working if "Submit" was pressed before and validation error occurs because of: required="true" in text field.
Everything looks pretty bulletproof :\


Yes, t:saveState will save the data even when validation fails. The "saving" process occurs when the JSF component tree is saved, and that always occurs at the end of each request.

Your problem must be something else...

By the way, if all you want to save is that one property from CategoryBean, then you should probably just save that, ie
 <t:saveState value="#{CategoryBean.editmode}"/>
rather than the whole bean.

Regards,

Simon

Reply via email to