cancel
Showing results for 
Search instead for 
Did you mean: 

Problem regarding calling Client side scipting after Server side Input Proc

Former Member
0 Kudos

Hi All

how do i call a client side window.open(some page in another application ) command after the Server side Input processing.

I wrote a code like this

<script type="text/javascript">

function setEdit()

{

htmlbSL(this , 2, b_edit:onInputProcessing(b_edit));

window.open("<%= V_TARGET_URL%>");

}

</script>

<htmlb:button id = "b_edit"

text = "Edit"

onClientClick = "setEdit();" />

so v_target_url should get generated and with that it should come to window.open and open that page....

But what is happening is WINDOW.OPEN is called before the onInputProcessing command , which is causing all the issues

Can anyone help...

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Question Answered by Raja..

Thanks a lot to all

raja_thangamani
Active Contributor
0 Kudos

Here is the code which will solve your problem..I tested in my system also. Its working perfectly..

But still you need to construct the Target url while selecting the Tableview Row.

<% If V_TARGET_URL is initial.
v_disabled = 'true'.
endif.
%>
<htmlb:button id = "b_edit"
text = "Edit"
disabled = "<%= v_disabled %>"
onClientClick = "Open_URL('<%= V_EDIT_TARGET_URL%>');" />

<b>Event Handling:</b>

  DATA: TV          TYPE REF TO CL_HTMLB_TABLEVIEW,
        EVENT       TYPE REF TO CL_HTMLB_EVENT,
        TABLE_EVENT TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
  FIELD-SYMBOLS <I> LIKE LINE OF SELECTED_IND.
 
  TV ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = REQUEST
                                    NAME    = 'tableView'
                                    ID      = 'tv' ).
  IF TV IS NOT INITIAL.
    TABLE_EVENT = TV->DATA.
    CLEAR  SELECTED_IND.
    SELECTED_IND = TABLE_EVENT->PREVSELECTEDROWINDEXTABLE.
 
    IF TABLE_EVENT->EVENT_TYPE EQ CL_HTMLB_EVENT_TABLEVIEW=>CO_ROW_SELECTION.
      READ TABLE  SELECTED_IND WITH KEY TABLE_LINE = TABLE_EVENT->ROW_INDEX
        TRANSPORTING NO FIELDS.
      IF SY-SUBRC EQ 0.
        DELETE  SELECTED_IND INDEX SY-TABIX.
      ELSE.
        APPEND INITIAL LINE TO  SELECTED_IND ASSIGNING <I>.
        <I> = TABLE_EVENT->ROW_INDEX.
      ENDIF.
    ENDIF.
    DATA:V_COUNT(10).
 
    DESCRIBE TABLE SELECTED_IND LINES V_COUNT.
    IF V_COUNT EQ 1.
 
* Construct your Target URL here..
 
    ENDIF.
  ENDIF.

Raja T