Adept.Core.namespace("Adept.Controller.Form");Adept.Controller.Form.AbstractButton=Class.create(Adept.Controller,{formId:null,ajax:null,CLICK_EVENT:'click',initialize:function($super,componentId,formId){$super(componentId);if(Adept.Core.isset(formId)){this.formId=formId}Adept.Observer.addListener(this.getElementId(),this.CLICK_EVENT,this.submit.bindAsEventListener(this))},submit:function(event){},isAjax:function(){return this.ajax!=null?this.ajax:false},setAjax:function(ajax){this.ajax=ajax},getForm:function(){return $(this.formId)},getFormId:function(){return this.formId},setFormId:function(formId){this.formId=formId}});Adept.Core.namespace('Adept.Controller.Form');Adept.Controller.Form.Button=Class.create(Adept.Controller.Form.AbstractButton,{submit:function(event){var formController=Adept.Application.getController(this.getFormId());formController.attachServerEvent(this.getElementId(),'click');if(this.isAjax()){formController.setAjax(true)}}});Adept.Core.namespace('Adept.Controller.Form');Adept.Controller.Form.CommandLink=Class.create(Adept.Controller.Form.Button,{submit:function($super,event){try{$super(event);Adept.Observer.notifyDomListeners(this.getForm(),'submit')}catch(e){this.createEventInput();this.getForm().submit()}},createEventInput:function(){var input=document.createElement('input');input.type='hidden';input.name='event['+this.getElementId()+']';input.value='click';this.getForm().appendChild(input)}});Adept.Core.namespace('Adept.Controller.Form');Adept.Controller.Form.ActionButton=Class.create(Adept.Controller.Form.AbstractButton,{submit:function(event){var request=Adept.Ajax.Backend.createRequest();request.addEvent(this.getElementId(),this.CLICK_EVENT);request.send()}});Adept.Core.namespace('Adept.Controller.Form');Adept.Controller.Form.ActionLink=Class.create(Adept.Controller.Form.ActionButton,{});