Project Wonder 2.0

er.extensions
Class ERXPatcher.DynamicElementsPatches

java.lang.Object
  extended byer.extensions.ERXPatcher.DynamicElementsPatches
Enclosing class:
ERXPatcher

public static class ERXPatcher.DynamicElementsPatches
extends Object

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.


Nested Class Summary
static class ERXPatcher.DynamicElementsPatches.ActiveImage
           
static class ERXPatcher.DynamicElementsPatches.Browser
           
static class ERXPatcher.DynamicElementsPatches.CheckBox
           
static class ERXPatcher.DynamicElementsPatches.CheckBoxList
           
static class ERXPatcher.DynamicElementsPatches.FileUpload
           
static class ERXPatcher.DynamicElementsPatches.GenericContainer
           
static class ERXPatcher.DynamicElementsPatches.GenericElement
           
static class ERXPatcher.DynamicElementsPatches.HiddenField
           
static class ERXPatcher.DynamicElementsPatches.Image
           
static class ERXPatcher.DynamicElementsPatches.ImageButton
           
static class ERXPatcher.DynamicElementsPatches.PasswordField
           
static class ERXPatcher.DynamicElementsPatches.PopUpButton
           
static class ERXPatcher.DynamicElementsPatches.RadioButton
           
static class ERXPatcher.DynamicElementsPatches.RadioButtonList
           
static class ERXPatcher.DynamicElementsPatches.ResetButton
           
static class ERXPatcher.DynamicElementsPatches.SubmitButton
           
static class ERXPatcher.DynamicElementsPatches.Text
           
static class ERXPatcher.DynamicElementsPatches.TextField
           
 
Field Summary
static boolean cleanupXHTML
           
 
Method Summary
static String addQuotes(String atts)
          This method adds missing quotes to the given attribute string.
static void appendIdentifierTagAndValue(WODynamicElement element, WOAssociation id, WOResponse response, WOContext context)
          Allows you to set the component ID without actually touching the HTML code, by adding a componentIdentifier entry in the context's mutableUserInfo.
static void correctResponse(WOResponse response, int start)
          Corrects the response of dynamic elements to be XHTML-conformant.
static void processResponse(WODynamicElement element, WOResponse response, WOContext context, int priorOffset, String name)
          Fixing up the response for XHTML and adding the element to the array of generated element IDs, so we can use JavaScript later on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cleanupXHTML

public static boolean cleanupXHTML
Method Detail

appendIdentifierTagAndValue

public static void appendIdentifierTagAndValue(WODynamicElement element,
                                               WOAssociation id,
                                               WOResponse response,
                                               WOContext context)
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.


processResponse

public static void processResponse(WODynamicElement element,
                                   WOResponse response,
                                   WOContext context,
                                   int priorOffset,
                                   String name)
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 context().userInfo().elementArray()


correctResponse

public static final void correctResponse(WOResponse response,
                                         int start)
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.

addQuotes

public static final String addQuotes(String atts)
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.

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.