|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagSupport javax.servlet.jsp.tagext.BodyTagSupport net.mlw.vlh.web.tag.ConfigurableTag net.mlw.vlh.web.tag.DefaultPagingTag
Generate buttons to navigate through pages of data using i18n (internationalization). The following keys are required to be define in message sources.
If you like to, you can add your properties file in your locale and add this lines of code in your language:
Summary info:
- paging.text.totalRow={0} Total
- paging.text.pageFromTotal= {0} of {1} page(s)
- paging.itemsPerPage.label = Items Per Page:
- paging.itemsPerPage.title = Number of items per page.
- paging.itemsPerPage.button = Set
Field Summary |
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
id, pageContext |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
DefaultPagingTag()
|
Method Summary | |
int |
doAfterBody()
|
int |
doEndTag()
|
int |
doStartTag()
|
protected ValueListConfigBean |
getConfig()
|
protected Locale |
getLocale()
|
protected String |
getMessage(String code,
Object[] args,
Locale locale)
Try to resolve the message. |
protected String |
getMessage(String code,
Object[] args,
String defaultMessage,
Locale locale)
Try to resolve the message. |
int |
getPages()
|
protected TableInfo |
getTableInfo()
|
protected ValueList |
getValueList()
|
protected ValueListInfo |
getValueListInfo()
|
protected void |
init(javax.servlet.http.HttpServletRequest request)
|
boolean |
isGenerateItemsPerPageForm()
|
boolean |
isShowItemsPerPage()
|
boolean |
isShowSummary()
|
void |
release()
Called on a Tag handler to release state. |
protected void |
renderFocusControl(StringBuffer sb)
|
protected void |
renderItemsPerPage(StringBuffer sb,
HashMap itemsPerPageParameters)
|
protected void |
renderPagingLink(StringBuffer sb,
Map parameters,
String value)
Renders <a> tag for control buttons. |
protected void |
renderPerPageInputBox(StringBuffer sb,
Map attributes)
Render input box for items per page. |
protected void |
renderPerPageLabel(StringBuffer sb,
Map attributes,
String text)
Render label for items per page input box. |
protected void |
renderPerPageSubmitButton(StringBuffer sb,
Map attributes)
Render submit button for items per page input box. |
protected void |
renderSumary(StringBuffer sb)
|
void |
setGenerateItemsPerPageForm(boolean nestedForm)
|
void |
setPages(int pages)
|
void |
setShowItemsPerPage(boolean showItemsPerPage)
Enable or disable generating form for number of items per page. |
void |
setShowSummary(boolean showSummary)
|
Methods inherited from class net.mlw.vlh.web.tag.ConfigurableTag |
appendClassCellAttribute, getAttributes, getCellAttributes, resetAttributes, setAttributes, setCellAttribute |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
getParent, setPageContext, setParent |
Constructor Detail |
public DefaultPagingTag()
Method Detail |
protected ValueListConfigBean getConfig()
protected ValueList getValueList()
protected ValueListInfo getValueListInfo()
protected TableInfo getTableInfo()
protected Locale getLocale()
protected void init(javax.servlet.http.HttpServletRequest request) throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
public int doStartTag() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
TagSupport.doStartTag()
protected String getMessage(String code, Object[] args, Locale locale) throws org.springframework.context.NoSuchMessageException, javax.servlet.jsp.JspException
code
- the code to lookup up, such as 'calculator.noRateSet'args
- Array of arguments that will be filled in for params within
the message (params look like "{0}", "{1,date}", "{2,time}" within a message),
or null if none.locale
- the Locale in which to do the lookup
org.springframework.context.NoSuchMessageException
- if the message wasn't found
javax.servlet.jsp.JspException
protected String getMessage(String code, Object[] args, String defaultMessage, Locale locale) throws org.springframework.context.NoSuchMessageException, javax.servlet.jsp.JspException
code
- the code to lookup up, such as 'calculator.noRateSet'. Users of
this class are encouraged to base message names on the relevant fully
qualified class name, thus avoiding conflict and ensuring maximum clarity.args
- array of arguments that will be filled in for params within
the message (params look like "{0}", "{1,date}", "{2,time}" within a message),
or null if none.locale
- the Locale in which to do the lookupdefaultMessage
- String to return if the lookup fails
org.springframework.context.NoSuchMessageException
javax.servlet.jsp.JspException
protected void renderItemsPerPage(StringBuffer sb, HashMap itemsPerPageParameters) throws org.springframework.context.NoSuchMessageException, javax.servlet.jsp.JspException
sb
- itemsPerPageParameters
-
org.springframework.context.NoSuchMessageException
javax.servlet.jsp.JspException
protected void renderPerPageLabel(StringBuffer sb, Map attributes, String text)
sb
- StringBuffer to render intoattributes
- text
- protected void renderPerPageInputBox(StringBuffer sb, Map attributes)
sb
- StringBuffer to tender intoattributes
- Attributes for rendering a tagprotected void renderPerPageSubmitButton(StringBuffer sb, Map attributes)
sb
- attributes
- protected void renderSumary(StringBuffer sb) throws org.springframework.context.NoSuchMessageException, javax.servlet.jsp.JspException
sb
-
javax.servlet.jsp.JspException
org.springframework.context.NoSuchMessageException
protected void renderFocusControl(StringBuffer sb) throws javax.servlet.jsp.JspException
sb
-
javax.servlet.jsp.JspException
public int doAfterBody() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
IterationTag.doAfterBody()
public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class ConfigurableTag
javax.servlet.jsp.JspException
TagSupport.doEndTag()
protected void renderPagingLink(StringBuffer sb, Map parameters, String value)
<a>
tag for control buttons. Subclasses can overide or extend the method to provide different behaviour.
sb
- StringBuffer to render intoparameters
- Map of parametersvalue
- Labelpublic int getPages()
public void setPages(int pages)
pages
- The pages to set.public boolean isShowSummary()
public void setShowSummary(boolean showSummary)
showSummary
- The showSummary to set.public boolean isShowItemsPerPage()
public void setShowItemsPerPage(boolean showItemsPerPage)
showItemsPerPage
- public boolean isGenerateItemsPerPageForm()
public void setGenerateItemsPerPageForm(boolean nestedForm)
nestedForm
- public void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class ConfigurableTag
Tag.release()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |