org.jsxp.framework.elementprocessing.processors
Class AjaxBehaviour

java.lang.Object
  extended by org.jsxp.framework.elementprocessing.processors.AjaxBehaviour
All Implemented Interfaces:
ElementProcessor

public class AjaxBehaviour
extends java.lang.Object
implements ElementProcessor

This processor will enable Elements with Ajax behaviour.

It an be configured for partial request, so a request will be made for example when the element is clicked and the normal lifecycle of view controller will be used on server.

It can also be used with a ElementProcessorCommand. This is a command that will be called and executed on the server, when the Ajax behaviour is used. This is a much easier way of implementing server side java behaviour for ajax requests.

For advanced configuration set the different properties.


Constructor Summary
AjaxBehaviour(Element element, ElementProcessorCommand elementProcessorCommand, java.lang.String... updateIds)
          Instantiates a new resource handler.
AjaxBehaviour(Element element, java.lang.String... updateIds)
          Instantiates a new resource handler.
AjaxBehaviour(java.lang.String event, Element element, ElementProcessorCommand elementProcessorCommand, java.lang.String... updateIds)
          Instantiates a new resource handler.
AjaxBehaviour(java.lang.String event, Element element, java.lang.String... updateIds)
          Instantiates a new resource handler.
 
Method Summary
 java.lang.String getBody()
           
 java.lang.String getCallbackFunction()
           
 java.lang.String getContentType()
           
 java.lang.String getEvent()
           
 int getMaxWaitingTimeMS()
           
 java.lang.String getMethod()
           
 java.lang.String[] getUpdateIds()
           
 java.lang.String getUri()
           
 void process(ViewController renderViewController)
          Process elements in the rendering view controller.
 void setBody(java.lang.String body)
           
 void setCallbackFunction(java.lang.String callbackFunction)
           
 void setContentType(java.lang.String contentType)
           
 void setEvent(java.lang.String event)
           
 void setMaxWaitingTimeMS(int maxWaitingTimeMS)
           
 void setMethod(java.lang.String method)
           
 void setUpdateIds(java.lang.String[] updateIds)
           
 void setUri(java.lang.String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AjaxBehaviour

public AjaxBehaviour(Element element,
                     ElementProcessorCommand elementProcessorCommand,
                     java.lang.String... updateIds)
Instantiates a new resource handler.

Parameters:
element -
elementProcessorCommand -
updateIds - the jsxp id to update on the client. leave blank if all should be updated

AjaxBehaviour

public AjaxBehaviour(Element element,
                     java.lang.String... updateIds)
Instantiates a new resource handler. As default the event is onClick.

Parameters:
element - the element to process
updateIds - the jsxp id to update on the client. leave blank if all should be updated

AjaxBehaviour

public AjaxBehaviour(java.lang.String event,
                     Element element,
                     ElementProcessorCommand elementProcessorCommand,
                     java.lang.String... updateIds)
Instantiates a new resource handler.

Parameters:
element -
elementProcessorCommand -
event - like "onClick" and so on
updateIds - the jsxp id to update on the client. leave blank if all should be updated

AjaxBehaviour

public AjaxBehaviour(java.lang.String event,
                     Element element,
                     java.lang.String... updateIds)
Instantiates a new resource handler.

Parameters:
element - the element to process
event - like "onClick" and so on
updateIds - the jsxp id to update on the client. leave blank if all should be updated
Method Detail

getBody

public java.lang.String getBody()

getCallbackFunction

public java.lang.String getCallbackFunction()

getContentType

public java.lang.String getContentType()

getEvent

public java.lang.String getEvent()

getMaxWaitingTimeMS

public int getMaxWaitingTimeMS()

getMethod

public java.lang.String getMethod()

getUpdateIds

public java.lang.String[] getUpdateIds()

getUri

public java.lang.String getUri()

process

public void process(ViewController renderViewController)
Description copied from interface: ElementProcessor
Process elements in the rendering view controller. Normally an element processor will be initialized with references to elements that will be processed during the phase ViewControllerLifeCycle.LifeCyclePhase.ELEMENTPROCESSING.

Specified by:
process in interface ElementProcessor

setBody

public void setBody(java.lang.String body)

setCallbackFunction

public void setCallbackFunction(java.lang.String callbackFunction)

setContentType

public void setContentType(java.lang.String contentType)

setEvent

public void setEvent(java.lang.String event)

setMaxWaitingTimeMS

public void setMaxWaitingTimeMS(int maxWaitingTimeMS)

setMethod

public void setMethod(java.lang.String method)

setUpdateIds

public void setUpdateIds(java.lang.String[] updateIds)

setUri

public void setUri(java.lang.String uri)


Copyright © 2012 Oliver Szymanski & David Tanzer