Project Wonder 5.0

er.ajax
Class AjaxOption

java.lang.Object
  extended by er.ajax.AjaxOption
Direct Known Subclasses:
AjaxConstantOption

public class AjaxOption
extends Object

AjaxOption provides a bridge between a binding value in an AjaxComponent or AjaxDynamicElement and one JavaScript formatted key-value pair in a dictionary. An AjaxOption consists of four values:

See Also:
AjaxOptions, AjaxValue

Nested Class Summary
static class AjaxOption.Type
          AjaxOption.Type is a simple enumeration of the types that AjaxValue can interpret.
 
Field Summary
static AjaxOption.Type ARRAY
           
static AjaxOption.Type BOOLEAN
           
static AjaxOption.Type DEFAULT
           
static AjaxOption.Type DICTIONARY
           
static AjaxOption.Type FUNCTION
           
static AjaxOption.Type FUNCTION_1
           
static AjaxOption.Type FUNCTION_2
           
static AjaxOption.Type NUMBER
           
static AjaxOption.Type SCRIPT
           
static AjaxOption.Type STRING
           
static AjaxOption.Type STRING_ARRAY
           
static AjaxOption.Type STRING_OR_ARRAY
           
 
Constructor Summary
AjaxOption(String name)
           
AjaxOption(String name, AjaxOption.Type type)
           
AjaxOption(String name, Object defaultValue, AjaxOption.Type type)
           
AjaxOption(String name, String bindingName, Object defaultValue, AjaxOption.Type type)
           
 
Method Summary
protected  void addToDictionary(WOComponent component, NSDictionary<String,? extends WOAssociation> associations, NSMutableDictionary<String,String> dictionary)
          Evaluates this AjaxOption on a WODynamicElement and adds the name and JavaScript formatted value to dictionary.
 void addToDictionary(WOComponent component, NSMutableDictionary<String,String> dictionary)
          Evaluates this AjaxOption on a WOComponent and adds the name and JavaScript formatted value to dictionary.
static NSMutableDictionary<String,String> createAjaxOptionsDictionary(NSArray<AjaxOption> ajaxOptions, WOComponent component)
           
static NSMutableDictionary<String,String> createAjaxOptionsDictionary(NSArray<AjaxOption> ajaxOptions, WOComponent component, NSDictionary<String,? extends WOAssociation> associations)
           
 Object defaultValue()
           
 String name()
           
 AjaxOption.Type type()
           
 AjaxValue valueForObject(Object obj)
           
protected  Object valueInComponent(WOComponent component)
           
protected  Object valueInComponent(WOComponent component, NSDictionary<String,? extends WOAssociation> associations)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final AjaxOption.Type DEFAULT

STRING

public static final AjaxOption.Type STRING

SCRIPT

public static final AjaxOption.Type SCRIPT

NUMBER

public static final AjaxOption.Type NUMBER

ARRAY

public static final AjaxOption.Type ARRAY

STRING_ARRAY

public static final AjaxOption.Type STRING_ARRAY

BOOLEAN

public static final AjaxOption.Type BOOLEAN

STRING_OR_ARRAY

public static final AjaxOption.Type STRING_OR_ARRAY

DICTIONARY

public static final AjaxOption.Type DICTIONARY

FUNCTION

public static final AjaxOption.Type FUNCTION

FUNCTION_1

public static final AjaxOption.Type FUNCTION_1

FUNCTION_2

public static final AjaxOption.Type FUNCTION_2
Constructor Detail

AjaxOption

public AjaxOption(String name)

AjaxOption

public AjaxOption(String name,
                  AjaxOption.Type type)

AjaxOption

public AjaxOption(String name,
                  Object defaultValue,
                  AjaxOption.Type type)

AjaxOption

public AjaxOption(String name,
                  String bindingName,
                  Object defaultValue,
                  AjaxOption.Type type)
Method Detail

name

public String name()

type

public AjaxOption.Type type()

valueForObject

public AjaxValue valueForObject(Object obj)
Parameters:
obj - the Object to return an AjaxValue for
Returns:
an AjaxValue encapsulating obj with the same type as this AjaxOption

defaultValue

public Object defaultValue()

valueInComponent

protected Object valueInComponent(WOComponent component)

valueInComponent

protected Object valueInComponent(WOComponent component,
                                  NSDictionary<String,? extends WOAssociation> associations)

addToDictionary

public void addToDictionary(WOComponent component,
                            NSMutableDictionary<String,String> dictionary)
Evaluates this AjaxOption on a WOComponent and adds the name and JavaScript formatted value to dictionary.

Parameters:
component - WOComponent to get binding value from
dictionary - mutable dictionary to add key-value pair to

addToDictionary

protected void addToDictionary(WOComponent component,
                               NSDictionary<String,? extends WOAssociation> associations,
                               NSMutableDictionary<String,String> dictionary)
Evaluates this AjaxOption on a WODynamicElement and adds the name and JavaScript formatted value to dictionary.

Parameters:
component - WOComponent to get binding value from
associations - dictionary of associations to get WOAssocation providing value from
dictionary - mutable dictionary to add key-value pair to

createAjaxOptionsDictionary

public static NSMutableDictionary<String,String> createAjaxOptionsDictionary(NSArray<AjaxOption> ajaxOptions,
                                                                             WOComponent component)
Parameters:
ajaxOptions - list of AjaxOption to evaluate on component
component - WOComponent to get binding value from
Returns:
dictionary produced by evaluating the array of AjaxOption on a WOComponent and adding the resulting name and JavaScript formatted values

createAjaxOptionsDictionary

public static NSMutableDictionary<String,String> createAjaxOptionsDictionary(NSArray<AjaxOption> ajaxOptions,
                                                                             WOComponent component,
                                                                             NSDictionary<String,? extends WOAssociation> associations)
Parameters:
ajaxOptions - list of AjaxOption to evaluate on component
component - WOComponent to get binding value from
associations - dictionary of associations to get WOAssocation providing value from
Returns:
dictionary produced by evaluating the array of AjaxOption on a WOComponent and adding the resulting name and JavaScript formatted values

Last updated: Wed, Feb 22, 2012 • 07:00 AM EST

Copyright © 2002 – 2011 Project Wonder.