ERXPatcher.DynamicElementsPatches Class Reference

List of all members.

Classes

class  ActiveImage
class  Browser
class  CheckBox
class  CheckBoxList
class  FileUpload
class  GenericContainer
class  GenericElement
class  HiddenField
class  Image
class  ImageButton
class  JavaScript
class  PasswordField
class  PopUpButton
class  RadioButton
class  RadioButtonList
class  ResetButton
class  SubmitButton
class  Text
class  TextField

Static Public Member Functions

static final String addQuotes (String atts)
static void appendIdentifierTagAndValue (WODynamicElement element, WOAssociation id, WOResponse response, WOContext context)
static final void correctResponse (WOResponse response, int start)
static void processResponse (WODynamicElement element, WOResponse response, WOContext context, int priorOffset, String name)

Static Public Attributes

static boolean cleanupXHTML = false

Private Member Functions

 DynamicElementsPatches ()

Static Private Member Functions

static final int consumeAttributeName (String string, int index, StringBuffer buf)
static final int consumeAttributeValue (String string, int index, StringBuffer buf)
static final int consumeTag (String string, int index, StringBuffer buf)
static final StringBuffer getBuffer (String src, int len, StringBuffer buf)
static final boolean isWhiteSpace (char ch)

Static Private Attributes

static boolean useButtonTag = false


Detailed Description

This class holds patches for WebObjects dynamic elements, which have always a closing tag and all attribute values are enclosed in quotes. The patches are automatically registered if this framework gets loaded.
Note: WOForm is not replaced, because it is ok if you don't use ?-bindings. If you need additional parameters, just insert WOHiddenFields.
Also WOJavaScript is not replaced, even if it is not XHTML-conform.

Constructor & Destructor Documentation

DynamicElementsPatches (  )  [private]


Member Function Documentation

static final String addQuotes ( String  atts  )  [static]

This method adds missing quotes to the given attribute string. E.g. type=text name="mytext" will be corrected to type="text" name="mytext"

Parameters:
atts a string of attributes.
Returns:
the corrected string.

static void appendIdentifierTagAndValue ( WODynamicElement  element,
WOAssociation  id,
WOResponse  response,
WOContext  context 
) [static]

Allows you to set the component ID without actually touching the HTML code, by adding a componentIdentifier entry in the context's mutableUserInfo. This is useful for setting CSS entries you don't have to code for.

static final int consumeAttributeName ( String  string,
int  index,
StringBuffer  buf 
) [static, private]

static final int consumeAttributeValue ( String  string,
int  index,
StringBuffer  buf 
) [static, private]

static final int consumeTag ( String  string,
int  index,
StringBuffer  buf 
) [static, private]

static final void correctResponse ( WOResponse  response,
int  start 
) [static]

Corrects the response of dynamic elements to be XHTML-conformant. input- and img-tags will be closed correctly, all attribute values will be quoted and attributes without a value like disabled will get a quoted value. All attribute-values with uncorrectly escaped ampersands (&) will be corrected. E.g. "wählen" will become "wählen".
This method would normally be called in the following way:

 public void appendToResponse(WOResponse woresponse, WOContext wocontext) {
 	String pre = woresponse.contentString();
 	super.appendToResponse(woresponse, wocontext);
 	correctResponse(woresponse, pre.length(), pre);
 }
 

Parameters:
response the response to be corrected.
start the offset to start from.

static final StringBuffer getBuffer ( String  src,
int  len,
StringBuffer  buf 
) [static, private]

static final boolean isWhiteSpace ( char  ch  )  [static, private]

Returns true if ch is an white space character, false otherwise.

Parameters:
ch 
Returns:
true if ch is white space character, false otherwise.

static void processResponse ( WODynamicElement  element,
WOResponse  response,
WOContext  context,
int  priorOffset,
String  name 
) [static]

Fixing up the response for XHTML and adding the element to the array of generated element IDs, so we can use JavaScript later on. If the given element is an input element, it adds a dictionary {type=element.class, name=element.elementID} to ERXWOContext.contextDictionary().objectForKey("elementArray")


Member Data Documentation

boolean cleanupXHTML = false [static]

boolean useButtonTag = false [static, private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:13 2012 for Project Wonder by  doxygen 1.5.8