Forum Discussion

scottalvis's avatar
scottalvis
Contributor
12 years ago

Pagination

How do I get page_size? The code below errors out.

 

FreeMarker code:

 

<#assign page_size = webuisupport.path.parameters.name.get("page_size", 5) /> 

 

Error Message:

 

Method public final java.lang.Object lithium.coreapi.webui.template.models.NamedValueByNameTemplateModel.get(java.lang.String,java.lang.Object) threw an exception when invoked on lithium.coreapi.webui.template.models.NamedValueByNameTemplateModel@597223c2 with arguments of types [java.lang.String,java.math.BigDecimal,] The problematic instruction: ---------- ==> assignment: page_size=webuisupport.path.parameters.name.get("page_size", 1) [on line 2, column 1 in preview] ----------

  • Hey Scott,

     

    The parameter you are looking for is page-size, not page_size.

     

    <#assign page_size=webuisupport.path.parameters.name.get("page-size", 5) />
    

     

    Thank you,

     

    Yuri

  • YuriK's avatar
    YuriK
    Khoros Expert

    Hey Scott,

     

    The parameter you are looking for is page-size, not page_size.

     

    <#assign page_size=webuisupport.path.parameters.name.get("page-size", 5) />
    

     

    Thank you,

     

    Yuri