Project Wonder 5.0

er.extensions.batching
Class ERXDirectActionBatchNavigationBar

java.lang.Object
  extended by com.webobjects.appserver.WOElement
      extended by com.webobjects.appserver.WOComponent
          extended by er.extensions.components.ERXComponent
              extended by er.extensions.components.ERXNonSynchronizingComponent
                  extended by er.extensions.components.ERXStatelessComponent
                      extended by er.extensions.batching.ERXDirectActionBatchNavigationBar
All Implemented Interfaces:
com.webobjects.appserver.WOActionResults, com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCodingAdditions, com.webobjects.foundation.NSValidation, java.io.Serializable, java.lang.Cloneable

public class ERXDirectActionBatchNavigationBar
extends ERXStatelessComponent

BatchNavigationBar that uses a direct action and a "batch" URL parameter to switch to a specific batch. You have to do the batching yourself and get the information from the request though. Tip for this: ERXEOControlUtilities.objectsInRange is a really big help doing that!

See Also:
Serialized Form
Author:
cug - Sep 20, 2007
Bindings
actionName (String) - the name of the directAction to call
           
actionClass (String) - the name of the class for the directAction call
           
additionalUrlParameters (NSDictionary) - parameters that get added to navigation URLs
           
batchsize (Integer) - the size of the batches
           
currentBatchIndex (Integer) - the index of the current page
           
numberOfObjects (Integer) - the number of objects to batch
           
containerCssClass (String) - the css class to use for the surrounding div container
           
backString (String) - the string to use for the "back" link (HTML enabled); default = « back
           
forwardString (String) - the string to use for the "forward" link (HTML enabled); default = back »
           
showPageNumbers (Boolean) - whether or not to show the page numbers (you might want to show only the back and forward links); default = true
           
showPageString (Boolean) - whether or not to show the "Page:" string to the left of the nav (will be made more flexible); default = false
           
showBatchNavigationForSinglePage (Boolean) - whether or not to show the the batch navigation if we have only a single page; default = true
           

Nested Class Summary
 
Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent
com.webobjects.appserver.WOComponent._EventLoggingEnabler, com.webobjects.appserver.WOComponent.Event
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation
com.webobjects.foundation.NSValidation._MethodBinding, com.webobjects.foundation.NSValidation._ValidationBinding, com.webobjects.foundation.NSValidation.DefaultImplementation, com.webobjects.foundation.NSValidation.Utility, com.webobjects.foundation.NSValidation.ValidationException
 
Field Summary
 com.webobjects.foundation.NSDictionary dictInRepetition
          The one used in the repetition
 
Fields inherited from class er.extensions.components.ERXComponent
_dynamicBindings
 
Fields inherited from class com.webobjects.appserver.WOComponent
_Extension, _IsEventLoggingEnabled, _keyAssociations
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
NullValue
 
Fields inherited from interface com.webobjects.foundation.NSValidation
_CLASS
 
Constructor Summary
ERXDirectActionBatchNavigationBar(com.webobjects.appserver.WOContext context)
          Standard constructor
 
