ERXAccessibleSubmitButton Class Reference

Inherits er::extensions::components::_private::ERXSubmitButton.

Collaboration diagram for ERXAccessibleSubmitButton:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void appendAttributesToResponse (WOResponse response, WOContext context)
void appendChildrenToResponse (WOResponse response, WOContext context)
void appendToResponse (WOResponse response, WOContext context)
 ERXAccessibleSubmitButton (String name, NSDictionary< String, WOAssociation > associations, WOElement template)

Protected Member Functions

String accesskey (WOComponent component)
String accesskeyElement (WOComponent component)
boolean hasUsedHotKey (WOComponent component, String hotKey)
boolean isDisabled (WOComponent component)
void recordUsedHotKey (WOComponent component, String hotKey)
String styledValue (WOComponent component)
NSMutableArray usedHotKeys (WOComponent component)

Protected Attributes

WOAssociation _accesskey
WOAssociation _accesskeyElement


Detailed Description

Extends ERXSubmitButton with self-configuring accessibility hot key for the button. The default hot key is the first character. If that has been used by a button that appeared earlier on the page, the next choice is a capital character. If no non-conflicting capital characters are available, it selects the first character that does not conflict with an earlier button. If you want a different hot key, specify it in the accesskey binding. Note that if this conflicts with the self configured choice for a button that appeared earlier on the page that this conflict will not be resolved. You will have to define an accesskey for the conflicting button as well. If you don't want a hot key, bind accesskey to the empty string.

The default is to use the u (underline) element to identify the hot key in the button text. Use the accesskeyElement binding to specify a different element. The element can be decorated with other attributes, e.g.

 accesskeyElement = "span style='text-decoration: underline;'";
 

You can have this class replace WOSubmitButton via ERXPatcher.setClassForName(ERXAccessibleSubmitButton.class, "WOSubmitButton"); or use it explicitly by name in your WOD. It works best (does the most work for you) if you use it with the value attribute. No self configuring is done if there is any content between the open and close tags.

accesskey optional key for hot key, "" to disable hot key accesskeyElement optional element name and decoration to wrap hot key character with in the button text value the button text

See also:
ERXSubmitButton
Author:
chill

Constructor & Destructor Documentation

ERXAccessibleSubmitButton ( String  name,
NSDictionary< String, WOAssociation >  associations,
WOElement  template 
)


Member Function Documentation

String accesskey ( WOComponent  component  )  [protected]

Parameters:
component WOComponent to evaluate the associations in
Returns:
the character to use for the button's accesskey attribute, or null if there will not be an accesskey

String accesskeyElement ( WOComponent  component  )  [protected]

Parameters:
component WOComponent to evaluate the associations in
Returns:
element name and decoration to wrap hot key character with in the button text

void appendAttributesToResponse ( WOResponse  response,
WOContext  context 
)

Adds the accesskey binding as we took it out of the associations dictionary

See also:
er.extensions.components._private.ERXSubmitButton.appendAttributesToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)

Reimplemented from ERXSubmitButton.

void appendChildrenToResponse ( WOResponse  response,
WOContext  context 
)

Adds styledValue between the open and close tags

See also:
er.extensions.components._private.ERXSubmitButton.appendChildrenToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)

Reimplemented from ERXSubmitButton.

void appendToResponse ( WOResponse  response,
WOContext  context 
)

Records the accesskey for this button so other buttons on the page won't use it.

See also:
er.extensions.components._private.ERXSubmitButton.appendToResponse(com.webobjects.appserver.WOResponse, com.webobjects.appserver.WOContext)

Reimplemented from ERXSubmitButton.

boolean hasUsedHotKey ( WOComponent  component,
String  hotKey 
) [protected]

Parameters:
component WOComponent to evaluate the associations in
hotKey the character to check
Returns:
true if hotKey has been used by another ERXAccessibleSubmitButton on this page

boolean isDisabled ( WOComponent  component  )  [protected]

Parameters:
component WOComponent to evaluate the associations in
Returns:
true if accesskey should not be generated

void recordUsedHotKey ( WOComponent  component,
String  hotKey 
) [protected]

Records that hotKey is being used by a ERXAccessibleSubmitButton on this page.

Parameters:
component WOComponent to evaluate the associations in
hotKey the character to record

String styledValue ( WOComponent  component  )  [protected]

Parameters:
component WOComponent to evaluate the associations in
Returns:
String from the value binding with the accesskey wrapped in accesskeyElement

NSMutableArray usedHotKeys ( WOComponent  component  )  [protected]

Parameters:
component WOComponent to evaluate the associations in
Returns:
NSMutableArray containing the hotKeys being used by ERXAccessibleSubmitButtons on this page


Member Data Documentation

WOAssociation _accesskey [protected]

WOAssociation _accesskeyElement [protected]


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

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