Changeable image using table view iterator

Hello Forum -
I have a tableview iterator working using cl_htmlb_image class. The icon shows up perfectly based on the column value (X=green; space=red). I would now like to click on the icon (just like clicking on checkbox) and turn the color from red->green or green->red which should of course change the value of the column as well.
Here is my code, please help me:
======================================================
IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START
======================================================
DATA: img       TYPE REF TO cl_htmlb_image.
DATA: beetable  TYPE REF TO cl_bsp_bee_table.
CREATE OBJECT img.
CREATE OBJECT beetable.
CASE p_column_key.
  WHEN 'ACTVFLAG'.
    img->id   = p_cell_id.
    IF c_row_ref->actvflag = 'N' OR
       c_row_ref->actvflag IS INITIAL.
       img->src = 'ICON_LED_RED'.
       img->alt = 'Inactive'.
    ELSE.
       img->src = 'ICON_LED_GREEN'.
       img->alt = 'Active'.
    ENDIF.
    beetable->add( element = img level = 1 ).
    p_replacement_bee = beetable.
Thanks,
Partho

in the iterator (render cell start) when rendering the image add the onclick property to image.
p_replacement_bee = cl_htmlb_image=>factory( id = p_cell_id src = icon_plane onclick = 'image_click' )
now when the user click on the image oninputprocessing will be triggered and check whether its is image click, if yes set a variable to some value to indicate that the image is clicked (and also to identify what image is clicked)
option1: store these info as a serverside cookie and read it in your IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START method to change the image
or
option2: pass these values to iterator class attribute and read it in your IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START method to change the image.
Regards
Raja