Method Summary
 java.lang.String actionClass()
          Returns the name of the direct action class, if empty the default class is used (DirectAction)
 java.lang.String actionName()
          Returns the name of the direct action to call
 com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object> additionalUrlParameters()
          The parameters to add to each link
 java.lang.String backString()
          the string for the "back" link
 com.webobjects.foundation.NSArray<com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object>> batchNumbers()
          Returns "batchNumber" objects which are dictionaries with key-value-pairs for the String to display.
 java.lang.Integer batchSize()
          The current batch size
 java.lang.String containerCssClass()
          The css class to use for the surrounding div
 java.lang.Integer currentBatchIndex()
          The current batch index
 java.lang.String forwardString()
          The string for the forward link
 boolean hasMoreThanOneBatch()
          Returns whether we have more than one batch and should show the navigation at all
 boolean isFirstBatch()
          Returns true if the currently displayed batch is the first one (for hiding the arrows on the left)
 boolean isLastBatch()
          Returns true if the currently displayed batch is the last one (for hiding the arrows on the right)
 boolean isSelected()
          Returns whether the currently generated item from the repetition is the selected one
 java.lang.Integer lastBatch()
          Returns the number of the last page
 ERXLocalizer localizer()
          Convenience method to get the localizer.
 java.lang.Integer nextBatch()
          Returns the number for the next batch
 java.lang.Integer numberOfObjects()
          The total number of objects for which we create the batches
 java.lang.Integer previousBatch()
          Returns the number for the previous batch
 void reset()
          Reset the instance variables
 void setActionClass(java.lang.String className)
          Sets the name of the actionClass to use for the direct action call
 void setActionName(java.lang.String name)
          Sets the name of the direct action to call
 void setAdditionalUrlParameters(com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object> dict)
          Set the parameters to add to each link
 void setBackString(java.lang.String s)
          Set the string for the "back" link
 void setBatchSize(java.lang.Integer size)
          Set the size of the batches to create the pager
 void setContainerCssClass(java.lang.String cssClass)
          Set the class name for the surrounding div
 void setCurrentBatchIndex(java.lang.Integer index)
          Set the current batch index
 void setForwardString(java.lang.String s)
          Set the string for the "forward" link
 void setNumberOfObjects(java.lang.Integer n)
          Set total number of objects for which we create the batches
 void setShowBatchNavigationForSinglePage(java.lang.Boolean flag)
          Set the binding value for showBatchNavigationForSinglePage
 void setShowPageNumbers(java.lang.Boolean flag)
          Set whether to show the page numbers
 void setShowPageString(java.lang.Boolean flag)
          Set whether to show the string "Page:"
 java.lang.Boolean showBatchNavigationForSinglePage()
          Return the value for the showBatchNavigationForSinglePage binding
 boolean showNavigationBar()
          Should we show the batch navigation bar? Checks the binding "showBatchNavigationForSinglePage"
 java.lang.Boolean showPageNumbers()
          Returns whether to show the page numbers
 java.lang.Boolean showPageString()
          Returns whether or not to show the string for "Page:"
 
Methods inherited from class er.extensions.components.ERXStatelessComponent
isStateless, valueForBooleanBinding, valueForBooleanBinding, valueForBooleanBinding, valueForIntBinding, valueForObjectBinding, valueForObjectBinding
 
Methods inherited from class er.extensions.components.ERXNonSynchronizingComponent
appendToResponse, invokeAction, resetCachedBindingsInStatefulComponent, synchronizesVariablesWithBindings, takeValuesFromRequest
 
Methods inherited from class er.extensions.components.ERXComponent
_awakeInContext, _checkAccess, _frameworkName, _includeCSSResources, _includeJavascriptResources, additionalCSSFiles, additionalJavascriptFiles, booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, checkAccess, clickToOpenEnabled, componentName, defaultCSSPath, defaultJavascriptPath, dynamicBindings, floatValueForBinding, intValueForBinding, isPageAccessAllowed, objectValueForBinding, objectValueForBinding, pageWithName, postAppendToResponse, preAppendToResponse, primaryCSSFile, primaryJavascriptFile, stringValueForBinding, stringValueForBinding, useDefaultComponentCSS, useDefaultComponentJavascript
 
Methods inherited from class com.webobjects.appserver.WOComponent
_associationWithName, _childTemplate, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, application, awake, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, isCachingEnabled, isEventLoggingEnabled, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, takeValueForKey, takeValueForKeyPath, template, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForKey, valueForKeyPath
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dictInRepetition

public com.webobjects.foundation.NSDictionary dictInRepetition
The one used in the repetition

Constructor Detail

ERXDirectActionBatchNavigationBar

public ERXDirectActionBatchNavigationBar(com.webobjects.appserver.WOContext context)
Standard constructor

Parameters:
context -
Method Detail

reset

public void reset()
Reset the instance variables

Overrides:
reset in class ERXStatelessComponent

batchNumbers

public com.webobjects.foundation.NSArray<com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object>> batchNumbers()
Returns "batchNumber" objects which are dictionaries with key-value-pairs for the String to display.

Author:
cug - Sep 20, 2007

hasMoreThanOneBatch

public boolean hasMoreThanOneBatch()
Returns whether we have more than one batch and should show the navigation at all

Author:
cug - Nov 20, 2007

showNavigationBar

public boolean showNavigationBar()
Should we show the batch navigation bar? Checks the binding "showBatchNavigationForSinglePage"

