I'm adding a beforeadd listener to a multifield to limit the number of items that can be added. I see the message when I try and add more than the limit, no more items get added, but as the xtype configured to the the multifield item is required (cannot be empty) it doesn't let me click 'OK' on the dialog anymore, telling me I need to complete all fields.
function(list,component,index) { if(this.fieldConfig.limit!=0) { if((list.items.getCount()-1) > this.fieldConfig.limit) { CQ.Ext.Msg.show( { title : 'Limit reached', msg : 'You are only allowed to add ' + this.fieldConfig.limit + ' links', buttons : CQ.Ext.Msg.OK, fn : function(buttons) { if(buttons == "ok") return false; }, icon : CQ.Ext.MessageBox.WARNING }); return false; } } }