Disable Oncellclick- Tableview

Hi guys,
I'm using Tableview with iterator, in the event GET_COLUMN_DEFINITIONS I've sat my event on a specific column as below:
tv_column-columnname          = 'DELE'.
      tv_column-oncellclick         = 'event_delete'.
      tv_column-title               = cl_bsp_runtime=>get_otr_text( alias = 'YUSCCROT0/DEL' ).
      tv_column-disable_filter      = 'X'.
      tv_column-wrapping            = 'X'.
      tv_column-horizontalalignment = 'CENTER'.
In the RENDER_CELL_START, how can I disable the oncellclick event? I've tried to use image object, but its missed the index when I push the icon.
Thank you in advance,
Alexandre

Dear Alexandre,
My point of view is, your going to operate something in table view and based on that you going to edit/disable the edition of a particular feild.
For this one suggestion is, Based on the selection, you can have your own logic and set some flags. Based on the flags, you can edit/disable the column in GET_COLUMN_DEFINITION itself.
Otherwise, as you asked, in the "RENDER_CELL_START" you can follow the below piece of code, so that you can get the value entered and modify as per your requirement on get_column_definition.
case p_column_key.
when 'JUSTIFICATION'.
     just = m_row_ref->VEND_JUST.
     p_replacement_bee = CL_HTMLB_INPUTFIELD=>FACTORY( id = p_cell_id
                                                       value = just
                                                       type = 'STRING'
                                                      cellValue = 'TRUE' ).
                                           "  size = '60' ).
      endcase.
VEND_JUST is the feild to be edited and P_CELL_ID is the selected record in the table view.
Hope this will be helpful.
Regards,
Gokul.N

