net.sf.tacos.ajax
Class AjaxDirectServiceParameter

java.lang.Object
  extended byorg.apache.tapestry.engine.DirectServiceParameter
      extended bynet.sf.tacos.ajax.AjaxDirectServiceParameter

public class AjaxDirectServiceParameter
extends DirectServiceParameter

Adds additional functionality to DirectServiceParameter in the form of being able to specify optional id's of components that should have their contents replaced on a page.

Author:
jkuhnert

Field Summary
protected  String[] updateBlocks
          List of optional update blocks
protected  boolean updateDirect
          Whether or not to update the components directly
protected  String[] updateIds
          List of components to update
 
Constructor Summary
AjaxDirectServiceParameter(IDirect direct, Object[] parameters, String[] updateIds, String[] updateBlocks)
          Creates a parameter list that will cause the entire page to re-render, with only the contents of the specified IComponents returned and updated on the client.
AjaxDirectServiceParameter(IDirect direct, Object[] parameters, String[] updateIds, String[] updateBlocks, boolean updateDirect)
          Same as {@link #AjaxDirectServiceParameter(IDirect, Object[], String[], String[]), except the additional paramter updateDirect overrides the default behaviour of having the components rendered by direct invocation, rather than having the entire page re-rendered with only the ajax output returned to the client.
 
Method Summary
 String[] getUpdateBlocks()
          List of html block id's.
 String[] getUpdateIds()
          List of optional component ids to update.
 boolean isUpdateDirect()
           
 
Methods inherited from class org.apache.tapestry.engine.DirectServiceParameter
getDirect, getServiceParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

updateIds

protected String[] updateIds
List of components to update


updateBlocks

protected String[] updateBlocks
List of optional update blocks


updateDirect

protected boolean updateDirect
Whether or not to update the components directly

Constructor Detail

AjaxDirectServiceParameter

public AjaxDirectServiceParameter(IDirect direct,
                                  Object[] parameters,
                                  String[] updateIds,
                                  String[] updateBlocks)
Creates a parameter list that will cause the entire page to re-render, with only the contents of the specified IComponents returned and updated on the client. The additional updateBlocks will be available via the AjaxDirectService#getUpdateBlocks() method for blocks of html that aren't contained by a component.

This additional paramter is not processed directly by AjaxDirectService, but serves strictly as a convenience method for other components/services that may know how to deal with static html blocks.

Parameters:
direct -
parameters -
updateIds -
updateBlocks -

AjaxDirectServiceParameter

public AjaxDirectServiceParameter(IDirect direct,
                                  Object[] parameters,
                                  String[] updateIds,
                                  String[] updateBlocks,
                                  boolean updateDirect)
Same as {@link #AjaxDirectServiceParameter(IDirect, Object[], String[], String[]), except the additional paramter updateDirect overrides the default behaviour of having the components rendered by direct invocation, rather than having the entire page re-rendered with only the ajax output returned to the client.

Parameters:
direct -
parameters -
updateIds -
updateBlocks -
updateDirect - If false, causes the entire page to be re-rendered. The default is true, which causes only the specified components to be invoked directly.
Method Detail

getUpdateIds

public String[] getUpdateIds()
List of optional component ids to update.

Returns:

getUpdateBlocks

public String[] getUpdateBlocks()
List of html block id's.

Example:

 

Returns:

isUpdateDirect

public boolean isUpdateDirect()
Returns:
True if this request should invoke components directly, false otherwise.