All Downloads are FREE. Search and download functionalities are using the official Maven repository.

WEB-INF.tld.valuelist.tld Maven / Gradle / Ivy

There is a newer version: 1.1.9
Show newest version





  1.0
  1.2
  vlh
  http://valuelist.sourceforge.net/tags-valuelist
  Value List Handler
  Value List Handler

  
    root
    net.mlw.vlh.web.tag.ValueListSpaceTag
    JSP
    
      Example
      
        
  • <vlh:root id="tableOfBooks" value="list" url="?" includeParameters="bookId|#" >
  • It will forward request param 'bookId' as well. Actions params are excluded automatically for any tableId. ValueListInfo.DO_FOCUS param you cannot forward. It is forbidden.

    ]]>
    value true true java.lang.String The name of the variable containing a ValueList or a List in the given scope.

  • Instancies of List are automatically wrapped by DefaultListBackedValueList with the default ValueListInfo. (Thus information about list is always dropped.)
  • ]]>
    scope false true java.lang.String Specify where to find a variable containng ValueList or a List. Valid options are: request|session|application, the default is request.

    Warning: When you are using ValueListHandlerHelper you should always use request scope!

    ]]>
    id false true java.lang.String If more than one table is included in one request then an id can be assigned to a table. The id is appended to all the parameters. For example if you had a table with an id="(bob)" then the pagging parameter would be ?paggingColumn=firstName(bob)

    When no id is specified, it is used the default id. See javadoc for the class TableInfo.DEFAULT_ID.

    When you are using handler helper ValueListHandlerHelper in your mvc controller, the id is used to build information about a list (ValueListInfo) obtained from request (or from the session, when no info was found in the request). Therefore you need to specify unique id in whole application.

    ]]>
    url true true java.lang.String The base url to post back to. All links generated in table start with this url. Only tag action can overide it.

    Example

    <vlh:root id="MyTable" value="list" url="?" includeParameters=" " >

      Here are starting all links with the prefix "?". Thus result is like this:

      <a href="?param1=value1&....&paramN=valueN" >

      <vlh:action url="/delete.html?" >

        Omited other innner parts.

        Here are starting all links with the prefix "/delete.html?". Thus result is like this:

        <a href="/delete.html?param1=value1&....¶mN=valueN" >

      </vlh:action>
    </vlh:root>

    ]]>
    includeParameters false true java.lang.String A pipe delimited list of parameters to include (forward) when encoding every url in table.

    • # - forward only control (like sortColumn, pagingPage, etc.) parameters of others tables in jsp

      Automatically exclude params with the prefix of the ACTION_TEMP_PARAM_PREFIX.

    • $ - forward only parameters of others tables in jsp that stats with prefix ACTION_TEMP_PARAM_PREFIX.
    • partOfParam - forward parameteres that starts with prefix partOfParam.

      Automatically are excluded keys start with

        ACTION_TEMP_PARAM_PREFIX and with
        DO_FOCUS+id of this table.

    • myForwardParameterOne|myForwardParameterTwo - forward parameter from request if the name is as the same as myForwardParameterOne or myForwardParameterTwo

    Example

  • <vlh:root id="tableOfBooks" value="list" url="?" includeParameters="bookId|partOfParam |#" >

  • It will forward request param 'bookId' and all keys start with the prefix 'partOfParam' as well. Actions params are excluded automatically for any tableId.

  • <vlh:root id="tableOfBooks" value="list" url="?" includeParameters=" |$" >

  • It will forward all params request, only one param you cannot forward : ValueListInfo.DO_FOCUS.

    ]]>
    excludeParameters false true java.lang.String cannot use params like #,$ as the same as in includeParameters ]]> configName false true java.lang.String The name of the configuration bean to use. This much reference a net.mlw.vlh.web.ValueListConfigBean bean defined in your spring configuration file.

    Example of the configuration bean

    <bean id="classicLook" singleton="true" class="net.mlw.vlh.web.ValueListConfigBean">
      <property name="displayHelper"><bean class="net.mlw.vlh.web.util.PassThroughDisplayHelper" /></property>
      <property name="linkEncoder"><bean class="net.mlw.vlh.web.tag.support.DefaultLinkEncoder" /></property>
      <property name="messageSource">
        <bean class="org.springframework.context.support.ResourceBundleMessageSource">
          <property name="basename"><value>classicLook</value></property>
        </bean>
      </property>
      <property name="styleCount"><value>8</value></property>
      <property name="stylePrefix"><value>classicLook</value></property>
      <property name="displayProviders">
        <map>
          <entry key="html">
            <bean id="classicLookHtmlDisplayProvider" class="net.mlw.vlh.web.tag.support.HtmlDisplayProvider">
              <property name="imageHome"><value>images</value></property>
            </bean>
          </entry>
        </map>
      </property>
    </bean>

    ]]>
    checkbox net.mlw.vlh.web.tag.DefaultColumnCheckBoxTag JSP name true true title false true property true true attributes false true Allow you to specify html tag attributes "inline"-without writing additinal vlh's tags.

    Example

    <vlh:column title="lastname" property="lastname" sortable="desc" attributes="width='150'"/>

    ]]>
    filter net.mlw.vlh.web.tag.FilterTag JSP This tag generates an anchor, including all the parameters. url true true The base of the url. select net.mlw.vlh.web.tag.DefaultSelectTag JSP name true true attributes false true Allow you to specify html tag attributes "inline"-without writing additinal vlh's tags.

    Example

    <vlh:column title="lastname" property="lastname" sortable="desc" attributes="width='150'"/>

    ]]>
    value true true text true true
    filters net.mlw.vlh.web.tag.FilterListTag JSP key true true format false true row net.mlw.vlh.web.tag.DefaultRowTag net.mlw.vlh.web.tag.DefaultRowTei JSP This is an iterate tag. This tage takes the ValueList and iterates the elements in the ValueList.list property. bean true true java.lang.String The name of the pageContext key to place the current iteration on.

    Example

    Considere that we have an class Player with method getId.

    <vlh:row bean="player">

      Using EL language we shows the player id ${player.id}.
    </vlh:row>

    ]]>
    display false true java.lang.String Specify the name of an display adapter (defined in configuration bean) to use, default is html.

    Example

    JSP
    display="html" bean="player"gt;
    Configuration bean

    <bean id="classicLook" singleton="true" class="net.mlw.vlh.web.ValueListConfigBean">

      Ommited content. <property name="displayProviders">
        <map>
          <entry key="html">
            <bean id="classicLookHtmlDisplayProvider" class="net.mlw.vlh.web.tag.support.HtmlDisplayProvider">
              <property name="imageHome"><value>images</value></property>
            </bean>
          </entry>
          <entry key="csv"><ref bean="csvDisplayProvider" /></entry>
          <entry key="excel"><ref bean="excelDisplayProvider" /></entry>
        </map>
      </property>
    </bean>
    <bean id="csvDisplayProvider" class="net.mlw.vlh.web.tag.support.CsvDisplayProvider"/>
    <bean id="excelDisplayProvider" class="net.mlw.vlh.web.tag.support.ExcelDisplayProvider"/>

    ]]> disableHeader false true boolean Disable rendering of header. Default is false. But when there are not specified column's titles, it will skip rendering anyway.

    Usage
  • true
  • Skip zero (header) row of the table.
  • false
  • Default setting. Automatic detection of rendering header. (Check if at least one column has a title, if yes, render header row, if no, skip it.) ]]> nestedHeader false true boolean Specifies how to render the value list header in case of nested value list (the default is true).

    Usage
    • false
    • - the header of the nested value list is rendered as a part of the header of the top value list
    • true
    • - the header is rendered for each nested valuelist
    ]]>
    header net.mlw.vlh.web.tag.DefaultHeaderTag JSP Example <vlh:header>
      <vlh:column title="playerid" property="playerid" sortable="desc" />
      <vlh:column title="lastname" property="lastname" sortable="desc" />
    </vlh:header>
    ]]>
    inverted-row net.mlw.vlh.web.tag.InvertedRowTag net.mlw.vlh.web.tag.DefaultRowTei JSP bean true true title true true column net.mlw.vlh.web.tag.DefaultColumnTag JSP Render a column of the iterated row.

    Example

    <vlh:column title="Id of Player" property="id" sortable="desc" emphasisPattern="1"/>
      Render column with the title "Id of Player." and in its rows will be ids, some of them will be highlighted, if they contains "1".
    ]]>
    sortable false true java.lang.String asc
  • Column will be sorted ascending.
  • desc
  • The column will be sorted descending. When you ommit whole attribute, you disable option to sort this column.

    Example

    <vlh:column title="playerid" property="playerid" sortable="desc" emphasisPattern="100"/> ]]>
    property false true java.lang.String Usage <vlh:column title="Product" property="price" sortable="desc" />

    Note:To retrieve date from row javabean you can use expresion like "price.inEuro". For more details see org.apache.commons.beanutils.PropertyUtils. ]]> groupKey false true java.lang.String todo adapterProperty false true java.lang.String When is it not set or null, it is used the default property as the same as ordinary javabean property.

    Usage

    <vlh:column title="FirstAsString" property="firstNameAsString" adapterProperty="firstName" sortable="desc" />

    Example

    We would like to have an class Player, that would return firstname via getFirstName, and firstName + "As String" via getFirstNameAsString.

    The adapterProperty is used in a adapter to sort, e.g. like this:

      FROM Player ORDER BY Player.firstName asc
    But in the <vlh:column, that also generate row, use the property to retrieve data from the row's javabean, in this case it would be like this:
      Player.getFirstNameAsString()

    Note: When you are using Hibernate20Adapter, see for more details The Hibernate Query Language In this adpter is possible to write adapterProperty like "holidays['national day']", what will result in query like:

    From Calendar By Calendar.holidays['national day'] ]]>
    format false true java.lang.String IThe ValueList can format instance of number,java.util.date or Calendar, it using locale from web browser as default or in given locale.

    Example

  • <vlh:column format="#,###,##0.00" locale="ref to locale instance" .. >
  • Use your given locale.
  • <vlh:column format="#,###,##0.00"
  • Use browser locale.

    ]]>
    locale false true java.util.Locale Usage
  • <vlh:column title="Average" property="averageSalary" sortable="desc" format="#,###,##0.00" locale= <%= new Locale("sk")%> />
  • Which result in formatin numbers in slovak locale. ]]>
    title false true java.lang.String When all column's titles are not specified (null), row tag will skip generating of the header! ]]> emphasisPattern false true java.lang.String Usage
  • <vlh:column title="playerid" property="id" sortable="desc" emphasisPattern="30" />
  • 1230 will be emphased like this 1230. ]]>
    titleKey false true java.lang.String Key used in a message sources specified in the configuration bean.

    Example

    <bean id="classicLook" singleton="true" class="net.mlw.vlh.web.ValueListConfigBean"> Omited content. <property name="messageSource"> <bean class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename"><value>classicLook</value></property> <property name="parentMessageSource"><ref bean="resourceI18nBundle" /></property> </bean> </property> </bean>

    ]]>
    sum false true java.lang.String Enable summing a column.

    Example

    <vlh:row bean="product"> <vlh:column title="Product price" property="price" sortable="desc" sum="totalPrice" /> </vlh:row>

    The summed column value (TotalPrice) you can retrieve using :
      <%=pageContext.getAttribute("TotalPrice")%>
    ]]>
    attributes false true java.lang.String Allow you to specify html tag attributes "inline"-without writing additinal vlh's tags.

    Example

    <vlh:column title="lastname" property="lastname" sortable="desc" attributes="width='150'"/>

    ]]>
    default false true java.lang.String Specify a string for the property's null token. When you set this attribute, you overide default null token from the configuration bean.

    Example

    <vlh:column title="lastname" property="lastname" sortable="desc" attributes="width='150'"/>

    ]]>
    toolTip false true java.lang.String It's useful when you don't want a long title but still you'd like to provide to a user a more detailed info about the column. ]]> toolTipKey false true java.lang.String Key of tooltip of the column's title (shown when a mouse is over the title). The key is used to look up the tooltip string in message sources specified in the configuration bean.
    It's useful when you don't want a long title but still you'd like to provide to a user a more detailed info about the column.

    Example

    <bean id="classicLook" singleton="true" class="net.mlw.vlh.web.ValueListConfigBean"> Omited content. <property name="messageSource"> <bean class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename"><value>classicLook</value></property> <property name="parentMessageSource"><ref bean="resourceI18nBundle" /></property> </bean> </property> </bean>

    ]]>
    dynabean net.mlw.vlh.web.tag.DynaBeanColumnsTag JSP sortable false true include false true exclude false true attribute net.mlw.vlh.web.tag.support.AttributeTag JSP Append to the nearest parent that implement interface Attributeable html attributes.

    Usage

    <vlh:row bean="player">
      <vlh:attribute name="onclick">toggle(this);</vlh:attribute> ...
    </vlh:row>

    Result in

      <tr onclick="toggle(this);"> ... <tr>

    ]]>
    name true true java.lang.String The name of html attribute. value false true java.lang.String The value of html attribute.
    paging net.mlw.vlh.web.tag.DefaultPagingTag JSP Summary
    and StylePrefix+Summary analogical for paging : Paging and StylePrefix+Paging or for whole table PagingTag and StylePrefix+PagingTag
    1. <vlh:paging showSummary="true" pages="3" </vlh:paging>
        This will generate somethink like this 1 2 3
    2. <vlh:paging showSummary="true" pages="3"><c:out value="${page}"/></vlh:paging>
        The same usage but with non empty body content using pageContext's variable page. If you are using more than 1 table, the name of the page variable is different. At that case it's like this: pageMyTable, where MyTable is vlh:Root's id.
    3. <vlh:paging showSummary="true" showItemsPerPage="true" pages="3" </vlh:paging>
        This will generate input box with for number of items per page as well. (It use javascript to set conreate value.,this will be removed in near feature.)
    ]]> pages false true int Note
    You must specify somethink in the inner tag's body content, otherwise will not generete quick paging. ]]> showItemsPerPage false true boolean If you like to, you can add your properties file in your locale and add this lines of code in your language:

    Items per page info
    1. paging.itemsPerPage.label = Items Per Page:
    2. paging.itemsPerPage.title = Number of items per page.
    3. paging.itemsPerPage.button = Set
    4. The style class of input box is ItemsPerPage and StylePrefix+ItemPerPage.
    ]]>
    generateItemsPerPageForm false true boolean showSummary false true boolean If you like to, you can add your properties file in your locale and add this lines of code in your language:

    Summary info:(is on the left)
    1. paging.text.totalRow={0} Total
    2. paging.text.pageFromTotal= {0} of {1} page(s)
    Paging info: (is on the right)
    1. paging.first(off), paging.first(on)
    2. paging.previous(off), paging.previous(on)
    3. paging.forward(off), paging.forward(on)
    4. paging.last(off), paging.last(on)
    5. paging.delim
    6. paging.text.totalRow
    7. paging.text.pageFromTotal
    Focus info:
    1. paging.focus(on), paging.focus(off), paging.focus(disabled), paging.focus(error)
    ]]>
    attributes false true Allow you to specify html tag attributes "inline"-without writing additinal vlh's tags.

    Example

    <vlh:column title="lastname" property="lastname" sortable="desc" attributes="width='150'"/>

    ]]>
    focusStatus net.mlw.vlh.web.tag.FocusStatusTag JSP When you set ValueListInfo.focusProperty, the focus is enabled and the tag will generate status. Otherwise it drop all bodycontent from this tag.

    It return ValueListInfo.FOCUS_FOUND, ValueListInfo.FOCUS_TOO_MANY_ITEMS, ValueListInfo.FOCUS_FOUND.

    To generate status it use this message source's properties:

    • focusStatus.tooManyItems =≶li>Too many items≶/li>
    • focusStatus.notFound = ≶li>The focus value {0} not found≶/li>

    ]]>
    retrieve net.mlw.vlh.web.tag.ValueListRetriever JSP Retrieve a ValueList from adapter in a JSP. In MVC style programming you should't do that! Instead of this use ValueListHandlerHelper in a controller.

    Example

    <vlh:retrieve name="players1" focusProperty ="id" focusValue ="30204" />

      It retrievies data from the named adapter "players1" and focus on page, where is player with id 30204.

    The name of adapter depends on configuration bean, where is a map of adapters like this:

      <bean id="valueListHandler" singleton="true" class="net.mlw.vlh.DefaultValueListHandlerImpl">
        <property name="config.adapters">
          <map>
            <entry key="players1">
              <bean class="net.mlw.vlh.adapter.hibernate.Hibernate20Adapter">
                <property name="sessionFactory"><ref bean="mySessionFactory"/></property> <property name="defaultNumberPerPage"><value>20</value></property> <property name="defaultSortColumn"><value>lastName</value></property> <property name="defaultSortDirection"><value>asc</value></property> <property name="hql">
                  <value>
                    FROM net.mlw.data.Player AS vo /~name: WHERE vo.lastName LIKE {name} ~/ /~sortColumn: ORDER BY vo.[sortColumn] [sortDirection]~/
                  </value>
                </property>
                <property name="defaultFocusPropertyObjectAlias"><value>vo</value></property>
                <property name="maxRowsForFocus"><value>160000</value></property>
                <property name="removeEmptyStrings"><value>true</value></property>
              </bean>
            </entry>
          ... </map>
        </property>
      </bean>

    ]]> name true true java.lang.String The name of adpater to retrieve ValueList data. focusProperty false true java.lang.String The adapter property of the list column to determine focusValue in generated hql. Use this options rather via MVC and ValueListInfo.setFocusProperty(). focusValue false true java.lang.String Adapter will scroll to focused value and try to highlight it. If there is too many items, or value is not found or found, it set focus status (ValueListInfo.FOCUS_NOT_FOUND, ValueListInfo.FOCUS_TOO_MANY_ITEMS, ValueListInfo.FOCUS_FOUND ) controls net.mlw.vlh.web.tag.ControlsTag JSP Use to add special column for controling of the row. title false true java.lang.String titleKey false true java.lang.String column's titleKey ]]> action net.mlw.vlh.web.tag.ActionTag JSP Example <vlh:root url="baseUrl.do" >
      <vlh:controls titleKey="Control" >
      • <vlh:action url="edit.jsp?" customParameters="<%=customParams%>">

        Add custom hashMap params to url and use "edit.jsp?" as the base url.

          <vlh:addParam name="dynamicId" property="id" temp="false"/>

          Add to parent (action) param.

        This is a link 1.

        </vlh:action>
      • Render url like ..\edit.jsp?&dynamicId="Row-Java-Bean.getId()"&custumParam1=customParamValue1&....&customParamN=customParamValueN


        |
      • <vlh:action customParameters="<%=customParams%>">

        Add custom hashMap params to url and use <vlh:root url="baseUrl.do" as the base url.

          <vlh:addParam name="dynamicId" property="id" temp="false"/>
        This is a link 2.

        </vlh:action>
      • Thus Rendered url is like ..\baseUrl.do?&dynamicId="Row-Java-Bean.getId()"&custumParam1=customParamValue1&....&customParamN=customParamValueN

      </vlh:controls>
    ...
    </vlh:root> ]]>
    url false true java.lang.String If is not set, use root tag base url. customParameters false true java.util.HashMap A HasMap of parameters to append in rendered URL for the Action.
    addParam net.mlw.vlh.web.tag.AddParamTag JSP Example Action <vlh:action url="\delete.do?" customParameters="<%=customParams%>">
      This will generate base url ..\delete.do?
    • <vlh:addParam name="id" property="id" temp="true"/>
    • Add param to url like &ACTid="Row-Java-Bean.getId()"

    • <vlh:addParam name="id" property="id" temp="false"/>
    • Add param to url like &id="Row-Java-Bean.getId()"

    • <vlh:addParam property="xyz" />
    • Add param to url like &ACTxyz="javabean.getXyz()"

    • <vlh:addParam name="OneStaticParam" value="OneStaticValue" temp="false"/>
    • In every row of the grid will be rendered url with static param &OneStaticParam="OneStaticValue"

    This is a link </vlh:action>

    Example Root

    <vlh:root url="?" customParameters="<%=customParams%>">
    • <vlh:addParam name="method" value="doView" temp="false"/>
    • Add to the base url a static param. Thus the rendered url look like this
      ..\?method=doView

    </vlh:root> ]]>
    name false true java.lang.String The name of the parameter used in rendered URL. property false true java.lang.String The dynamic value of the parameter. The name of the dynamic property, which values are used like the attribute value, but dynamicaly retrevied for the each row. value false true java.lang.String The static value of the parameter. temp false true boolean ACTION_TEMP_PARAM
    prefix to the name of parameter. ]]>




    © 2015 - 2024 Weber Informatics LLC | Privacy Policy