ERXDirectActionBatchNavigationBar Class Reference

Inherits er::extensions::components::ERXStatelessComponent.

Collaboration diagram for ERXDirectActionBatchNavigationBar:

Collaboration graph
[legend]

List of all members.

Public Member Functions

String actionClass ()
String actionName ()
NSDictionary< String, Object > additionalUrlParameters ()
String backString ()
NSArray< NSDictionary< String,
Object > > 
batchNumbers ()
Integer batchSize ()
String containerCssClass ()
Integer currentBatchIndex ()
 ERXDirectActionBatchNavigationBar (WOContext context)
String forwardString ()
boolean hasMoreThanOneBatch ()
boolean isFirstBatch ()
boolean isLastBatch ()
boolean isSelected ()
Integer lastBatch ()
ERXLocalizer localizer ()
Integer nextBatch ()
Integer numberOfObjects ()
Integer previousBatch ()
void reset ()
void setActionClass (String className)
void setActionName (String name)
void setAdditionalUrlParameters (NSDictionary< String, Object > dict)
void setBackString (String s)
void setBatchSize (Integer size)
void setContainerCssClass (String cssClass)
void setCurrentBatchIndex (Integer index)
void setForwardString (String s)
void setNumberOfObjects (Integer n)
void setShowBatchNavigationForSinglePage (Boolean flag)
void setShowPageNumbers (Boolean flag)
void setShowPageString (Boolean flag)
Boolean showBatchNavigationForSinglePage ()
boolean showNavigationBar ()
Boolean showPageNumbers ()
Boolean showPageString ()

Public Attributes

NSDictionary dictInRepetition

Private Member Functions

int numberOfBatches (int productCount, int sizeOfOneBatch)

Private Attributes

NSArray< NSDictionary< String,
Object > > 
batchNumbers

Static Private Attributes

static final String ACTION_CLASS_KEY = "actionClass"
static final String ACTION_NAME_KEY = "actionName"
static final String ADDITIONAL_URL_PARAMETERS_KEY = "additionalUrlParameters"
static final String BACK_STRING = "backString"
static final String BATCH_SIZE_KEY = "batchSize"
static final String CONTAINER_CSS_CLASS_KEY = "containerCssClass"
static final String CURRENT_BATCH_INDEX_KEY = "currentBatchIndex"
static int defaultBatchSize = 20
static final String FORWARD_STRING = "forwardString"
static final String NUMBER_OF_OBJECTS_KEY = "numberOfObjects"
static final String SHOW_BATCH_NAVIGATION_FOR_SINGLE_PAGE = "showBatchNavigationForSinglePage"
static final String SHOW_PAGE_NUMBERS = "showPageNumbers"
static final String SHOW_PAGE_STRING_KEY = "showPageString"


Detailed Description

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!

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

Author:
cug - Sep 20, 2007

Constructor & Destructor Documentation

ERXDirectActionBatchNavigationBar ( WOContext  context  ) 

Standard constructor

Parameters:
context 


Member Function Documentation

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

String actionName (  ) 

Returns the name of the direct action to call

Returns:
a direct action name

NSDictionary<String, Object> additionalUrlParameters (  ) 

The parameters to add to each link

Returns:
dict of parameters

String backString (  ) 

the string for the "back" link

NSArray<NSDictionary<String, Object> > batchNumbers (  ) 

Returns "batchNumber" objects which are dictionaries with key-value-pairs for the String to display.

Author:
cug - Sep 20, 2007

Integer batchSize (  ) 

The current batch size

Returns:
the batch size

String containerCssClass (  ) 

The css class to use for the surrounding div

Returns:
css class name

Integer currentBatchIndex (  ) 

The current batch index

Returns:
the current batch index

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

Author:
cug - Nov 20, 2007

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

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

boolean isSelected (  ) 

Returns whether the currently generated item from the repetition is the selected one

Returns:
true for the selected batch (page)

Integer lastBatch (  ) 

Returns the number of the last page

ERXLocalizer localizer (  ) 

Convenience method to get the localizer.

Reimplemented from ERXComponent.

Integer nextBatch (  ) 

Returns the number for the next batch

Returns:
the number for the next batch

int numberOfBatches ( int  productCount,
int  sizeOfOneBatch 
) [private]