Returns:
true if "showBatchNavigationForSinglePage" is true or there is more than one page
Author:
cug - Nov 20, 2007

isSelected

public boolean isSelected()
Returns whether the currently generated item from the repetition is the selected one

Returns:
true for the selected batch (page)

previousBatch

public java.lang.Integer previousBatch()
Returns the number for the previous batch

Returns:
the previous batch number

nextBatch

public java.lang.Integer nextBatch()
Returns the number for the next batch

Returns:
the number for the next batch

lastBatch

public java.lang.Integer lastBatch()
Returns the number of the last page


isLastBatch

public boolean isLastBatch()
Returns true if the currently displayed batch is the last one (for hiding the arrows on the right)

Returns:
true for the last batch

isFirstBatch

public boolean isFirstBatch()
Returns true if the currently displayed batch is the first one (for hiding the arrows on the left)

Returns:
true for the first batch

localizer

public ERXLocalizer localizer()
Convenience method to get the localizer.

Overrides:
localizer in class ERXComponent
Returns:
the current localizer

actionName

public java.lang.String actionName()
Returns the name of the direct action to call

Returns:
a direct action name

setActionName

public void setActionName(java.lang.String name)
Sets the name of the direct action to call

Parameters:
name - - a direct action name

actionClass

public java.lang.String actionClass()
Returns the name of the direct action class, if empty the default class is used (DirectAction)

Returns:
a name for a subclass of WODirectAction

setActionClass

public void setActionClass(java.lang.String className)
Sets the name of the actionClass to use for the direct action call

Parameters:
className - - name for the directAction class

batchSize

public java.lang.Integer batchSize()
The current batch size

Returns:
the batch size

setBatchSize

public void setBatchSize(java.lang.Integer size)
Set the size of the batches to create the pager

Parameters:
size -

numberOfObjects

public java.lang.Integer numberOfObjects()
The total number of objects for which we create the batches

Returns:
total number of objects

setNumberOfObjects

public void setNumberOfObjects(java.lang.Integer n)
Set total number of objects for which we create the batches

Parameters:
n -

currentBatchIndex

public java.lang.Integer currentBatchIndex()
The current batch index

Returns:
the current batch index

setCurrentBatchIndex

public void setCurrentBatchIndex(java.lang.Integer index)
Set the current batch index

Parameters:
index - - the index to set

additionalUrlParameters

public com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object> additionalUrlParameters()
The parameters to add to each link

Returns:
dict of parameters

setAdditionalUrlParameters

public void setAdditionalUrlParameters(com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object> dict)
Set the parameters to add to each link

Parameters:
dict -

containerCssClass

public java.lang.String containerCssClass()
The css class to use for the surrounding div

Returns:
css class name

setContainerCssClass

public void setContainerCssClass(java.lang.String cssClass)
Set the class name for the surrounding div

Parameters:
cssClass -

showPageString

public java.lang.Boolean showPageString()
Returns whether or not to show the string for "Page:"

Returns:
the value for the binding

setShowPageString

public void setShowPageString(java.lang.Boolean flag)
Set whether to show the string "Page:"

Parameters:
flag -

forwardString

public java.lang.String forwardString()
The string for the forward link


setForwardString

public void setForwardString(java.lang.String s)
Set the string for the "forward" link

Parameters:
s -

backString

public java.lang.String backString()
the string for the "back" link


setBackString

public void setBackString(java.lang.String s)
Set the string for the "back" link

Parameters:
s -

showPageNumbers

public java.lang.Boolean showPageNumbers()
Returns whether to show the page numbers

Returns:
true for showing the numbers, defaults to true

setShowPageNumbers

public void setShowPageNumbers(java.lang.Boolean flag)
Set whether to show the page numbers

Parameters:
flag -

showBatchNavigationForSinglePage

public java.lang.Boolean showBatchNavigationForSinglePage()
Return the value for the showBatchNavigationForSinglePage binding

Returns:
value for the showBatchNavigationForSinglePage binding
Author:
cug - Nov 20, 2007

setShowBatchNavigationForSinglePage

public void setShowBatchNavigationForSinglePage(java.lang.Boolean flag)
Set the binding value for showBatchNavigationForSinglePage

Parameters:
flag -
Author:
cug - Nov 20, 2007

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.