Class AbstractEventAttribute
java.lang.Object
com.webfirmframework.wffweb.tag.core.AbstractTagBase
com.webfirmframework.wffweb.tag.html.attribute.core.AbstractAttribute
com.webfirmframework.wffweb.tag.html.attribute.event.AbstractEventAttribute
- All Implemented Interfaces:
TagBase,EventAttribute,Serializable,Cloneable
- Direct Known Subclasses:
AnimationEnd,AnimationIteration,AnimationStart,CustomEventAttribute,OnAbort,OnAfterPrint,OnBeforePrint,OnBeforeUnload,OnBlur,OnCanPlay,OnCanPlayThrough,OnChange,OnClick,OnContextMenu,OnCopy,OnCut,OnDblClick,OnDrag,OnDragEnd,OnDragEnter,OnDragLeave,OnDragOver,OnDragStart,OnDrop,OnDurationChange,OnEmptied,OnEnded,OnError,OnFocus,OnFocusIn,OnFocusOut,OnHashChange,OnInput,OnInvalid,OnKeyDown,OnKeyPress,OnKeyUp,OnLoad,OnLoadedData,OnLoadedMetaData,OnLoadStart,OnMouseDown,OnMouseEnter,OnMouseLeave,OnMouseMove,OnMouseOut,OnMouseOver,OnMouseUp,OnOffline,OnOnline,OnPageHide,OnPageShow,OnPaste,OnPause,OnPlay,OnPlaying,OnPopState,OnProgress,OnRateChange,OnReset,OnResize,OnScroll,OnSearch,OnSeeked,OnSeeking,OnSelect,OnShow,OnStalled,OnStorage,OnSubmit,OnSuspend,OnTimeUpdate,OnToggle,OnTouchCancel,OnTouchEnd,OnTouchMove,OnTouchStart,OnUnload,OnVolumeChange,OnWaiting,OnWheel,TransitionEnd
All event attributes will be extend by this class. It contains some common
features which all event attribute classes want.
- Since:
- 2.0.0
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractEventAttribute(String attributeName, boolean preventDefault, String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody, Object serverSideData) protectedAbstractEventAttribute(String attributeName, String value) protectedAbstractEventAttribute(String attributeName, String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody) protectedAbstractEventAttribute(String attributeName, String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody, Object serverSideData) -
Method Summary
Modifier and TypeMethodDescriptiongetValue()gets the value of this attributeprotected voidinit()invokes only once per objectprotected booleanThis is applicable for some special attributes like OnSubmit.protected voidsetAttributeName(String attributeName) Set attribute name, eg: width, height, name, type etc..voidsetJsFilterFunctionBody(String jsFilterFunctionBody) Sets the filter function body JavaScript.voidsetJsPostFunctionBody(String jsPostFunctionBody) Sets the post function body JavaScript.voidsetJsPreFunctionBody(String jsPreFunctionBody) Sets the pre function body JavaScript.protected voidsetPreIndexedAttribute(PreIndexedAttributeName preIndexedAttrName) NB: only for internal use.protected voidsetPreventDefault(boolean preventDefault) true to call event.preventDefault(); on event.protected voidsetServerAsyncMethod(boolean preventDefault, String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody, Object serverSideData) voidsetServerAsyncMethod(ServerAsyncMethod serverAsyncMethod) voidsetServerAsyncMethod(String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody) voidsetServerAsyncMethod(String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody, Object serverSideData) voidsetServerSideData(Object serverSideData) voidsets the value for this attributeMethods inherited from class com.webfirmframework.wffweb.tag.html.attribute.core.AbstractAttribute
addAllToAttributeValueMap, addAllToAttributeValueSet, addAllToAttributeValueSet, addToAttributeValueMap, addToAttributeValueSet, addValueChangeListener, beforePrintStructure, beforePrintStructureCompressedByIndex, beforeWffPrintStructure, getAttributeName, getAttributeValue, getAttributeValueMap, getAttributeValueSet, getBinaryStructureCompressedByIndex, getBinaryStructureCompressedByIndex, getCharset, getOwnerTag, getOwnerTags, getPrintStructure, getPrintStructure, getReadLocks, getValueChangeListeners, getWffPrintStructure, getWriteLocks, lockAndGetReadLocks, lockAndGetReadLocksWithAttrLock, lockAndGetWriteLocks, lockAndGetWriteLocksWithAttrLock, removeAllFromAttributeValueMap, removeAllFromAttributeValueSet, removeAllFromAttributeValueSet, removeFromAttributeValueMap, removeFromAttributeValueMap, removeFromAttributeValueMapByKeys, removeFromAttributeValueSet, removeValueChangeListener, replaceAllInAttributeValueSet, replaceAllInAttributeValueSet, setAttributeValue, setAttributeValue, setAttributeValueMap, setAttributeValueSet, setCharset, setModified, setModifiedLockless, setOwnerTag, toCompressedBytesByIndex, toCompressedBytesByIndex, toHtmlString, toHtmlString, toHtmlString, toHtmlString, toHtmlString, toHtmlString, toString, toWffString, unsetOwnerTagMethods inherited from class com.webfirmframework.wffweb.tag.core.AbstractTagBase
equals, getData, hashCode, isModified, isRebuild, setData, setRebuild
-
Constructor Details
-
AbstractEventAttribute
protected AbstractEventAttribute() -
AbstractEventAttribute
- Parameters:
value- the value for the attribute- Since:
- 2.0.0
-
AbstractEventAttribute
protected AbstractEventAttribute(String attributeName, String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody) - Parameters:
attributeName- the name of the attributejsPreFunctionBody- It is the body part of JavaScript function (without function declaration). It must return true/false. This function will invoke at client side beforeserverAsyncMethod. If the jsPrefunction returns true then onlyserverAsyncMethodmethod will invoke (if it is implemented). It has implicit objects in its scope. They areevent,sourcewhich gives the reference of the current tag andaction. Theactionimplicit object has a function namedperform()which can be used to invokejsFilterFunctionBodyandserverAsyncMethod(it works just like returning true in thejsPreFunctionBody). If theaction.perform()is called insidejsPreFunctionBodythen returning true in it has no effect. Theactionimplicit object is only available since 3.0.15.
Eg:-if (source.type == 'button') { return true; } return false;
NB: callingaction.perform()insidejsFilterFunctionBodyandjsPostFunctionBodyof the same event attribute will be harmful as it will make an infinite recursive call.serverAsyncMethod- This method will invoke at server side with an argumentwffBMObject. ThewffBMObjectis the representational javascript object returned byjsFilterFunctionBody.jsFilterFunctionBody- The body part of a javascript function (without function declaration). It can return a javascript object so that it will be available at server side inserverAsyncMethodaswffBMObjectparameter. There are implicit objectseventandsourcein the scope.
Eg:-var bName = source.name; return {buttonName: bName, author:'wff', dateOfYear: 2014};jsPostFunctionBody- The body part of a javascript function (without function declaration). ThewffBMObjectreturned byserverAsyncMethodwill be available as an implicit objectjsObjectin the scope. There are common implicit objectseventandsourcein the scope.- Since:
- 2.0.0
-
AbstractEventAttribute
protected AbstractEventAttribute(String attributeName, String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody, Object serverSideData) - Parameters:
attributeName- the name of the attributejsPreFunctionBody- It is the body part of JavaScript function (without function declaration). It must return true/false. This function will invoke at client side beforeserverAsyncMethod. If the jsPrefunction returns true then onlyserverAsyncMethodmethod will invoke (if it is implemented). It has implicit objects in its scope. They areevent,sourcewhich gives the reference of the current tag andaction. Theactionimplicit object has a function namedperform()which can be used to invokejsFilterFunctionBodyandserverAsyncMethod(it works just like returning true in thejsPreFunctionBody). If theaction.perform()is called insidejsPreFunctionBodythen returning true in it has no effect. Theactionimplicit object is only available since 3.0.15.
Eg:-if (source.type == 'button') { return true; } return false;
NB: callingaction.perform()insidejsFilterFunctionBodyandjsPostFunctionBodyof the same event attribute will be harmful as it will make an infinite recursive call.serverAsyncMethod- This method will invoke at server side with an argumentwffBMObject. ThewffBMObjectis the representational javascript object returned byjsFilterFunctionBody.jsFilterFunctionBody- The body part of a javascript function (without function declaration). It can return a javascript object so that it will be available at server side inserverAsyncMethodaswffBMObjectparameter. There are implicit objectseventandsourcein the scope.
Eg:-var bName = source.name; return {buttonName: bName, author:'wff', dateOfYear: 2014};jsPostFunctionBody- The body part of a javascript function (without function declaration). ThewffBMObjectreturned byserverAsyncMethodwill be available as an implicit objectjsObjectin the scope. There are common implicit objectseventandsourcein the scope.serverSideData- this data will be available in the Event object of ServerAsyncMethod.asyncMethod method.- Since:
- 3.0.2
-
AbstractEventAttribute
protected AbstractEventAttribute(String attributeName, boolean preventDefault, String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody, Object serverSideData) - Parameters:
attributeName- the name of the attributepreventDefault- true to call event.preventDefault(); on eventjsPreFunctionBody- It is the body part of JavaScript function (without function declaration). It must return true/false. This function will invoke at client side beforeserverAsyncMethod. If the jsPrefunction returns true then onlyserverAsyncMethodmethod will invoke (if it is implemented). It has implicit objects in its scope. They areevent,sourcewhich gives the reference of the current tag andaction. Theactionimplicit object has a function namedperform()which can be used to invokejsFilterFunctionBodyandserverAsyncMethod(it works just like returning true in thejsPreFunctionBody). If theaction.perform()is called insidejsPreFunctionBodythen returning true in it has no effect. Theactionimplicit object is only available since 3.0.15.
Eg:-if (source.type == 'button') { return true; } return false;
NB: callingaction.perform()insidejsFilterFunctionBodyandjsPostFunctionBodyof the same event attribute will be harmful as it will make an infinite recursive call.serverAsyncMethod- This method will invoke at server side with an argumentwffBMObject. ThewffBMObjectis the representational javascript object returned byjsFilterFunctionBody.jsFilterFunctionBody- The body part of a javascript function (without function declaration). It can return a javascript object so that it will be available at server side inserverAsyncMethodaswffBMObjectparameter. There are implicit objectseventandsourcein the scope.
Eg:-var bName = source.name; return {buttonName: bName, author:'wff', dateOfYear: 2014};jsPostFunctionBody- The body part of a javascript function (without function declaration). ThewffBMObjectreturned byserverAsyncMethodwill be available as an implicit objectjsObjectin the scope. There are common implicit objectseventandsourcein the scope.serverSideData- this data will be available in the Event object of ServerAsyncMethod.asyncMethod method.- Since:
- 3.0.15
-
-
Method Details
-
init
protected void init()invokes only once per object- Since:
- 2.0.0
-
setPreIndexedAttribute
Description copied from class:AbstractAttributeNB: only for internal use. Signature of this method may be modified in future version. Sets PreIndexedAttributeName for name and index- Overrides:
setPreIndexedAttributein classAbstractAttribute- Parameters:
preIndexedAttrName- PreIndexedAttributeName object
-
setAttributeName
Description copied from class:AbstractAttributeSet attribute name, eg: width, height, name, type etc..- Overrides:
setAttributeNamein classAbstractAttribute- Parameters:
attributeName- the attributeName to set
-
setValue
sets the value for this attribute- Parameters:
value- the value for the attribute.- Since:
- 2.0.0
-
getValue
gets the value of this attribute- Returns:
- the value of the attribute
- Since:
- 2.0.0
-
setServerAsyncMethod
- Parameters:
serverAsyncMethod- theServerAsyncMethodobject to set.
-
setServerAsyncMethod
public void setServerAsyncMethod(String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody) - Parameters:
jsPreFunctionBody- It is the body part of JavaScript function (without function declaration). It must return true/false. This function will invoke at client side beforeserverAsyncMethod. If the jsPrefunction returns true then onlyserverAsyncMethodmethod will invoke (if it is implemented). It has implicit objects in its scope. They areevent,sourcewhich gives the reference of the current tag andaction. Theactionimplicit object has a function namedperform()which can be used to invokejsFilterFunctionBodyandserverAsyncMethod(it works just like returning true in thejsPreFunctionBody). If theaction.perform()is called insidejsPreFunctionBodythen returning true in it has no effect. Theactionimplicit object is only available since 3.0.15.
Eg:-if (source.type == 'button') { return true; } return false;
NB: callingaction.perform()insidejsFilterFunctionBodyandjsPostFunctionBodyof the same event attribute will be harmful as it will make an infinite recursive call.serverAsyncMethod- This method will invoke at server side with an argumentwffBMObject. ThewffBMObjectis the representational javascript object returned byjsFilterFunctionBody.jsFilterFunctionBody- The body part of a javascript function (without function declaration). It can return a javascript object so that it will be available at server side inserverAsyncMethodaswffBMObjectparameter. There are implicit objectseventandsourcein the scope.
Eg:-var bName = source.name; return {buttonName: bName, author:'wff', dateOfYear: 2014};jsPostFunctionBody- The body part of a javascript function (without function declaration). ThewffBMObjectreturned byserverAsyncMethodwill be available as an implicit objectjsObjectin the scope. There are common implicit objectseventandsourcein the scope.- Since:
- 2.0.0
-
setServerAsyncMethod
public void setServerAsyncMethod(String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody, Object serverSideData) - Parameters:
jsPreFunctionBody- It is the body part of JavaScript function (without function declaration). It must return true/false. This function will invoke at client side beforeserverAsyncMethod. If the jsPrefunction returns true then onlyserverAsyncMethodmethod will invoke (if it is implemented). It has implicit objects in its scope. They areevent,sourcewhich gives the reference of the current tag andaction. Theactionimplicit object has a function namedperform()which can be used to invokejsFilterFunctionBodyandserverAsyncMethod(it works just like returning true in thejsPreFunctionBody). If theaction.perform()is called insidejsPreFunctionBodythen returning true in it has no effect. Theactionimplicit object is only available since 3.0.15.
Eg:-if (source.type == 'button') { return true; } return false;
NB: callingaction.perform()insidejsFilterFunctionBodyandjsPostFunctionBodyof the same event attribute will be harmful as it will make an infinite recursive call.serverAsyncMethod- This method will invoke at server side with an argumentwffBMObject. ThewffBMObjectis the representational javascript object returned byjsFilterFunctionBody.jsFilterFunctionBody- The body part of a javascript function (without function declaration). It can return a javascript object so that it will be available at server side inserverAsyncMethodaswffBMObjectparameter. There are implicit objectseventandsourcein the scope.
Eg:-var bName = source.name; return {buttonName: bName, author:'wff', dateOfYear: 2014};jsPostFunctionBody- The body part of a javascript function (without function declaration). ThewffBMObjectreturned byserverAsyncMethodwill be available as an implicit objectjsObjectin the scope. There are common implicit objectseventandsourcein the scope.serverSideData- this data will be available in the Event object of ServerAsyncMethod.asyncMethod method.- Since:
- 3.0.2
-
setServerAsyncMethod
protected void setServerAsyncMethod(boolean preventDefault, String jsPreFunctionBody, ServerAsyncMethod serverAsyncMethod, String jsFilterFunctionBody, String jsPostFunctionBody, Object serverSideData) - Parameters:
preventDefault- true to call event.preventDefault(); on eventjsPreFunctionBody- It is the body part of JavaScript function (without function declaration). It must return true/false. This function will invoke at client side beforeserverAsyncMethod. If the jsPrefunction returns true then onlyserverAsyncMethodmethod will invoke (if it is implemented). It has implicit objects in its scope. They areevent,sourcewhich gives the reference of the current tag andaction. Theactionimplicit object has a function namedperform()which can be used to invokejsFilterFunctionBodyandserverAsyncMethod(it works just like returning true in thejsPreFunctionBody). If theaction.perform()is called insidejsPreFunctionBodythen returning true in it has no effect. Theactionimplicit object is only available since 3.0.15.
Eg:-if (source.type == 'button') { return true; } return false;
NB: callingaction.perform()insidejsFilterFunctionBodyandjsPostFunctionBodyof the same event attribute will be harmful as it will make an infinite recursive call.serverAsyncMethod- This method will invoke at server side with an argumentwffBMObject. ThewffBMObjectis the representational javascript object returned byjsFilterFunctionBody.jsFilterFunctionBody- The body part of a javascript function (without function declaration). It can return a javascript object so that it will be available at server side inserverAsyncMethodaswffBMObjectparameter. There are implicit objectseventandsourcein the scope.
Eg:-var bName = source.name; return {buttonName: bName, author:'wff', dateOfYear: 2014};jsPostFunctionBody- The body part of a javascript function (without function declaration). ThewffBMObjectreturned byserverAsyncMethodwill be available as an implicit objectjsObjectin the scope. There are common implicit objectseventandsourcein the scope.serverSideData- this data will be available in the Event object of ServerAsyncMethod.asyncMethod method.- Since:
- 3.0.15
-
isPreventDefault
protected boolean isPreventDefault()This is applicable for some special attributes like OnSubmit.- Returns:
- true or false. true means to call event.preventDefault() on event otherwise false.
- Since:
- 3.0.15
-
getServerAsyncMethod
- Specified by:
getServerAsyncMethodin interfaceEventAttribute
-
getJsPostFunctionBody
- Specified by:
getJsPostFunctionBodyin interfaceEventAttribute
-
getJsFilterFunctionBody
- Returns:
- the js filter function body
- Since:
- 2.1.9
-
getJsPreFunctionBody
- Returns:
- the js prefunction body
- Since:
- 2.1.9
-
setPreventDefault
protected void setPreventDefault(boolean preventDefault) true to call event.preventDefault(); on event. It will set only if there isServerAsyncMethod. This is applicable for some special attributes like OnSubmit.- Parameters:
preventDefault- true to call event.preventDefault(); on event otherwise false.- Since:
- 3.0.15
-
setJsPostFunctionBody
Sets the post function body JavaScript.- Parameters:
jsPostFunctionBody- the post function body JavaScript.
-
setJsPreFunctionBody
Sets the pre function body JavaScript. It is the body part of JavaScript function (without function declaration). It must return true/false. This function will invoke at client side beforeserverAsyncMethod. If the jsPrefunction returns true then onlyserverAsyncMethodmethod will invoke (if it is implemented). It has implicit objects in its scope. They areevent,sourcewhich gives the reference of the current tag andaction. Theactionimplicit object has a function namedperform()which can be used to invokejsFilterFunctionBodyandserverAsyncMethod(it works just like returning true in thejsPreFunctionBody). If theaction.perform()is called insidejsPreFunctionBodythen returning true in it has no effect. Theactionimplicit object is only available since 3.0.15.
NB: callingaction.perform()insidejsFilterFunctionBodyandjsPostFunctionBodyof the same event attribute will be harmful as it will make an infinite recursive call.- Parameters:
jsPreFunctionBody- the JavaScript to execute.- Since:
- 2.1.9
-
setJsFilterFunctionBody
Sets the filter function body JavaScript.- Parameters:
jsFilterFunctionBody- the js filter function body- Since:
- 2.1.9
-
getServerSideData
- Specified by:
getServerSideDatain interfaceEventAttribute- Returns:
- the serverSideData
- Since:
- 3.0.2
-
setServerSideData
- Parameters:
serverSideData- the serverSideData to set- Since:
- 3.0.2
-