Skip to Content
0
Oct 31, 2016 at 03:15 PM

CRM WebUI Table view: Jumping to a certain page

276 Views Last edit Sep 05, 2017 at 06:13 PM 2 rev

Hi Experts,

in CRM 7.0 (EHP1) I try to navigate after a search directly to a certain page/result entry of this result list.

E.g. my result list is 210 entries big, and 50 entries per page are displayed. I want to set the focus on entry no. 190, which in fact is displayed on the 4th page.

I would like to jump directly to page no.4 to set the focus on this entity.

Finding an entity within a collection and setting the focus I already did:

DATA: lv_index TYPE crmt_idx,

lr_marked_item TYPE REF TO if_bol_bo_property_access. *

lv_index = 190.

lr_marked_item ?= lr_context_iterator->get_by_index( iv_index = lv_index ).

IF lr_marked_item IS BOUND.

lr_context_iterator->find_bo( iv_bo = lr_marked_item ).

ENDIF.

BUT the page is not navigation automatically to the 4th page.

I already tried to analyze how stanard is doing it. In CL_THTMLB_CELLERATOR, RENDER_PAGER_ENTRY an piece of javascript is created and triggered as soon as the user clicks on one of the page numbers.

I already tried to trigger this script directly on my .htm-page (e.g. with an hidden button):

<% DATA: lv_script TYPE string.

DATA: lv_id TYPE string.

DATA: lv_button_id TYPE string.

DATA: lv_page TYPE i.

DATA: lv_new_visible_first_row TYPE i.

lv_id = controller->get_id('ItemTree').

lv_new_visible_first_row = ( ( 4 - 1 ) * 50 ) + 1.

* -> create script for press on pager

lv_script = lv_new_visible_first_row.

CONDENSE lv_script NO-GAPS.

CONCATENATE `thtmlbCCelleratorManager.doPage("` lv_id `","` lv_script `");` INTO lv_script. %>

<div style="display:none;">

<thtmlb:button id = "Navigate" onClick = "<%= lv_script %>" />

</div>

<% lv_button_id = controller->get_id('Navigate'). IF lv_script IS NOT INITIAL. %>

<script>

var button = document.getElementById("<%= lv_button_id %>";

button.click();

</script>

<% ENDIF. %>

But it is not working; no automatic navigation to the 4. page.

Can anyone help?