ariba.ui.aribaweb.core
Class AWFormValueManager

java.lang.Object
  extended by ariba.ui.aribaweb.util.AWBaseObject
      extended by ariba.ui.aribaweb.core.AWFormValueManager
All Implemented Interfaces:
AWObject

public class AWFormValueManager
extends AWBaseObject

Mechanism for deferring certain kinds of work. The fieldsui layer needs to be able to defer some kinds of work - we allow this by queuing up that work and executing it later. The kinds of work that need to be deferred are to set object values, to run object triggers and to run behaviors (visibility, editability & validity). These different kinds of work are queued up during the applyValues phase and then executed in invokeAction just as we are about to actually invoke the action.
The whole reason for the deferral is that we need the back-end data to remain untouched from the end of renderResponse, through applyValues and through the navigation of invoke - up to when we actually call the action


Field Summary
static int ComputedValue
          queue for computed value
static int DeferredValues
          queue for object model field setting
static int Triggers
          queue for running triggers
static int Validations
          queus for running behaviors
 
Fields inherited from class ariba.ui.aribaweb.util.AWBaseObject
AribaHashtableClass, AribaVectorClass, ClassClass, EmptyHashtable, EmptyMap, EmptyVector, False, IntegerClass, JavaHashtableClass, JavaMapClass, JavaVectorClass, LogHandling, NullObject, ObjectClass, StringClass, True, UndefinedObject, UndefinedString, UninitializedRealNumber
 
Constructor Summary
AWFormValueManager(AWPage page)
          Create the form value manager
 
Method Summary
 void add(int queueId, AWFormValueOperation formValueOperation)
          Add a piece of work to one of the queues.
 void clear()
          Clear all the queues.
 void clearQueue(int index)
          Clear a single queue.
 void processQueue(int queueId)
          Process a single queue.
 void suppressWork(int queueId)
          Suppress the execution of one of the queues.
 
Methods inherited from class ariba.ui.aribaweb.util.AWBaseObject
debugString, ensureFieldValuesClear, getFieldValue, init, isKindOfClass, localizedJavaString, logString, logWarning, setFieldValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DeferredValues

public static final int DeferredValues
queue for object model field setting

See Also:
Constant Field Values

Triggers

public static final int Triggers
queue for running triggers

See Also:
Constant Field Values

ComputedValue

public static final int ComputedValue
queue for computed value

See Also:
Constant Field Values

Validations

public static final int Validations
queus for running behaviors

See Also:
Constant Field Values
Constructor Detail

AWFormValueManager

public AWFormValueManager(AWPage page)
Create the form value manager

Method Detail

clear

public void clear()
Clear all the queues.


suppressWork

public void suppressWork(int queueId)
Suppress the execution of one of the queues. If a queue is suppressed, we won't process the work in it at the normal time. The caller is then responsible for explicitly calling processQueue if the work should get done.

WARNING! using this method will cause serious problems in subtle ways. Don't use it unless you thoroughly understand the use of the queues

Parameters:
queueId - which queue should be suppressed. Should be one of DeferredValues, Triggers or Validations

add

public void add(int queueId,
                AWFormValueOperation formValueOperation)
Add a piece of work to one of the queues. This method should normally only be called by internals of fieldsui.

Parameters:
queueId - which queue this work should go in. Should be one of DeferredValues, Triggers or Validations
formValueOperation - The work to do. Cannot be null.
See Also:
processQueue(int)

processQueue

public void processQueue(int queueId)
Process a single queue. Every form value operation in the queue will have its perform() method called. This method ignores queue suppression, so that callers may use this method to run a previously suppressed queue.

Parameters:
queueId - which queue we are running. Should be one of DeferredValues, Triggers or Validations

clearQueue

public void clearQueue(int index)
Clear a single queue.

Parameters:
index - which queue we are clearing. Should be one of DeferredValues, Triggers or Validations


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.