to.etc.domui.pages.generic
Class BasicListPage<T>

java.lang.Object
  extended by to.etc.domui.dom.css.CssBase
      extended by to.etc.domui.dom.html.NodeBase
          extended by to.etc.domui.dom.html.NodeContainer
              extended by to.etc.domui.dom.html.Div
                  extended by to.etc.domui.dom.html.UrlPage
                      extended by to.etc.domui.pages.generic.BasicPage<T>
                          extended by to.etc.domui.pages.generic.BasicListPage<T>
All Implemented Interfaces:
java.lang.Iterable<NodeBase>, IModelBinding, INodeErrorDelegate, IDraggable, IDropTargetable

public abstract class BasicListPage<T>
extends BasicPage<T>

Generic page handling some cruddy stuff. FIXME Example only; VP specific one should exist.

Author:
vmijic Created on 29 Jul 2009

Constructor Summary
BasicListPage(java.lang.Class<T> clz)
           
BasicListPage(java.lang.Class<T> baseClass, java.lang.String txt)
           
 
Method Summary
protected  void adjustCriteria(QCriteria<T> crit)
           
 void createContent()
           
protected  void customizeLookupForm(LookupForm<T> lf)
          Override this to customize the lookup form.
protected  LookupForm<T> getLookupForm()
           
protected  IQueryHandler<T> getQueryHandler()
           
 IRowRenderer<T> getRowRenderer()
          Get the row renderer to use for the request.
 boolean hasEditRight()
           
 boolean isAllowEmptySearch()
          When set to T this allows searching a set without any specified criteria.
 boolean isSearchImmediately()
          When set to TRUE this makes the form immediately execute a query with all empty lookup fields, meaning it will immediately show a list of rows.
protected  void onLookupFormClear(LookupForm<T> lf)
          Override to do extra things when the lookupform's "clear" button is pressed.
protected abstract  void onNew()
          Implement to handle pressing the "new record" button.
abstract  void onSelect(T rcord)
          Implement to handle a selection of a record that was found.
protected  void onShelve()
           
 void setAllowEmptySearch(boolean allowEmptySearch)
          When set to T this allows searching a set without any specified criteria.
protected  void setLookupForm(LookupForm<T> lookupForm)
           
protected  void setQueryHandler(IQueryHandler<T> queryHandler)
           
 void setRowRenderer(IRowRenderer<T> rr)
          Override to provide your own Row Renderer.
 void setSearchImmediately(boolean searchImmediately)
          When set to TRUE this makes the form immediately execute a query with all empty lookup fields, meaning it will immediately show a list of rows.
 
Methods inherited from class to.etc.domui.pages.generic.BasicPage
addPageHeaders, addPageTitleBar, clearGlobalMessages, getBaseClass, getTitleBar, setPageTitle
 
Methods inherited from class to.etc.domui.dom.html.UrlPage
getPageTitle, onDestroy, onReload
 
Methods inherited from class to.etc.domui.dom.html.Div
afterCreateContent, componentHandleWebAction, fadeIn, fadeOut, getCustomUpdatesCallJS, getDragHandler, getDropBody, getDropHandler, getDropMode, getReturnPressed, setDragHandler, setDropBody, setDropHandler, setReturnPressed, slideDown, slideUp, tb, visit
 
Methods inherited from class to.etc.domui.dom.html.NodeContainer
add, add, add, addTable, canContain, delegateTo, findChildIndex, forceRebuild, getChild, getChildCount, getChildren, getDeepChild, getDeepChildren, getErrorFence, internalCheckNotDirty, internalClearDelta, internalClearDeltaFully, internalGetOldChildren, internalShelve, internalUnshelve, iterator, moveControlToModel, moveModelToControl, onRefresh, removeAllChildren, removeChild, removeChild, replaceChild, setControlsEnabled, setErrorFence, setErrorFence, setText, setValue
 
Methods inherited from class to.etc.domui.dom.html.NodeBase
$, acceptRequestParameter, addCssClass, addGlobalMessage, appendAfterMe, appendBeforeMe, appendCreateJS, appendJavascript, build, changed, clearFocusRequested, clearGlobalMessage, clearGlobalMessage, clearGlobalMessage, clearMessage, findComponentBundle, getActualID, getAllocationTracepoint, getClicked, getComponentBundle, getCreateJS, getCssClass, getErrorDelegate, getErrorLocation, getMessage, getOnClickJS, getOnMouseDownJS, getPage, getParent, getParent, getParent, getSharedContext, getSpecialAttribute, getSpecialAttributeList, getTag, getTestID, getTitle, getUserObject, handleDrop, hasCssClass, hasError, internalGetOldParent, internalHasChangedAttributes, internalNeedClickHandler, internalOnClicked, internalOnValueChanged, internalSetHasChangedAttributes, internalSetHasChangedAttributes, internalSetLogAllocations, internalSetTag, isBuilt, isFocusRequested, isStretchHeight, onAddedToPage, onBeforeFullRender, onForceRebuild, onHeaderContributors, onRemoveFromPage, onUnshelve, refresh, remove, removeCssClass, renderJavascriptState, replaceWith, setClicked, setComponentBundle, setCssClass, setErrorDelegate, setErrorLocation, setFocus, setMessage, setOnClickJS, setOnMouseDownJS, setSpecialAttribute, setStretchHeight, setTestID, setTitle, setUserObject, toString
 