Similar Messages

  • Urgent!!!How to add a Dropdown in a Table View Iterator CLass?

    Hi All,
    I want to add a Drop Down List in the Table View Iterator Class. I am not able to do that.
    If any of you have done please reply, as it is very urgent.
    Please give the code extract possible (with data defination too)
    Regards,
    Dhaval
    Points will be given
    Mark this as Urgent

    Hi
    You need to modify RENDER_CELL_START method of your iterator class and you use the p_replacement_bee attribute to output the drop down
    The example below outputs the units of measure for a material
    data:
            col_dropdown   TYPE REF TO CL_HTMLB_DROPDOWNLISTBOX,
            col_listitem   TYPE REF TO CL_HTMLB_LISTBOXITEM,
            table_bee      TYPE REF TO cl_bsp_bee_table,
    CASE p_column_key.
        WHEN 'Column Name'.
    needs to change.  way too slow to select each time.
            prod_id = <current_line>-matnr.
            CALL FUNCTION 'Z_GET_UOM'
              EXPORTING
                PRODUCT_ID = prod_id
              IMPORTING
                UOMLIST    = uom_list.
            clear uom_line.   append uom_line to uom_list.
            CREATE OBJECT table_bee.
            CREATE OBJECT col_dropdown.
            rowidx = p_row_index.
            shift rowidx left deleting leading space.
            concatenate p_column_key rowidx into  col_dropdown->id.
            col_dropdown->width     = '100%'.
            col_dropdown->selection = <current_line>-zieme.
            table_bee->add( level = 1 element = col_dropdown    ).
            loop at uom_list into uom_line.
              CREATE OBJECT col_listitem.
              col_listitem->key    = uom_line-name.
              col_listitem->value  = uom_line-value.
              table_bee->add( level = 2 element = col_listitem    ).
            endloop.
            p_replacement_bee     = table_bee.

  • BSP COMPILER & Table view  ITERATOR

    Hi Gurus,
       Can any  body give the follwing details
    1.What is BSP Compiler?
    2.What is Table view iterator?
    Thanks in Advance,
    Regards,
    Ravi.

    Hi,
    1.the compiler builds the internal code you put in your pages.
    practical reference:
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/11099890-0201-0010-d695-ac642d35c708">pdf by Karl Kessler</a>
    2.a bsp table view iterator can be checked here:
    <a href="/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator">Weblog by Brian McKellar</a>
    <a href="/people/thomas.jung3/blog/2004/09/15/bsp-150-a-developer146s-journal-part-xi--table-view-iterators by Thomas Jung</a>
    basically it's used for customizing diplay of tables
    grtz
    Koen
    Message was edited by: Koen Labie

  • By using Table view , Disply Coloumn Total

    Hi,
    I am displaying data by using table view, now i need to display total amount for particular currency column,
    right below that column.
    pls reply on this regard, if possible send me code...
    Thanks in Advance
    S

    Hi Srinivas,
    For this you need to use iterator....
    Go through this Weblog on how to use the iterator...
    /people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
    Hope it helps you.
    Regards,
    Maheswaran.B

  • Error when using Table view

    Hi Folks,
    I m getting this problem frequently when i m using table view in reports. Im using SQl server2008 and working on BIApps.
    View Display Error
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 16001] ODBC error state: 28000 code: 18456 message: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'DWH'.. (HY000)
    SQL Issued: SELECT 0 s_0, "Financials - AP Overview"."Time"."Fiscal Quarter" s_1, "Financials - AP Overview"."Time"."Fiscal Year" s_2, "Financials - AP Overview"."Facts - AP Turnover"."Days Payables Outstanding" s_3 FROM "Financials - AP Overview" FETCH FIRST 65001 ROWS ONLY
    Thanks in advance.
    Raghava.

    Hi,
    As per you query shown above, I am assuming that the query limit exceeds the maximum number of rows to show in your result. because it showing only 65001 rows fetched but your data may be more than that.
    So try to extend the maximum rows for table view in instanceconfig.xml file.
    Regards,
    Pandian

  • Migration from Designer: wrong alias for used table/view in views

    Hello,
    I am using SQL DM version 3.3.0.744.
    when importing a view from Designer, a query is build with aliases for the used tables/views which are the same as the table/view name. When using a where clause in Designer, you refer to the alias of the table/view, like t1.col1= t2.cola. Here t1 and t2 are the aliases of the underlying tables.
    In Designer the following DDL is generated:
    CREATE OR REPLACE FORCE VIEW VIEW5
    (COL2
    ,COL1)
    AS SELECT T2.COLA COL2
    ,T1.COL1 COL1
    FROM TAB2 T2
    ,TAB1 T1
    WHERE t1.col1= t2.cola
    After importing the view in Data Modeler, the following DDL is generated:
    CREATE OR REPLACE VIEW VIEW5 ( COL2,
    COL1 )
    AS SELECT
    TAB2.COLA COL2,
    TAB1.COL1 COL1
    FROM
    TAB2 TAB2,
    TAB1 TAB1
    WHERE
    t1.col1= t2.cola ;
    So by using the wrong alias, the where clause is invalid and the query builder doesn't show the joins.
    The solution for this is to use the alias of the used table/view instead of the table/view name. Can you raise a bug for this?
    Thanks in advance,
    Joop

    Thanks for your time. I did all possible way, but still the same problem. I mean
    EXP 8... IMP 8
    EXP 8... IMP 9
    EXP 9... IMP 9
    Today I found that, NLS_LANG of two databases are different. Oracle 8i is : WE8ISO8859P1
    AND Oracle9i is : WE8MSWIN1252
    So I created a new database from scratch with Oracle 8i character set :WE8ISO8859P1 and then use imp9i to import the file. Still the same problem.
    Thanks,
    Arash

  • Check box in tabel view?when to use itereator and when to use table view

    hi,
    I want to have a check box along with the other 7fields  in the table view.
    when the checkbox is checked and the merge complete push button is clicked, the respective code for merge is to be executed.
    how can I do this?
    could anyone tell me hw to get a check boz in table view
    when to use a  iterator in BSP, how table view n iterator in comparision ae used or function/work.
    Regards,
    Pavan P.

    Hi Pavan,
    Table View is an BSP element used to display mass data in a layout similar to a table (table view).
    <b>Iterator</b>is an attribute to modify rendering row-by-row, and make it dependent on the clicked row. In this way, you define an action from a particular line. This action is defined in columnDefinitions or overWriteDefinitions.
    <htmlb:tableView id = "tvX"
                     headerText          = "Department List"
                     design              = "standard"
                     headerVisible       = "true"
                     width               = "30%"
         selectedRowKeyTable = "<%= selectedrowindextable %>"
         onRowSelection      = "MyEventRowSelection"
         sort                = "server"
         keepSelectedRow     = "TRUE"
         selectionMode       = "MULTISELECT"
         table               = "<%= i_dept %>" >
    </htmlb:tableview>
    In your <b> OnInputProcessing </b>, Use this Iterator table to get the data of selected records.
    IF selectedrowindextable[] IS NOT INITIAL.
    DESCRIBE TABLE selectedrowindextable LINES no .
    Rgds,
    Jothi.
    Pls do close the thread if ur problem is solved.

  • Cell Binding/Table View Iterator

    Hi Friends,
    I am getting error while editing the particular cell of column table view. when I enter the changes, they are not updating in the cell.I used the following code.
    method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS .
    APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
    <def>-COLUMNNAME = 'RELDATE'. <def>-EDIT = 'X'.
    method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_ROW_START .
    m_row_ref ?= p_row_data_ref.
    endmethod.
    method
    IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START .
    CASE p_column_key.
    WHEN 'RELDATE'.
    IF p_edit_mode IS NOT INITIAL.
      DATA: Rdate TYPE STRING.
      Rdate = m_row_ref->RELDATE.
      p_replacement_bee = CL_HTMLB_INPUTFIELD=>FACTORY(
                              id        = p_cell_id
                              value     = Rdate
                               type      = 'DATE'
                               VALUE = PCELL_BINDING
                                showHelp  = 'TRUE'
                                encode = 'TRUE').
    I am bit confused abt MVC.Please mail me the exact code changes to be done in MVC-Class controller.
    Regards
    CSM Reddy

    Pls check the code, & mail me back in case of any errors.
    method DO_HANDLE_EVENT .
    DATA: itabtype  type standard table of stdview1.
    DATA: tv TYPE REF TO cl_htmlb_tableview.
      tv ?= cl_htmlb_manager=>get_data(
                              request      = runtime->server->request
                              name         = 'tableView'
                              id         = 'stdview1' ).
      IF tv IS NOT INITIAL.
        DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.
        tv_data = tv->data.
        IF tv_data->prevselectedrowindex IS NOT INITIAL.
          FIELD-SYMBOLS: <row> like LINE OF ITABTYPE .
         READ TABLE ITABTYPE INDEX tv_data->prevselectedrowindex
         ASSIGNING <row>.
          DATA value TYPE string.
          value = tv_data->get_cell_id( row_index    =
                       tv_data->prevselectedrowindex
                                         column_index = '6' ).
          DATA: inputfield TYPE REF TO cl_htmlb_inputfield.
          inputfield ?= cl_htmlb_manager=>get_data(
                              request      = request
                              name         = 'DESCRIPTION'
                              id           = value ).
    <row>-DESCRIPTION = inputfield->value.
    ENDIF.
    ENDIF.
    Regards
    CSM Reddy

  • How to call dynamically TablerowCount using Table view

    Please help me urgent

    I have one abc.htm view
    ==================
    <htmlb:group>
            <htmlb:groupBody>
             <htmlb:tableView
                                                id = "tv1"
                                                columnHeaderVisible = "TRUE"
                                                design = "alternating"
                                                fillUpEmptyRows = "TRUE"
                                                footerVisible = "TRUE"
                                                headerVisible = "TRUE"
                                                table = "<%= t_maintain %>"
                                                iterator = "<%= iterator %>"
                                                visibleRowCount = "<%=model->G_NO_SIMILARSUBNO%>"
                                                width = "100%"
                                                selectionMode="singleSelect"
                                                filterButtonText = "Go"
                                                filterButtonTooltip = "Filter content"
                                                tableLayout = "AUTO"
                                              />
    In this view i want to call   visibleRowCount = "12".. User is going to give this rowcount dynamically through his page textbox.. How can i do this ?How can i paas the counting variable here..

  • Table View Iterator

    Hi SDN Firends,
    Is it possible to use two iterator in the same class?If so how?
    Using MVC ,I'm having a requirement of displaying two tables in the same page.
    I dont want to display it by calling from others pages.
    With Regards,
    SHARMILA BRINDHA.M

    Of course you can. Simply give them two different names.
    data: iterator1 type ref to zcl_my_iterator1.
    data: iterator2 type ref to zcl_my_iterator2.
    create object iterator1.
    create object iterator2.
    <htmlb:tableView id="tv1" iterator="<%= iterator1> ...
    <htmlb:tableView id="tv2" iterator="<%= iterator2> ...
    Cheers
    Graham Robbo

  • Problems with Date Type in Table View

    Hello.
    Following problem:
    I have to make a Table View with some data. One Colum is Type of Date!
    Now I used Table View Iterators to change the backgroundcolor of some cells.
    Sample:
    WHEN 4.
         DATA: col4_text TYPE REF TO CL_HTMLB_TEXTVIEW.
        CREATE OBJECT col4_text.
        col4_text->text = M_ROWREF->DATE1.
           If  mod_vari = 1.
            p_style = 'cellDesign:POSITIVE'.
         ENDIF.
    But now I have the problem that this columm´s date is not formated: 20050112 but I want it this way: 01.12.2005.
    How can I handle this problem? newbie

    This one throw me for a loop as well coming from a non SAP background but here's a nice little code sample that you will find to be quite useful all the world over
    data: lt_date type string,
          lt_tmp type string,
          lt_sep type string.
    lt_sep = '.'
    * You already have your date but for the example not
    * so this is why I use the lt_date
    lt_date = '20050112'.
    CONCATENATE
      lt_date+4(2)
      lt_date+6(2)
      lt_date+0(4)
    INTO lt_tmp SEPARATED BY lt_sep.
    * Now you can give lt_tmp to your output of your cell
    For the cell output you can double check the various weblogs on the subject "Iterator".
    You can play around with the lines after CONCATENATE to put the date in the format you want.

  • Table view width

    Hi friends
      I am displaying a 30 column table using table view and set it's width as 100%. But it's not fitted on window the horizontal scroll bar appeared .
      So I put the table view in Overflow container .but the problem here is , i must have to give width in pixels (for example 1000px )otherwise same problem, horizontal scroll bar on window.
      My requirement is want to set the overflow container width in Percentage , so that 30 column table should also fit in the window  with no horzontal scroll bar's on window, scroll bar is only in overflow container.

    I am not using iterator, i am just displaying simple data,
       If i set the column width to minimum also then same problem because all my columns are on average 20 char. so they are not fitting . here is my code
    <xhtmlb:overflowContainer id     = "OFLC_RCN_HDR"
                              width  = "980px"
                              height = "200px"
                              mode   = "SCROLL" >
    <htmlb:tableView id      = "TBL_RCN_HDR"
           columnDefinitions = "<%= model->mt_rcn_hdr_def %>"
           columnWrapping    = "true"
           design            = "ALTERNATING"
           visibleRowCount   = "<%= lv_visible_row_count %>"
           visibleFirstRow   = "<%= lV_Visible_first_row %>"
           table             = "//model/mt_rcn_hdr"
           selectionMode     = "SINGLESELECT"
           sort              = "SERVER"
           width             = "100%" />
    </xhtmlb:overflowContainer>
    Message was edited by: Shiva

  • No data for Parent-child hierarchy column in Pivot table view

    Hi all,
    I used OBIEE 11.1.1.6.2 Version.
    I drag one Parent-child hierarchy column and one measure and show result with a pivot table view.
    But when I click "+" icon to show detail level data,
    It messaged that: "*the layout of this view combined with the data,selections,drills,or prompt values chosen resulted in no data*."
    But it can show every-level data when I used table view.
    It was so strange..
    Did anybody meet this before?
    Thanks in advance.
    regards,
    Anne

    Hi,
    Yes, I have the same problem with pivot table for hierarchy dimension.
    If you use a normal table (not pivot) it seem to work. Unfortunatley with restrictions as normal table view have.
    Same problem still exist in 11.1.1.6.5
    I have logged a SR to Oracle about this.

  • Filter a table view

    Hi All,
    In a compound layer with 2 table views, is it possible to filter only one of them? (if I apply the filter in Criteria Tab or Column formulla it applies to all the views, so I need to apply the filter after retriving the results)
    Thanks,
    Regards

    Hi,
    If you are applying filter under criteria it will effect the whole report.It mean what ever views you are using will get effected.
    Can do in this way..didnt check but you can try ;)...
    Use FILTER function to make filter get effected to only one column.Now pull two same columns on which you want filter.Now apply filter on column and other column without filter.
    Use two pivot table view,you can use one column with filter in one view and the other column without filter in the other view and place the unwanted column in each view under excluded section.
    FILTER(Table.Column USING Condition) in fx
    If you are using table view i am not sure if its possible or not because we should use all the columns which are in criteria,but try making column with filter as hide in one view and column without filter as hide in other view under properties.
    Regards,
    Srikanth
    Edited by: Srikanth Mandadi on Nov 11, 2010 4:55 AM

  • Is it possible to change dynamicaly VC table view size (width/heigth)?

    Hi gurus!
    So the question is: Is it possible to change dynamicaly Visual Composer table view size?
    Particularly I'm interested in changing table-view height; the objective is not to use table-view paging option, instead to show all returned data rows at once.
    Thanks in advance!
    --- Kaspars

    Hi Kaspars,
    I would say there is atm no possibility to change the table view size dynamicly, because you can't input a formula into the size field so the size is fixed as you enter it.
    Best Regards,
    Marcel

