cancel
Showing results for 
Search instead for 
Did you mean: 

HTMLB link using iterator,internal table cleared if link clicked twice.

former_member184111
Active Contributor
0 Kudos

Hi All,

we are showing a column as HTMLB link using iterator .

RENDER_CELL_START

when 'ACTION'.


        if p_edit_mode is not initial.

          data: bee_table  type ref to cl_bsp_bee_table,
                link       type ref to cl_htmlb_link.
          data: cell_id_del(20).


          cell_id_del = p_cell_id.
          create object bee_table.
          link ?= cl_htmlb_link=>factory( id = p_cell_id
                                           text = 'Modify Entries'
                                           o n c l i c k  = 'modify').

          bee_table->add( element = link level = 1 ).
          p_replacement_bee ?= bee_table.

in eventhandler OnInputProcessing , we are executing some ABAP code.

IF event IS NOT INITIAL AND event->event_name = htmlb_events=>link.
  link_event ?= event.

  CASE event->event_server_name.

    WHEN 'modify'.
Some ABAP code.
flag = 'X' .
ENDCASE.

ENDIF.

In Layout we are checking the flag and calling a new popup window using window.open .

When the link is clicked for the first time , everything works fine.

But when we click the link second time , the popup window opens but , in the calling page (which contains the table view)  all the internal tables are refreshed.

Application is stateful.

What can be the reason?

Thanks,

Anubhav

Accepted Solutions (1)

Accepted Solutions (1)

former_member416498
Active Participant
0 Kudos

Hi anubhav

Once check in debugging mode whether you are clearing the internal table of data, else i guess this should not happen.

Regards

Vijay.M

former_member184111
Active Contributor
0 Kudos

Hi Vijay,

I have checked , itabs are not refreshed anywhere and anyways in that case(itabs refreshing somewhere),they should be cleared when the link is clicked the first time only and not only the second time.

One more thing , i set a break point in OnInputProcessing at the event of that link click and before pressing F5 i checked the itabs and they are already refreshed.

Thanks a lot,

Anubhav

former_member184111
Active Contributor
0 Kudos

Anubhav

Answers (2)

Answers (2)

former_member184111
Active Contributor
0 Kudos

Hi,

The URL of window , which is called on click of the link.

w i  nd ow.o p e n('tv_popup.htm?sap-sessioncmd=open&matcode='+matcode+'&end','mywindow','width=440,height=220,resizable=no');

can there be any problem in the url of called window?

Thanks All,

Anubhav

raja_thangamani
Active Contributor
0 Kudos

I would say put the breadk-point in all the events including parent page & pop-up page and debug.

If still issue is not solved, place the complete code here so that I could re-produce the issue in my system.

Raja

former_member184111
Active Contributor
0 Kudos

Hi Raja,

I debugged both pages the calling and the called, but as soon as i click the link for second time and OnInPutprocessing of calling page is triggered , i can see that all the internal tables are refreshed.

The code is as below:

I am using iterator to render the LINK column in tableview.

RENDER_CELL_START

when 'ACTION'.


        if p_edit_mode is not initial.

          data: bee_table  type ref to cl_bsp_bee_table,
                link       type ref to cl_htmlb_link.
          data: cell_id_del(20).


          cell_id_del = p_cell_id.
          create object bee_table.
          link ?= cl_htmlb_link=>factory( id = p_cell_id
                                           text = 'Modify Entries'
                                           o n c l i ck = 'modify').

          bee_table->add( element = link level = 1 ).
          p_replacement_bee ?= bee_table.
        endif.

In BSP Application->Calling page.

OnInputProcessing:

**Event handling for tableView LINK column.
IF event IS NOT INITIAL AND event->event_name = htmlb_events=>link.
  link_event ?= event.

  CASE event->event_server_name.

    WHEN 'modify'.
      flg_tv_popup = 'X' .
read table itab_materials into wa_materials index sy-index.
          matcode = wa_materials-matnr.

ENDCASE.

ENDIF.

Layout:

<% if flg_tv_popup is not initial. %>
  <s c r ipt t y p e='te x t / j av a script'>
  v a r  m a t code="< % =   m a t code %>";
  w i n d o w.op e n ( 't v _ p o pup. h t m?sap-sessioncmd=open&mat c od e= ' +m atc od  e+'&e n d ',' m y wind o w ','w i d th= 4  40,h e i ght  = 220, r e siz ab l e= n o');

  </s c ript>
  <% endif. %>

The called page contains a tableView and a save button which is used to update a ZDB table from the values entered in tableView.

It has nothing to do with the internal tables of calling page , so i guess it wont affect them.

Thanks a lot ,

Anubhav

raja_thangamani
Active Contributor
0 Kudos

Thanks for the code Anubhav. But it will be easier for me re-produce the error if you give me the complete code of calling program such as event where the itab gets filled, layout etc. Also events of called program.

Raja

former_member184111
Active Contributor
0 Kudos

Hi Raja,

i changed the called page URL from:

w i  nd ow.o p e n('tv_popup.htm?sap-sessioncmd=open&matcode='+matcode+'&end','mywindow','width=440,height=220,resizable=no');

to

w i  nd ow.o p e n('tv_popup.htm?matcode='+matcode+'&end','mywindow','width=440,height=220,resizable=no');

ie. removed SAP-SESSIONCMD = OPEN from the URL and its working fine as of now.

But i dont understand , how can the called page URL affect the calling page internal tables?

Thanks a lot for the help .

Regards,

Anubhav

raja_thangamani
Active Contributor
0 Kudos

When you add the SAP-SESSIONCMD = OPEN, it creates new HTTP session everytime when the link is clicked.

This what caused on issue in your case.

Raja

former_member184111
Active Contributor
0 Kudos

Hi Raja,

When i use SAP-SESSIONCMD = OPEN in the URL , it should open a new session eveytime (i guess) only for the page which is called in the URL,how can it affect the session of the calling page?

Thanks,

Anubhav

raja_thangamani
Active Contributor
0 Kudos

Why don't you use "protectDoubleSubmit" tag to avoid the double click?


<xhtmlb:protectDoubleSubmit  active="TRUE"/>

Raja

former_member184111
Active Contributor
0 Kudos

Hi Raja,

The issue is not that the link is clicked twice in succession , even if the user clicks the link after the first click is procssed completely , the itabs are refreshed and i am using protectdoublesubmit.

The problem is that the internal tables refreshed if the link is clicked more than once.

Thanks a lot,

Anubhav

Edited by: Anubhav Jain on Dec 12, 2008 5:56 AM