We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38371
    • 42 Posts
    I am currently developing custom manager pages.


    The user will have a products' list that he/she can edit by double-clicking on a grid's cell (just like the doodles tutorial).


    Two products should not have the same name. So, I've added the following code to my custom modObjectUpdateFromGridProcessor:

    public function beforeSave() {
        $name = $this -> getProperty('name');
        if ( $this -> modx -> getCount( $this -> classKey, array('name' => $name) ) ) {
            $this -> addFieldError( 'name', $this -> modx -> lexicon('custom_object_type_err_ae') );
        }
    
        return parent::beforeSave();
    }
    


    The result is that:

    • 1. The modified product is not saved (which is what I want).
    • 2. No message is shown to the user. Just the red arrow at the top-left corner of the cell signalling an imminent update.

    Is there a way to product a message to the user?


    Thanks a lot!