Skip to Content
author's profile photo Former Member
Former Member

How to work on Pager.. urjent

Hai friends,

I have a page where it displays all products by material number, now i need to limit results 10 per page, and i already kept pager toolbar.but how to write code when i click increment button(suppose 2 of 100) i need to display next 10 values in my page, does anybody worked on this.if so plz send some sample code

Thnks in advance

leoiz

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 15, 2004 at 07:40 AM

    Mr Thomas,

    i am new to bsp and don't have an idea about MVC, if u have time can u plz explain in simple format..

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Thomas Jung

      Hai Thomas,

      U r excellent, i got it.. its seems tobe simple but i spent hours to get results.at last i got by ur logic.And what u explained to Craig is correct if u use pager u can jump to perticular page just by entering page number and pressing enter.

      now my problem solved.. and ur eligible to get points from my side... Thnks

  • Posted on Dec 15, 2004 at 07:07 AM

    I do this with the following code:

    The following code is in the View. In this example I am showing 6 records per page.

    [code]

    <xhtmlb:toolbar id="tb_results" >

    <xhtmlb:toolbarItem placement="LEFT" >

    <htmlb:textView design="HEADER2" >

    <otr>Search Results Table</otr>

    </htmlb:textView>

    </xhtmlb:toolbarItem>

    <xhtmlb:toolbarItem placement="RIGHT" >

    <%

    data vmax type i.

    data remander type i.

    vmax = lines( model->code3_list ) / 6.

    remander = lines( model->code3_list ) mod 6.

    if remander ne 0 and remander < 3.

    vmax = vmax + 1.

    endif.

    %>

    <xhtmlb:pager id = "ml_pg1"

    text = "Page [$vIndex$] of $vMax$"

    onPage = "pager_onPage"

    vMax = "<%= vmax %>"

    design = "VERTICAL_SIMPLE+INDICATOR" />

    </xhtmlb:toolbarItem>

    </xhtmlb:toolbar>

    <xhtmlb:overflowContainer mode = "SCROLL"

    height = "175px" >

    <htmlb:tableView id = "mq_code3_0060_docs"

    design = "ALTERNATING"

    selectionMode = "LINEEDIT"

    footerVisible = "false"

    filter = "SERVER"

    sort = "SERVER"

    fillUpEmptyRows = "TRUE"

    visibleFirstRow = "<%= model->VINDEX_bypage * 6 - 5 %>"

    table = "//model/code3_list"

    visibleRowCount = "6" />

    </xhtmlb:overflowContainer>

    [/code]

    This is the code in the event handler (I use MVC - DO_HANDLE_EVENT). This traps the paper event and resets the index.

    [code]

    data: event_id type string.

    event_id = event.

    if htmlb_event is not initial.

    event_id = htmlb_event->id.

    endif.

    data: model type ref to zcl_bsp_m_mfglbl.

    data: appl type ref to zcl_ep_bsp_appl_mfglbl_prt.

    ****Get a Pointer to the application Object

    appl ?= application.

    ****Get a pointer to the Model Object.

    model ?= appl->model.

    ****The pager control has been pressed (Up or Down ?) - Get the new pager Index

    if event = 'ml_pg1'.

    data: pager type ref to cl_xhtmlb_pager.

    pager ?= htmlb_event_ex.

    if model is not initial.

    model->vindex_bypage = pager->vindex.

    endif.

    endif.

    [/code]

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.