Returns the number of batches, the first batch has value 1. If the size of one batch is 0, the number of products will be returned, in order to avoid ArithmeticException. If the number of products is 0, it will return 0.

Parameters:
productCount number of products
sizeOfOneBatch size of one batch
Author:
edgar - Nov 23, 2007
Returns:
number of batches

Integer numberOfObjects (  ) 

The total number of objects for which we create the batches

Returns:
total number of objects

Integer previousBatch (  ) 

Returns the number for the previous batch

Returns:
the previous batch number

void reset (  ) 

Reset the instance variables

Reimplemented from ERXStatelessComponent.

void setActionClass ( String  className  ) 

Sets the name of the actionClass to use for the direct action call

Parameters:
className - name for the directAction class

void setActionName ( String  name  ) 

Sets the name of the direct action to call

Parameters:
name - a direct action name

void setAdditionalUrlParameters ( NSDictionary< String, Object >  dict  ) 

Set the parameters to add to each link

Parameters:
dict 

void setBackString ( String  s  ) 

Set the string for the "back" link

Parameters:
s 

void setBatchSize ( Integer  size  ) 

Set the size of the batches to create the pager

Parameters:
size 

void setContainerCssClass ( String  cssClass  ) 

Set the class name for the surrounding div

Parameters:
cssClass 

void setCurrentBatchIndex ( Integer  index  ) 

Set the current batch index

Parameters:
index - the index to set

void setForwardString ( String  s  ) 

Set the string for the "forward" link

Parameters:
s 

void setNumberOfObjects ( Integer  n  ) 

Set total number of objects for which we create the batches

Parameters:
n 

void setShowBatchNavigationForSinglePage ( Boolean  flag  ) 

Set the binding value for showBatchNavigationForSinglePage

Author:
cug - Nov 20, 2007
Parameters:
flag 

void setShowPageNumbers ( Boolean  flag  ) 

Set whether to show the page numbers

Parameters:
flag 

void setShowPageString ( Boolean  flag  ) 

Set whether to show the string "Page:"

Parameters:
flag 

Boolean showBatchNavigationForSinglePage (  ) 

Return the value for the showBatchNavigationForSinglePage binding

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

boolean showNavigationBar (  ) 

Should we show the batch navigation bar? Checks the binding "showBatchNavigationForSinglePage"

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

Boolean showPageNumbers (  ) 

Returns whether to show the page numbers

Returns:
true for showing the numbers, defaults to true

Boolean showPageString (  ) 

Returns whether or not to show the string for "Page:"

Returns:
the value for the binding


Member Data Documentation

final String ACTION_CLASS_KEY = "actionClass" [static, private]

key for the actionClass binding

final String ACTION_NAME_KEY = "actionName" [static, private]

Key for the actionName binding

final String ADDITIONAL_URL_PARAMETERS_KEY = "additionalUrlParameters" [static, private]

the key for the additionalUrlParameters binding

final String BACK_STRING = "backString" [static, private]

the key for the "backString" binding

final String BATCH_SIZE_KEY = "batchSize" [static, private]

key for the batchSize binding

NSArray<NSDictionary<String, Object> > batchNumbers [private]

the batchnumbers to display, cached in this instance, resetted after completion

final String CONTAINER_CSS_CLASS_KEY = "containerCssClass" [static, private]

the key for the surrounding div container class name

final String CURRENT_BATCH_INDEX_KEY = "currentBatchIndex" [static, private]

key for the currentBatchIndex binding

int defaultBatchSize = 20 [static, private]

the default batchSize, defaults to 20

NSDictionary dictInRepetition

The one used in the repetition

final String FORWARD_STRING = "forwardString" [static, private]

the key for the "forwardString" binding

final String NUMBER_OF_OBJECTS_KEY = "numberOfObjects" [static, private]

key for the numberOfObjects binding

final String SHOW_BATCH_NAVIGATION_FOR_SINGLE_PAGE = "showBatchNavigationForSinglePage" [static, private]

key for showBatchNavigationForSinglePage binding

final String SHOW_PAGE_NUMBERS = "showPageNumbers" [static, private]

the key for the "showPageNumbers" bindings

final String SHOW_PAGE_STRING_KEY = "showPageString" [static, private]

the key for the showPageString binding


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