Maybe you are looking for

  • I am trying to have some LabVIEW code called in a New thread exit when the testStand sequence terminates

    I have a Sequence that launches a sequence in a New Thread that happens to launch some LabVIEW code.  The problem is when the LabVIEW code finishes, it will not close even when the TestStand sequence terminates. Is there a way to tell this LabVIEW co

  • Fusion drive DIY not using SSD

    Hello community, Recently I have bought a SSD drive for my Mac Mini 2012, in order to make a dual hard drive installation ready to build a DIY Fusion Drive with Disk Utility. Apparently it works well, I have installed Yosemite without any problems an

  • Useing as exturnal drive

    I have had my ipod set up as manual manage since I have had it. It has only been recently that I have had a look in the drive (my computer/ipod/music) to find about 3g worth of music there that isn't viewable on the ipod. I suspect it got there when

  • [svn:fx-4.x] 15123: Fix for ASDoc bugs:

    Revision: 15123 Revision: 15123 Author:   [email protected] Date:     2010-03-29 17:46:28 -0700 (Mon, 29 Mar 2010) Log Message: Fix for ASDoc bugs: @see links are not working in the ASDoc of a style property @see links in a skinPart ASDoc are not vis

  • Problems with Downloading BI Reports to Excel  in Office 2007

    Hi, I've created reports using the BI Publisher plugin for Word 2007 and deployed these through Apex. Users that have Office 2003 installed get to download the file without any compatibility issues. Those users on Office 2007 get a warning as follows