Methods inherited from class to.etc.domui.dom.css.CssBase
getBackgroundAttachment, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorderBottomColor, getBorderBottomStyle, getBorderBottomWidth, getBorderLeftColor, getBorderLeftStyle, getBorderLeftWidth, getBorderRightColor, getBorderRightStyle, getBorderRightWidth, getBorderTopColor, getBorderTopStyle, getBorderTopWidth, getBottom, getCachedStyle, getClear, getColor, getDisplay, getFloat, getFontFamily, getFontSize, getFontSizeAdjust, getFontStyle, getFontVariant, getFontWeight, getHeight, getLeft, getLineHeight, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOverflow, getPosition, getRight, getTextAlign, getTop, getTransform, getVerticalAlign, getVisibility, getWidth, getZIndex, internalSetDisplay, setBackgroundAttachment, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBorder, setBorderBottomColor, setBorderBottomStyle, setBorderBottomWidth, setBorderColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderStyle, setBorderTopColor, setBorderTopStyle, setBorderTopWidth, setBorderWidth, setBottom, setBottom, setCachedStyle, setClear, setColor, setDisplay, setFloat, setFontFamily, setFontSize, setFontSizeAdjust, setFontStyle, setFontVariant, setFontWeight, setHeight, setLeft, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOverflow, setPosition, setRight, setRight, setTextAlign, setTop, setTop, setTransform, setVerticalAlign, setVisibility, setWidth, setZIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicListPage

public BasicListPage(java.lang.Class<T> clz)

BasicListPage

public BasicListPage(java.lang.Class<T> baseClass,
                     java.lang.String txt)
Method Detail

onSelect

public abstract void onSelect(T rcord)
                       throws java.lang.Exception
Implement to handle a selection of a record that was found.

Parameters:
rcord -
Throws:
java.lang.Exception

onNew

protected abstract void onNew()
                       throws java.lang.Exception
Implement to handle pressing the "new record" button.

Throws:
java.lang.Exception

customizeLookupForm

protected void customizeLookupForm(LookupForm<T> lf)
                            throws java.lang.Exception
Override this to customize the lookup form. No need to call super. method.

Parameters:
lf -
Throws:
java.lang.Exception

createContent

public void createContent()
                   throws java.lang.Exception
Overrides:
createContent in class BasicPage<T>
Throws:
java.lang.Exception

adjustCriteria

protected void adjustCriteria(QCriteria<T> crit)

onShelve

protected void onShelve()
                 throws java.lang.Exception
Overrides:
onShelve in class NodeBase
Throws:
java.lang.Exception

onLookupFormClear

protected void onLookupFormClear(LookupForm<T> lf)
                          throws java.lang.Exception
Override to do extra things when the lookupform's "clear" button is pressed. Can be used to set items to defaults after their input has been cleared. When this is called all inputs in the form have already been set to null (empty) - so do not call LookupForm.clearInput().

Parameters:
lf -
Throws:
java.lang.Exception

getRowRenderer

public IRowRenderer<T> getRowRenderer()
                               throws java.lang.Exception
Get the row renderer to use for the request.

Returns:
Throws:
java.lang.Exception

setRowRenderer

public void setRowRenderer(IRowRenderer<T> rr)
Override to provide your own Row Renderer. If not set a BasicRowRenderer with reasonable defaults will be created for you.


isSearchImmediately

public boolean isSearchImmediately()
When set to TRUE this makes the form immediately execute a query with all empty lookup fields, meaning it will immediately show a list of rows.

Returns:

setSearchImmediately

public void setSearchImmediately(boolean searchImmediately)
When set to TRUE this makes the form immediately execute a query with all empty lookup fields, meaning it will immediately show a list of rows.

Parameters:
showDefaultSearch -

isAllowEmptySearch

public boolean isAllowEmptySearch()
When set to T this allows searching a set without any specified criteria.

Returns:

setAllowEmptySearch

public void setAllowEmptySearch(boolean allowEmptySearch)
When set to T this allows searching a set without any specified criteria.

Parameters:
allowEmptySearch -

hasEditRight

public boolean hasEditRight()

getLookupForm

protected LookupForm<T> getLookupForm()

setLookupForm

protected void setLookupForm(LookupForm<T> lookupForm)

getQueryHandler

protected IQueryHandler<T> getQueryHandler()

setQueryHandler

protected void setQueryHandler(IQueryHandler<T> queryHandler)