Similar Messages

  • Hiding or disabling the check boxes in Tableview  for perticular row

    Hi
       I created table view using ITAREATOR, as per my requirement i need to disable or hide the check box (which come by default) for perticular row.
       Can any body send me the code
    thanks in advance
    B.Umashankar

    Is there a hide-or-disable-checkboxes-in-a-tableView-row contest going on somewhere?
    Please check Leoiz Pas' "How to disable tableView default checkbox" and Marcel Gäbe's "TableView hide checkbox" postings earlier this week (even though there might not have been a final solution yet)!

  • Disable tableview to perform TableCell.update selction

    I am working on javafx2.2 tableview
    My table has 100,000 entries (3 columns one int two float), and new rows are inserted every 20 ms,
    I need it to have active sort capability which is achieved using binary search. But am getting very slow GUI.
    Initially I thought it to be because of table.getItems.add(index,element)
    But when I run Jprofiler it is showing major time is consumed in TableCell.updateSelection (javafx.scene.control.TableCell$2.onChanged).
    Can anyone tell me is it useful to have it.... If yes then how....
    And if I want it to be disabled then how to do it.
    Thank you

    No, you cannot perform parallel dml with a trigger present.
    If you are updating the bulk of the rows and can take an outage, you can
    disable the trigger, perform the update, enable the trigger
    OR
    copy to another table, performing the update in the select, rename the tables and add the trigger on the new table
    Hemant K Chitale

  • Disable Checkbox in TableView

    Hi,
    I am using a HTMLB TableView to visualize data...in the first column of each row theres a Checkbox to select one or more rows... now I want to disable the Checkbox for some rows. Is it possible to achieve this with a custom CellRenderer ? My problem with this approach is, that the method TableView.getValue(...) delivers a String.... I had expected an object or component...in my case a CheckBox...  any suggestions ?
    Thanks in advance
    Oliver

    Hi Oliver,
    myTableView.setRowSelectable(i, false);
    Hope it helps
    Detlev

  • How to disable a default selection checkbox in the tableview

    Hi All,
             How to disable a default selection checkbox in the tableview ???
    I have  a tableview  with a iterator class mentioned on the iterator attribute of the table view. Table is a MULTISELECT tableview . Is it possible to disable or make it invisible a particular row selection check box?.
    For my scenario I have Currency values on all the columns and I want to do a sub total overall total for all the price column fields in the last row of that table. I archived this functionality using Iterator class method. But I don't want the user to delete that last row in any case.
    Thanks for your help in advance.
    Thanks,
    Greetson

    Hi,
      You can NOT disable the "Checkbox" of particular row using HTMLB. I had the same requirement. I achieved using <b>2 Tableviews</b>, one after another. 1st tableview will show all the rows and 2nd Tableview(without Table Header) and without any row. The <b>total</b> will be displayed as <b>Column title</b> of 2nd Tableview.
    Here is the code of 2nd tableview which we used to display the Total:
              <htmlb:tableView id                  = "tv2"
                               headerVisible       = "false"
                               keyColumn           = "appid"
                               footerVisible       = "false"
                               selectionMode       = "SINGLESELECT"
                               design              = "ALTERNATING"
                               fillUpEmptyRows     = "false"
                               visibleRowCount     = "0"
                               width               = "100%"
                               table               = "<%= tot_header %>" >
                <htmlb:tableViewColumns>
                  <htmlb:tableViewColumn columnName = "empno"
                                         title      = "Total"
                                         width      = "50"
                                         type       = "TEXT" >
                  </htmlb:tableViewColumn>
                  <htmlb:tableViewColumn columnName = "ename"
                                         title      = "  *      "
                                         width      = "90"
                                         type       = "TEXT" >
                  </htmlb:tableViewColumn>
                  <htmlb:tableViewColumn columnName = "appamount"
                                         title      = "   <%= tot_appamt %> "
                                         width      = "60" >
                  </htmlb:tableViewColumn>
                  <htmlb:tableViewColumn columnName = "ugjr_amt"
                                         width      = "60"
                                         title      = "<%= tot_ugjr %>" >
                  </htmlb:tableViewColumn>
                  <htmlb:tableViewColumn columnName = "apprvd"
                                         width      = "50"
                                         title      = "*" >
                  </htmlb:tableViewColumn>
                </htmlb:tableViewColumns>
              </htmlb:tableView>
    Hope this will help you.
    <b>Note: Reward each useful post.</b>
    Raja T
    Message was edited by:
            Raja T

  • [iPhone] TableView in editing mode disables selection methods

    When I put mu UITableView in editing mode, via setEditing:animated:, the selection methods from the delegate don't get called. In particular the didSelectRowAtIndexPath method does't get called.
    If I don't put the tableView in editing mode I can select the row as usual. Has anyone else had this issue?

    Found the problem. A tableview has a allowsSelectionWhileEditing property. Set that to YES and it works

  • How to Enable and Disable column in Table Control.

    Hi all,
    I want to make certain column of Table control as Enable or Disable on Button action.
    Enable means ready for input and Disable means not ready for input.
    Please send me sample code.
    Thanks in advance.

    Hi Vipin,
        You have to loop through the table columns to set the properties in the PBO of your screen.
    Here is the sample solution.
    delcare a workarea for the columns in the table control in your top include.
    Table Control .
    CONTROLS: TAB1 TYPE TABLEVIEW USING SCREEN '0100'.
    DATA: WA_COLS LIKE LINE OF TAB1-COLS.
    in your screen
    PROCESS BEFORE OUTPUT.
      MODULE INTIALISE_100.
    *&      Module  0100_INTIALISE  OUTPUT
    MODULE INTIALISE_100 OUTPUT.
        LOOP AT TAB1-COLS INTO WA_COLS.
          WA_COLS-SCREEN-INPUT = 1.
          MODIFY TAB1-COLS FROM WA_COLS TRANSPORTING SCREEN-INPUT.
        ENDLOOP.
    ENDMODULE.                 " 0100_INTIALISE  OUTPUT
    modify the screen-input property as required for the table control columns.
    Please provide points if helpfull.....
    Thanks,
    Karthik
    Message was edited by: Karthik
            Karthikeyan K

  • Set filter for only one column in tableview

    Hi
    i am using in MVC a htmlb:tableview with filter in only one column of 8.
    This is all working fine, except that the user can enter a searchsting in the filterfield for all columns, but in handle_event (of the controller) ; i only react to a text in the filterfield of column 4 and ignore all other filtertext , which were maybe entered in the other columns.
    My question:
    how can i  enter the filter only for one column, in a way that the user cannot enter any text in the filterfield of the other columns, only in column 4 ?
    my view:
    <htmlb:tableView id             = "requirements"
                     table          = "//model/pdst_reqs"
                     filter         = "APPLICATION"                
                     keyColumn       = "EXTID"
                     iterator        = "<%=model%>"
                     footerVisible   = "FALSE"
                     encode          = "TRUE"
                     visibleRowCount = "<%=model->rowcount%>"
                     width           = "100%"/>
    Best Regards
    Britta

    You can disbale the Filter for the particular column by setting the DISABLE_FILTER in the Iterator method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS. Here is the sample code
    method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS .
      CLEAR p_column_definitions.
      CLEAR p_overwrites.
      data tv_column TYPE TABLEVIEWCONTROL.
      tv_column-COLUMNNAME          = 'FLDATE'.
      tv_column-SORT                = 'X'.
      tv_column-EDIT                = 'X'.
      tv_column-ONCELLCLICK         = 'MyCellClick1'.
      tv_column-title               = 'Date '.
      APPEND tv_column TO p_column_definitions.
      CLEAR tv_column.
      tv_column-COLUMNNAME          = 'PRICE'.
      tv_column-horizontalAlignment = 'right'.
      tv_column-verticalAlignment   = 'middle'.
      tv_column-ONCELLCLICK         = 'MyCellClick2'.
      tv_column-title               = 'Currency'. 
      tv_column-EDIT                = 'X'.
      tv_column-DISABLE_FILTER      = 'X'.    " <-------Like this
      APPEND tv_column TO p_column_definitions.
    endmethod.
    Hope this will solve your problem.
    Raja

  • How can I select text in a thtmlb:tableview in a pop-up?

    Hi,
    We have a number of pop-up screens that contain thtmlb:tableview tags.  For some reason, it is not possible to select text (left-mouse click then drag cursor) in these pop-ups.  We are currently having to put any text that the user might want to select in disabled inputfields, but this looks rather ugly. 
    Does anyone have a solution to this problem?  The selection of text within tableviews works fine if the view isn't displayed in a pop-up.
    Many thanks,
    Andrew

    HI Andrew,
    I have a littel problem in understanding the business use case.
    Why should the user want to copy the text from the view.He will either select a row,by using the seletion tabs at the side of the view.
    But why woudl he actually copy the text by left clicking and dragging the mouse over the text.Doesn't look like a valid use case.
    What i have implemened once is where the table in the pop up contains multiple fields,and the user wants the description (ie one field) to be populated automatically into the field after selection of that row in the table view.Thsi can be eaqsily achived by making the table view select option as true and changing the html code also to fetch the selected index.
    After this, the selected entity can be obtained from the collection wrapper,since it becomes the current entity:
    me->typed_context->(context node name)->collection wrapper->get_current()
    Now the desired field from this entity can be copied into the field of your choice in the parent view.Also once the user clicks the selection tab to select the enitty,popup_close method shoudl be called and pop up shoudl be closed immediately.
    All this processing should happen in an even handler eh_onselect().

  • Opening a new window by clicking icon on the tableview

    I would like to open a new popup window to show data by clicking an icon on one tableview. This data is kept in an internal table passed by a parent controller. Is there any example provided? (I am not familiar with the javascript language)

    You will not be able to get the index of the row which is being clicked by this method.  As the OnClientClick Event is processed on the client side, and the index is selected on the server side.
    For this you need to do some changes.......
    in the table tag populate this event <b>onSelect  = "<OnSelect>" </b> this event.
    Now use a flag, let it be SHOW_POPUP.
    Now in the event handling capture the selection event of the table.
    IF EVENT->EVENT_NAME = 'tableView' AND
                       EVENT->EVENT_SERVER_NAME = 'onSelect'.
      TV ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = REQUEST
                                        NAME    = 'tableView'
                                      ID      = '<tableID' ).
      IF TV IS NOT INITIAL.
        TABLE_EVENT = TV->DATA.
        ROWINDEX = TABLE_EVENT->ROW_INDEX.
        READ TABLE <Table Name> INDEX ROWINDEX into WA.
        Key = WA-<VALUE>.
        clear SHOW_POPUP.
        IF Key IS NOT INITIAL.
        SHOW_POPUP = 'X'.
        ENDIF.
      ENDIF.
    ENDIF.
    Now in the LayOut Page Write This Script In Between Form Tag in the begning only.
    <%
    if SHOW_POPUP EQ 'X'.
    %>
    <script>
    function call_help(name)
       var result = window.open(name,"helpWindow", "status=no, menubar=no width=730,height=550");
       result.moveTo(100,40);
    </script>
    <%
    endif.
    %>
    And in between <FORM> Tag Call This Function Like
        <script>
    call_help("<page Name.htm>?Key=<%= Key %>");
        </script>
    Do not use these code as u were using earlier
    onCellClick = "onCellClick"
    <htmlb:link id = "link"
    onClientClick = "return popitup('mat_move.do?key=11')">
    </htmlb:link>
    Do Remember to clear the SHOW_POPUP Flag on request of the page at each time.
    I think This will definitely help you , If you find any problem do revert back....

  • Error in receiving tableview data for selected row

    Hi Collegues ,
    We plan to realize an application for the maintanance of  planning data . In the first step we created a value help page by using a tableview with iterator class ( 1 of the 3 methods of the Interface was filled with logic ) . We don't use any controller for that application  .
    A global internal table with the relevant help value data ( fgrvalues ) is used for the tableview and the call is :
    TYPE I .
    +CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
    CLEAR ONCLICKEVENT.
    IF EVENT_ID = CL_HTMLB_MANAGER=>EVENT_ID.
        EVENT_DATA = CL_HTMLB_MANAGER=>GET_EVENT( REQUEST ).
        IF ( EVENT_DATA IS NOT INITIAL ) AND
                ( EVENT_DATA->EVENT_TYPE = 'click' ) .
                ONCLICKEVENT = EVENT_DATA->SERVER_EVENT .
        ENDIF.
    ENDIF.+
    CASE ONCLICKEVENT.
    WHEN 'take' .
       TABLE ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = REQUEST
       NAME = 'tableView'
       ID = 'fgr1_vhelp' ) .
       TABLE_EVENT = TABLE->DATA.
       IF TABLE_EVENT->SELECTEDROWINDEX IS NOT INITIAL.
          ROWSELECTION = TABLE_EVENT->SELECTEDROWINDEX.  
    -> ROWSELECTION - Content is now the index of the selected tableview row
    We always get the selected row in TABLE_EVENT->SELECTEDROWINDEX and the table TABLE_EVENT->ALLCOLUMNNAMES filled ( column ZX_FGR1 is the 2nd column ) 
    but we never got the tableview data for that tableview row no matter what we tried . We tried it with a tableview-event fired on 'rowselection' by user line-selection . We have deactivated the iterator or changed the BPS design value . With the same result - nothing was given back .
    We found that the System-Call Return value of :
    +system-call ict
    did
    ihttp_scid_get_form_field
    parameters
    m_c_msg " > c handle
    name " > form field name                value " < form field value
                    m_last_error. " < return code+
    in the method IF_HTTP_ENTITY~GET_FORM_FIELD is empty .  M_LAST_ERROR occurs with value '20' .
      + ASSIGN ROWSELECTION TO .
    COLUMN_VALUE = TABLE_EVENT->GET_CELL_VALUE( ROW_INDEX =
    COLUMN_INDEX = '2' ). -> Column Value is empty !!+
       +CALL METHOD TABLE_EVENT->GET_CELL_VALUE
          EXPORTING
            ROW_INDEX = TABLE_EVENT->SELECTEDROWINDEX
            COLUMN_INDEX = '2'
          RECEIVING
            VALUE = COLUMN_VALUE -> Column Value is empty !!+
       +CALL METHOD TABLE_EVENT->GET_SIMPLE_DATA ....
             -> Column Value is empty !!+ *----
    What could be the reason for that problem ? In generally it must be possible somehow to read the tableview data for one or all rows of the mentioned tableview .
    We hope that someone can help and are very thankful for a hint or solution . If you need more details please let us know .
    Please Remark: It's no solution for us to read the data by using the created internal table fgrvalues and the selectedrowindex cause in a later step we plan to update an ODS table with the manual modified planning data of an editable tableview .
    Thanks a lot in advance
    Dirk Läufer

    Hi collegues ,
    It's done .
    After we've got a very helpful little hint from Brian :
    The <htmlb:tableView> renders a table to the browser. It does not keep a copy of the table. The browser will also never return the table. Never. What it can return are inputfields for each cell. But then only if each cell is custom rendered as an inputfield.
    we could certainly solve the problem .
    We set the field we want to get back from table view on not editable inputfield via the tableview-iterator method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START :
    DATA: LCL_TABLE       TYPE REF TO CL_BSP_BEE_TABLE   ,
          LCL_INPUTFIELD2 TYPE REF TO CL_HTMLB_INPUTFIELD .
    CASE P_COLUMN_KEY .
    WHEN 'ZX_FGR1'.
    *    Field Firm Group
         CREATE OBJECT LCL_INPUTFIELD2.
         LCL_INPUTFIELD2->ID        = P_CELL_ID.
         LCL_INPUTFIELD2->WIDTH     = '100%'.
         LCL_INPUTFIELD2->MAXLENGTH = 4.
         LCL_INPUTFIELD2->TYPE      = 'STRING'.
         LCL_INPUTFIELD2->DESIGN    = 'STANDARD'.
         LCL_INPUTFIELD2->DISABLED  = 'TRUE'.
         LCL_INPUTFIELD2->VALUE =
             GET_COLUMN_VALUE( COLUMN_NAME = 'ZX_FGR1').
         P_REPLACEMENT_BEE     = LCL_INPUTFIELD2 .
    Now the method in OnInputPorcessing:
    TRY.
          CALL METHOD CL_HTMLB_MANAGER=>GET_SIMPLE_DATA
              EXPORTING
                REQUEST       = RUNTIME->SERVER->REQUEST
                ID            = 'fgr1_vhelp'
                ROW_IDX       = TABLE_EVENT->SELECTEDROWINDEX
                COL_NAME      = 'ZX_FGR1'
              CHANGING
                DATA          = FGRVALUES_LINE-ZX_FGR1 .
             IF NOT FGRVALUES_LINE-ZX_FGR1  IS INITIAL.
    *                 selektierte Firmengruppe übernehmen
                      ZX_FGR1     = FGRVALUES_LINE-ZX_FGR1   .
                      CALL METHOD NAVIGATION->SET_PARAMETER
                            EXPORTING NAME  = 'ZX_FGR1'
                                      VALUE = ZX_FGR1.
             ENDIF.
          CATCH CX_SY_CONVERSION_ERROR .
       ENDTRY.
    works properly as it should be ...
    An enormous Thanksgiving to you , Brian !!!!

  • Can i disabled swip to delete on some cell?

    Hello All,
    I've categorized item list on category section. and I've implement commitEditingStyle: for swipe to delete.
    my Problem is when item not in any category at that time i display "No Data" on cell. i want to disabled swipe to delete for this cell.
    When we add UITableViewDelegate Method
    - (void)tableView:(UITableView *)tv commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath;
    It's handle the automatically swipe to delete button and pass
    "editingStyle == UITableViewCellEditingStyleDelete"
    Please Guide me how to disable / enable for some cell.
    Amit Kalariya
    iPhone Developer

    Implement:
    - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
    and return UITableViewCellEditingStyleNone for the cells that you don't want to allow swipe-to-delete for.

  • How to save a row edited in the tableview

    Hi All
    I have implemented a flow logic based BSP table maintenance page as follows to display and maintain the data in SFLIGHTS table:
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page>
        <htmlb:form>
          <htmlb:tableView id              = "tv1"
                           visibleRowCount = "10"
                           selectionMode   = "lineEdit"
                           table           = "<%= flights %>"
                           filter = "SERVER"
                           sort = "server"
                           iterator        = "<%= iterator %>" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    When I click on the row and edit the row and exit the edit mode I still do not see the data that I changed is not reflected back when I exit the edit mode nor it is saved in the database table. Can you please kindly share the code how I can make only the following columns editable:
    FLDATE
    PRICE
    CURRENCY
    PLANETYPE
    the rest of the columns I want to disable for editing and whatever the changed data in these columns I want to reflect it back to the database table.
    Please kindly share the code for implementing to capture what was edited and save it back to the database table
    Thanks
    Karen

    Pls search this forum, this has been discussed N number of times.
    Raja

  • Problem on refreshing tableview's content

    Hi everyone!
    I'm developing a program using BSP and MVC based on tutorial_4_mvc.
    The program functions is basically insert, update and delete records on a transparent table using a tableview element.
    I defined tableview using the following parameters:
    <htmlb:tableView id              = "result"
                     design          = "ALTERNATING"
                     headerText      = "Header Text"
                     footerVisible   = "TRUE"
                     onRowSelection = "onRowSelection"
                     table           = "<%= t_dados_table %>"
                     visibleRowCount = "3" >
    For tableview collums, I used the following parameters:
      <htmlb:tableViewColumns>
        <htmlb:tableViewColumn columnName          = "APROGRUP"
                               width               = "100"
                               horizontalAlignment = "left"
                               title               = "Grupo de Aprovação de Programa"
                               type                = "input" >
        </htmlb:tableViewColumn>
        <htmlb:tableViewColumn columnName          = "DSCEN"
                               width               = "100"
                               horizontalAlignment = "left"
                               title               = "Descrição"
                               type                = "input" >
        </htmlb:tableViewColumn>
        <htmlb:tableViewColumn columnName          = "delete"
                               horizontalAlignment = "center"
                               title               = "Delete Item"
                               type                = "button"
                               onCellClick         = "delete" >
        </htmlb:tableViewColumn>
      </htmlb:tableViewColumns>
    The insert and update functions works just fine. So as the first time I search for a record and fill the tableview with the results. But the real problem is:
    The first time I fill the tableview, it works just fine! But when I try to search for a second code or when I have to delete a tableview's record I can't display the correct information.
    Example:
    1     1
    2     2
    3     3
    When I delete the "1   1" record on the tableview, it returns displaying:
    1    1
    2    2
    and seems like I've deleted the wrong record, but looking at the transparent table, the result is:
    2    2
    3    3
    This means that the logic for delete is correct and it's working no problem.
    BUT the tableview is displaying the wrong data.
    Anyone has been in a similar situation?

    Hi Hoffmann,
    my server cache is already set to "0". The browser cache has the same value. I tried to overwrite de value on this two fields and activate again, but the problem remains.
    There is any chance of this problem be a simple configuration mistake?
    When I change the type from "INPUT" to "TEXT" on the tableViewColumn property all the functions works just fine!
    But when I try to use the "INPUT" statement, the fields came with the old value, and the only way to update them is reloading the tableview element using an empty internal table and then reloading again with the filled internal table.
    For now, I'm using this way, but must be another way.

  • Query regarding onNavigate method in a tableview control

    hi all,
    i am using a tableview control in jspdynpage to display the sales order details using the standard BAPI that is BAPI_SALESORDER_GETLIST.
    following is the flow:-
    i enter the customer number and the sales organization in the first i-view.
    it interacts with the backend and brings the data into a tableview control in the second i-view.
    the problem i am facing is:-
    when i click on the navigation button of the tableview control instead of showing the next row of records, it takes me back to the previous i-view.
    please help as i am unable to find the error myself.
    i can post the code if you want.....
    regards,
    raghav

    i am posting the code...
    main class
    package com.sap.training;
    import javax.resource.cci.MappedRecord;
    import javax.resource.cci.RecordFactory;
    import com.sap.portal.services.api.connectorgateway.IConnectorGatewayService;
    import com.sapportals.connector.connection.IConnection;
    import com.sapportals.connector.execution.functions.IInteraction;
    import com.sapportals.connector.execution.functions.IInteractionSpec;
    import com.sapportals.connector.execution.structures.IRecordSet;
    import com.sapportals.htmlb.InputField;
    import com.sapportals.htmlb.event.Event;
    import com.sapportals.htmlb.event.TableNavigationEvent;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    import com.sapportals.portal.ivs.cg.ConnectionProperties;
    import com.sapportals.portal.ivs.cg.IConnectorService;
    import com.sapportals.portal.prt.component.IPortalComponentContext;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentResponse;
    import com.sapportals.portal.prt.runtime.PortalRuntime;
    public class getsalesorder extends PageProcessorComponent {
         //private getdatabean first_bean;
         public DynPage getPage() {
              return new getsalesorderDynPage();
         public static class getsalesorderDynPage extends JSPDynPage {
              public getdatabean data;
              private getdatabean data1;
              public IRecordSet exportTable = null;
              private final static int INITIAL_STATE = 1;
              private final static int NEXT_STATE = 2;
              private int state = INITIAL_STATE;
              //private getdatabean myBean = null;
              IPortalComponentRequest request = null;
              IPortalComponentResponse response = null;
              IPortalComponentContext ctxt = null;
              private int visibleRow;
              public void doInitialization() {
              public void doProcessAfterInput() throws PageException {
              public void doProcessBeforeOutput() throws PageException {
                   switch (state) {
                        case INITIAL_STATE :
                             this.setJspName("getdata.jsp");
                             break;
                        case NEXT_STATE :
                             this.setJspName("showresult.jsp");
                             break;
              public void onShowClick(Event event) {
                   IPortalComponentResponse response =
                        (IPortalComponentResponse) this.getResponse();
                   InputField CUSTOMER_NUMBER =
                        (InputField) getComponentByName("myInputField1");
                   String customerNumber =
                        CUSTOMER_NUMBER.getValueAsDataType().toString();
                   InputField SALES_ORGANISATION =
                        (InputField) getComponentByName("myInputField2");
                   String salesOrganisation =
                        SALES_ORGANISATION.getValueAsDataType().toString();
                   request = (IPortalComponentRequest) getRequest();
                   response = (IPortalComponentResponse) getResponse();
                   IConnectorGatewayService cgService =
                        (IConnectorGatewayService) PortalRuntime
                             .getRuntimeResources()
                             .getService(
                             IConnectorService.KEY);
                   ConnectionProperties prop =
                        new ConnectionProperties(
                             request.getLocale(),
                             request.getUser());
                   IConnection client = null;
                   try {
                        client = cgService.getConnection("R3System", prop);
                   } catch (Exception e) {
                        response.write(e.toString());
                   try {
                        IInteraction ix = client.createInteractionEx();
                        IInteractionSpec interactionSpec = ix.getInteractionSpec();
                        interactionSpec.setPropertyValue(
                             "Name",
                             "BAPI_SALESORDER_GETLIST");
                        RecordFactory rf = ix.getRecordFactory();
                        MappedRecord input = rf.createMappedRecord("input");
                        input.put("CUSTOMER_NUMBER", customerNumber);
                        input.put("SALES_ORGANIZATION", salesOrganisation);
                        MappedRecord output =
                             (MappedRecord) ix.execute(interactionSpec, input);
                        Object rs = null;
                        Object result = output.get("SALES_ORDERS");
                        if (result == null) {
                             rs = new String(" ");
                        } else if (result instanceof IRecordSet) {
                             exportTable = (IRecordSet) result;
                             exportTable.beforeFirst();
                        //                    while (exportTable.next())
                        //                                   response.write("<script language='JavaScript'>");
                        //                                   response.write( "alert('" + exportTable.getString("MATERIAL")+"');" );
                        //                                   response.write("</script>");     
                        //                    exportTable.beforeFirst();
                   } catch (Exception e) {
                        response.write(e.toString());
                   } finally {
                        if (client != null) {
                             try {
                                  client.close();
                                  client = null;
                             } catch (Exception e) {
                   ctxt =
                        ((IPortalComponentRequest) getRequest()).getComponentContext();
                   Object O = ctxt.getValue("data");
                   if (O == null || !(O instanceof getdatabean)) {
                        data = new getdatabean(request, response);
                        data.createData(exportTable);
                   } else {
                        data = (getdatabean) O;
                        data.createData(exportTable);
                   ctxt.putValue("data", data);
                   state = NEXT_STATE;
              public void onBackClick(Event event) {
                   response = (IPortalComponentResponse) getResponse();
                   state = INITIAL_STATE;
              public void onNavigate(Event event) throws PageException {
                   if (event instanceof TableNavigationEvent) {
                        TableNavigationEvent tne = (TableNavigationEvent) event;
                        if (tne != null) {
                             this.visibleRow = tne.getFirstVisibleRowAfter();
                             if (data != null) {
                                  data.setVisibleRow(
                                       new Integer(this.visibleRow).toString());
    bean class
    package com.sap.training;
    import java.io.Serializable;
    import java.util.Vector;
    import com.sapportals.connector.execution.structures.IRecordSet;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentResponse;
    public class getdatabean implements Serializable {
         private String visibleRow="1";
         public IRecordSet exportTable = null;
         public DefaultTableViewModel model;
         public IPortalComponentRequest request;
         public IPortalComponentResponse response;
         public getdatabean(){
              model = new DefaultTableViewModel();
         public getdatabean(IPortalComponentRequest request,IPortalComponentResponse response)
              this.request = request;
              this.response = response;
         public DefaultTableViewModel getModel() {
              return this.model;
         public void setModel(DefaultTableViewModel model) {
              this.model = model;
         public void createData(IRecordSet exportTable) {
              this.exportTable = exportTable;
         public DefaultTableViewModel getModel1() {
              Vector data = createData1();
              Vector colName = new Vector();
              colName.addElement("Material");
              colName.addElement("Document Date");
              model = new DefaultTableViewModel(data, colName);
              return model;
         private Vector createData1() {
              Vector retVec = new Vector();
              try {
                   while (exportTable.next()) {
                        //response.write("data is in export");
                        Vector dataVec = new Vector();
                        dataVec.addElement(exportTable.getString("MATERIAL"));
                        dataVec.addElement(exportTable.getString("DOC_DATE"));
                        retVec.addElement(dataVec);
              } catch (Exception e) {
                   response.write("EXCEPTION...........");
                   response.write(e.toString());
              return retVec;
         public void setVisibleRow(String string) {
              visibleRow = string;          
         public String getVisibleRow(){
              return visibleRow;
    1st jsp
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <jsp:useBean
         id="data1"
         scope="application"
         class="com.sap.training.getdatabean"
         />
    <hbj:content
         id="myContext">
         <hbj:page
              title="PageTitle">
              <hbj:form
                   id="myFormId">
                   <hbj:textView
                        id="CUSTOMER_NUMBER"
                        text="CUSTOMER_NUMBER"
                        design="EMPHASIZED"/>
                   <hbj:inputField
                        id="myInputField1"
                        type="String"
                        value=""
                        maxlength="30">
                   </hbj:inputField>
                   <br>
                   <br>
                   <hbj:textView
                        id="SALES_ORGANIZATION"
                        text="SALES_ORGANIZATION"
                        design="EMPHASIZED"/>
                   <hbj:inputField
                        id="myInputField2"
                        type="String"
                        value=""
                        maxlength="30">
                   </hbj:inputField>
                   <br>
                   <br>
                   <hbj:button
                        id="show"
                        text="show"
                        width="100px"
                        tooltip="click here to show result"
                        onClick="onShowClick"
                        disabled="false"
                        design="STANDARD">
                   </hbj:button>
              </hbj:form>
         </hbj:page>
    </hbj:content>
    2nd jsp
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <jsp:useBean
         id="data"
         scope="application"
         class="com.sap.training.getdatabean"
         />
    <hbj:content
         id="myContext">
         <hbj:page
              title="PageTitle">
              <hbj:form
                   id="myFormId">
                   <hbj:tableView
                        id="tv"
                        design="ALTERNATING"
                        headerVisible="true"
                        footerVisible="true"
                        fillUpEmptyRows="false"
                        navigationMode="BYLINE"
                        headerText="sales order details"
                        onNavigate="onNavigate"
                        visibleFirstRow="<%= data.getVisibleRow() %>"
                        visibleRowCount="5"
                        rowCount="20"
                        width="300 px">
                        <%
                        tv.setModel(data.getModel1());
                        %>
                   </hbj:tableView>
                   <hbj:button
                        id="back"
                        text="back"
                        width="100px"
                        tooltip="click here to go back"
                        onClick="onBackClick"
                        disabled="false"
                        design="STANDARD">
                   </hbj:button>
              </hbj:form>
         </hbj:page>
    </hbj:content>
    deployment descriptor
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
        <property name="ServicesReference" value="com.sap.portal.ivs.connectorservice"/>
      </application-config>
      <components>
        <component name="getsalesorder">
          <component-config>
            <property name="ClassName" value="com.sap.training.getsalesorder"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
      </components>
      <services/>
    </application>

Maybe you are looking for

  • How to draw a point without double buffering?

    Hello all, I am drawing points as small red circles, but they are a bit ugly without double buffering. Am I able to draw the points to be nice? I mean not to draw them as just circles, but some special circle with light border that will looks much mo

  • Trying to download a family dvd to iMovie to edit.  I have video but no audio

    I am trying to download a family dvd to iMovie to edit.  The DVD was originally done professionally but I want to attempt to fix some errors.  The format of the dvd is UDF (if that helps).  The video downloaded, but I have no audio.  Insert DVD Open

  • Can't open Mac iTunes library on Windows

    I'm wondering how I can make my iTunes library database file work with both Mac and Windows off of an external hard drive. On my Mac the drive gets a firewire connection, and on the PC it gets USB connection. Either way, when I hold shift on Windows

  • 'from' field

    Hi everyone, I was just wondering which user the system takes as 'from'-user. This is our case : We use the wf for the approval of PO's. The approval takes place trough the portal. In the portal, there's a field 'from' when you look at the taks someo

  • Controlling PPT animation timing in Captivate 4

    I imported a PPT to Captivate.  I want to control the timing of the PPT animations, but each object just comes in quickly - one after another.  Is there a way to control this and have each object come in when I want it to? Thanks, Howie