TableView: OnClientRowSelection

Hello Experts,
i have a javascript problem.
I want to pass the values of a selected tableview row via portal eventing to another iview.I have to use OnclientRowSelection.
"onClientRowselection = portalFireEvent('myEvent','dataset' unknownjavascriptmethod);""
For this i need the javascript coding to get values of the selected TableViewRow(not the index).
Can anyonehelp me in this case?
Regards
Marco

Hi Marco
   To me it doesnt seems that your problem will be solved by triggering javascript function on the event of <i><b>OnclientRowSlection</b></i>..
   As far as i Know, <b>This javascript code will be triggerd before on the client side, and without knowing the index of the selected row</b>
You will not be able to get the values of selected TableView Row...And Index will only be availabe after triggering any server event...
<b>We cannot get the selected index row by triggering just a client side script....</b>
If you can elaborate your requirement a little bit and the Function of<b> portalFireEvent</b> then probably i can provide you another way of doing this...
Regards..
Mithlesh

Similar Messages

  • Tableview onClientRowSelection - Extremely Urgent

    Could somebody please help me on this one?
    I have a tablevire with onRowSelection generating server event.
    I want to add onClientRowSelection = <func> to the tableview, where <func> will be a javascript function asking a pop-up question "Yes/No" - selecting Yes would continue and generate the server event; No will cancel the server event.
    I got the js function in place but somehow cannot call it using onClientRowSelection. Any idea?
    Thanks.
    Partho

    Raja, Thanks for your reply. Please help me with some code as I am really struggling with this one.
    In my controller I have defined the interface
    if_htmlb_tableview_iterator
    Under the method section I have defined render_row_start, render_cell_start and get_column_definition for this interface.
    I've created a variable on the controller c_iterator as TYPE REF TO if_htmlb_tableview_iterator.
    I pass the variable in my DO_REQUEST
      DATA: v_runreview TYPE REF TO if_bsp_page.
      v_runreview = create_view( view_name = 'zrun2.htm').
      CREATE OBJECT c_iterator TYPE zcl_run_review. "Name of controller class
      v_runreview->set_attribute( name = 'v_tviterator'         value = c_iterator ).
    v_tviterator is defined as an attribute on the view as
    v_tviterator TYPE REF TO if_htmlb_tableview_iterator
    and used in the tableview
           <htmlb:tableView id                    = "MyTV1"
                            keyColumn             = "REVIEWNUMBER"
                            headerText            = "<%= v_pagetitle %>"
                            headerVisible         = "FALSE"
                            design                = "ALTERNATING"
                            visibleRowCount       = "3"
                            onRowSelection        = "MyEventRowSelection"
                            selectionMode         = "<%= v_selectionmode %>"
                            selectedRowIndex      = "<%= v_rowselection %>"
                            visibleFirstRow       = "<%= v_firstvisiblerow %>"
                            emptyTableText        = "No data found"
                            footerVisible         = "TRUE"
                            keepSelectedRow       = "TRUE"
                            sort                  = "SERVER"
                            filter                = "SERVER"
                            width                 = "100%"
                            table                 = "//vmodelsetup/m_reviewhead"
                            iterator              = "<%= v_tviterator %>" />
    =======================
    Now, with all the code in place, can you explain me where and how to implement this new class CL_HTMLB_CLIENT_ITERATOR so that we could use the page_context attribute and use the js function. If I simply try and replace the attributes's TYPE REF TO definition to this class then it doesn't work.
    Your feedback will be appreciated.
    Partho

  • TableView OnClientRowSelection Question

    Hi All,
    I implemented OnClientRowSelection for my tableview, however, the problem I have now is that after the javascript executes, the actual row selection does not take place.
    So, when I click on the row selection rectangle, my javascript works well, but then the processing stops and the row remains visually unselected.
    Do you know if there is a way to get around that?
    Thanks!
    Roman D.

    Hi,
    No need to use Client Row selection/triggering a JS in your case. You have an attribute: <b>p_edit_mode</b> which will be initial if that row is not initial. Using that you can display/hide the drop down list box. Try this code:
    method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
      CASE p_column_key.
         WHEN 'MATNR'.
          IF p_edit_mode IS NOT INITIAL.
            DATA: mat_help_row type IHTTPNVP.
            mat_help_row-NAME = '1316'     .
            mat_help_row-VALUE = '1316-LEOCITRAZINE-WM'.
            append mat_help_row to mat_help.
            mat_help_row-NAME = '1276'     .
            mat_help_row-VALUE = '1276-VALDECOXIB'.
            append mat_help_row to mat_help.
            get reference of mat_help into M_MAT_REF.
            p_replacement_bee = CL_HTMLB_DROPDOWNLISTBOX=>FACTORY(
                                  id                =  p_cell_id
                                  selection         = m_row_ref->MATNR
                                  table             = me->m_mat_ref
                                  nameOfKeyColumn   = 'NAME'
                                  nameOfValueColumn = 'VALUE'  ).
      ENDIF.
    ENDCASE.
    endmethod.
    Hope this helps,
    Regards,
    Ravikiran.

  • OnClientRowSelection for tableView's

    Hi,
    I'm working on a portal application which utalises epcf eventing to allow an iView to send messages another iView. Basically a table is displayed in the left iView and, depending which row the user selects, a message containing data from the selected row is sent to the right iView.
    I initialy tried to utalise the onClientRowSelection('javascript') feature of the tableView htmlb element (with selectionMode="SINGLESELECT") which is supposed to invoke a javascrip function whose name is supplied as a parameter. However, after spending some time fudging trying to get it working, I was eventually took another route and turned one of the cells into a link.
    I was wondering whether anyone else has had any experience using onClientRowSelection and were successful in calling some javascript.

    Hi Sergio,
    > Thinking that the setOnClientRowSelection would
    > invoke the onRowSelect function in the javascript.
    The event object exists, it's not passed, see below.
    > how to pass data from the selected row
    > to <objectData>?
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <jsp:useBean id="model" scope="application" class="com.sapportals.htmlb.table.DefaultTableViewModel" />
    <%@ page import="com.sapportals.htmlb.TreeNode"%>
    <hbj:content id="contentID" >
      <hbj:page title="pageTitle">
        <hbj:form id="formID" >
          <hbj:tableView
            id="myTableView"
            selectionMode="SINGLESELECT"
            model="model"
          >
            <% myTableView.setOnClientRowSelection("showUpTableContent()"); %>
            <% myTableView.setJsObjectNeeded(true); %>
          </hbj:tableView>
        </hbj:form>
      </hbj:page>
      <script language='JavaScript'>
      function showUpTableContent(){
        alert('it was a row ' + htmlbevent.obj.getClickedRow());
      </script>
    </hbj:content>
    See https://forums.sdn.sap.com/thread.jspa?threadID=26395 for methods which exist on HTMLB TableView JS object. To retrieve a certain value, set the key column in your table.
    Hope it helps
    Detlev

  • Modify hbj:tableView with JavaScript

    Hi forum-team,
    does anyone know if it is possible to modify the contents of a hbj:tableView-Cell with JavaScript (e.g. modify the text within a cell)?
    I only found some getClickedRow methods within the JavaScript API.
    Regards,
    Frank

    Hi,
      I can't get a code for this but can guide you.
    There is onClientCellClick event for tableview which can be used for this. You will have to implement separate methods for each cell click, I hope. Also this is a classlib and not taglib. Check the documentation for more info on this.
    http://help.sap.com/saphelp_nw70/helpdata/en/fd/01f34026d70b06e10000000a155106/frameset.htm
    Also check these.
    onClientRowSelection for tableView's
    onClientCellClick in htmlb tableview
    Regards,
    Harini S

  • How to display an alert message on click of link in tableview

    Hi,
    Following is the code for a tableview in layout section of a BSP( i have specified only one tableview column here). The requirement is to display an alert message on click of link in the first column that is "evbeg". Can anyone please help me how to achieve this? Appreciate quick response on this.
    CREATE OBJECT lr_dateiterator TYPE cl_lso_bsp_it_trdates
                EXPORTING im_application = application
                im_tform = trainingform.
            <htmlb:tableView id            = "dates"
                                 table         = "<%= dates %>"
                                 iterator      = "<%= lr_dateiterator %>"
                                 width         = "100%"
                                 rowCount      = "<%= lp_len %>"
                                 footerVisible = "FALSE"
                                 sort          = "SERVER" >
                  <htmlb:tableViewColumn columnName    = "evbeg"
                                         type          = "user"
                                         title         = "<%= otr(LSO_FRONTEND/schedule) %>"
                                         tooltipHeader = "<%= otr(LSO_FRONTEND/schedule) %>"
                                         sort          = "TRUE" >
                  </htmlb:tableViewColum>
    Thanks and Regards,
    Archana.

    you have to code in the iterator for this.
    in the render_cellstart method of the iterator you need to code.
    this is for a column.
    when 'MATNR'.
    data: text type string.
    text = 'disp_alert()'.   "this java script i placed in the page
    data: lo_link type ref to cl_htmlb_link.
      create object lo_link.
         lo_link->id = p_cell_id.
         lo_link->onclientclick = text.
         lo_link->text = <fs>-matnr.
         p_replacement_bee = lo_link.
    below is the java script i added in my page..
    <  sc ri   pt type="text/javasc ript"   >
    f u n  ction disp_alert()
    a  l e  rt("helloworld");
    < /s  c ript >

  • SIGABRT error when choosing a row of a tableview

    Hello, I am creating an iPhone app and I keep getting a "SIGABRT" error. I have a tableview where I want a separate webpage pushed for each rows.
    Currently, what happens is that the table displays; however, when I pick a row it gives me a SIGABRT error. Please help.
    Here is my first view (table view) .h file:
    #import <UIKit/UIKit.h>
    @interface videoTableViewController : UITableViewController
        NSArray *videos;
    @property (strong, nonatomic) NSArray *videos;
    @end
    Here is my first view (table view) .m file:
    #import "videoTableViewController.h"
    #import "videoURLController.h"
    @interface videoTableViewController ()
    @end
    @implementation videoTableViewController
    @synthesize videos;
    - (id)initWithStyle:(UITableViewStyle)style
        self = [super initWithStyle:style];
        if (self) {
            // Custom initialization
        return self;
    - (void)viewDidLoad
        [super viewDidLoad];
        videos = [NSArray arrayWithObjects:@"Welcome", @"Hello", @"Goodbye", nil];
        // Uncomment the following line to preserve selection between presentations.
        // self.clearsSelectionOnViewWillAppear = NO;
        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    - (void)viewDidUnload
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    #pragma mark - Table view data source
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
        // Return the number of sections.
        return 1;
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
        // Return the number of rows in the section.
        return [self.videos count];
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
        static NSString *CellIdentifier = @"videoCell";
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        // Configure the cell...
        NSUInteger row = [indexPath row];
        cell.textLabel.text = [videos objectAtIndex:row];
        if (row == 0)
            cell.detailTextLabel.text = @"Welcome";
        if (row == 1)
            cell.detailTextLabel.text = @"What we value";
        if (row == 2)
            cell.detailTextLabel.text = @"What does Honor mean?";
        return cell;
    // Override to support conditional editing of the table view.
    - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
        // Return NO if you do not want the specified item to be editable.
        return YES;
    // Override to support editing the table view.
    - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
        if (editingStyle == UITableViewCellEditingStyleDelete) {
            // Delete the row from the data source
            [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
        else if (editingStyle == UITableViewCellEditingStyleInsert) {
            // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    // Override to support rearranging the table view.
    - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
    // Override to support conditional rearranging of the table view.
    - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
        // Return NO if you do not want the item to be re-orderable.
        return YES;
    #pragma mark - Table view delegate
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
         videoURLController *detailViewController = [[videoURLController alloc] initWithNibName:@"videoTableViewController" bundle:nil];
        UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
        if (indexPath.row == 0){
            [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
         // Pass the selected object to the new view controller.
         [self.navigationController pushViewController:detailViewController animated:YES];
    @end
    Here is my videoURLController (second view/web view) .h file?
    #import <UIKit/UIKit.h>
    @interface videoURLController : UIViewController
    @property (strong, nonatomic) IBOutlet UIWebView *webView;
    @end
    Here is my videoURLController (second view/web view) .m file?
    #import "videoURLController.h"
    @interface videoURLController ()
    @end
    @implementation videoURLController
    @synthesize webView;
    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
        self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
        if (self) {
            // Custom initialization
        return self;
    - (void)viewDidLoad
        [super viewDidLoad];
      // Do any additional setup after loading the view.
    - (void)viewDidUnload
        [super viewDidUnload];
        // Release any retained subviews of the main view.
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    @end

    Hello, I am creating an iPhone app and I keep getting a "SIGABRT" error. I have a tableview where I want a separate webpage pushed for each rows.
    Currently, what happens is that the table displays; however, when I pick a row it gives me a SIGABRT error. Please help.
    Here is my first view (table view) .h file:
    #import <UIKit/UIKit.h>
    @interface videoTableViewController : UITableViewController
        NSArray *videos;
    @property (strong, nonatomic) NSArray *videos;
    @end
    Here is my first view (table view) .m file:
    #import "videoTableViewController.h"
    #import "videoURLController.h"
    @interface videoTableViewController ()
    @end
    @implementation videoTableViewController
    @synthesize videos;
    - (id)initWithStyle:(UITableViewStyle)style
        self = [super initWithStyle:style];
        if (self) {
            // Custom initialization
        return self;
    - (void)viewDidLoad
        [super viewDidLoad];
        videos = [NSArray arrayWithObjects:@"Welcome", @"Hello", @"Goodbye", nil];
        // Uncomment the following line to preserve selection between presentations.
        // self.clearsSelectionOnViewWillAppear = NO;
        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    - (void)viewDidUnload
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    #pragma mark - Table view data source
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
        // Return the number of sections.
        return 1;
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
        // Return the number of rows in the section.
        return [self.videos count];
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
        static NSString *CellIdentifier = @"videoCell";
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        // Configure the cell...
        NSUInteger row = [indexPath row];
        cell.textLabel.text = [videos objectAtIndex:row];
        if (row == 0)
            cell.detailTextLabel.text = @"Welcome";
        if (row == 1)
            cell.detailTextLabel.text = @"What we value";
        if (row == 2)
            cell.detailTextLabel.text = @"What does Honor mean?";
        return cell;
    // Override to support conditional editing of the table view.
    - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
        // Return NO if you do not want the specified item to be editable.
        return YES;
    // Override to support editing the table view.
    - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
        if (editingStyle == UITableViewCellEditingStyleDelete) {
            // Delete the row from the data source
            [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
        else if (editingStyle == UITableViewCellEditingStyleInsert) {
            // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    // Override to support rearranging the table view.
    - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
    // Override to support conditional rearranging of the table view.
    - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
        // Return NO if you do not want the item to be re-orderable.
        return YES;
    #pragma mark - Table view delegate
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
         videoURLController *detailViewController = [[videoURLController alloc] initWithNibName:@"videoTableViewController" bundle:nil];
        UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
        if (indexPath.row == 0){
            [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
         // Pass the selected object to the new view controller.
         [self.navigationController pushViewController:detailViewController animated:YES];
    @end
    Here is my videoURLController (second view/web view) .h file?
    #import <UIKit/UIKit.h>
    @interface videoURLController : UIViewController
    @property (strong, nonatomic) IBOutlet UIWebView *webView;
    @end
    Here is my videoURLController (second view/web view) .m file?
    #import "videoURLController.h"
    @interface videoURLController ()
    @end
    @implementation videoURLController
    @synthesize webView;
    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
        self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
        if (self) {
            // Custom initialization
        return self;
    - (void)viewDidLoad
        [super viewDidLoad];
      // Do any additional setup after loading the view.
    - (void)viewDidUnload
        [super viewDidUnload];
        // Release any retained subviews of the main view.
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    @end

  • Tableview getting refreshed when changing data in the rows

    Hi Gurus,
    Iu2019m doing a BSP with MVC. The requirement is as below.
    In the main page there is a button u2018Create Orderu2019, to create a sales order, once I click this button, another screen (pop up) comes up and within that I have a Tableview display with the below fields with the data of 20 records.
    Material no
    Quantity
    Delivery Date
    Here user is allowed to choose the quantity and delivery date by selecting each row.(with MULTISELECT option in BSP)
    The issue is after I select first row and change the quantity and date, and if I click on second row, the Tableview gets refreshed to enable the second row to be editable and the changes what I did on the first row are also refreshed.
    So i want the Tableview not to be refreshed when selecting the multiple rows. So that I can keep the changes I make to the quantity and date fields Can you please suggest any method.
    Cheers,
    Srini.

    Hi Srinivas,
    You need to capture the value entered by user in Quantity and date field and update the internal table with these values for the current selected row.
    For ex.
    The tableView code is like:
                          <htmlb:tableView id                  = "material"
                                     headerText          = "<%= otr(Z_SUS/HEADER_TEXT_MATERIALS) %>"
                                     headerVisible       = "true"
                                     design              = "alternating"
                                     onRowSelection      = "MyEventRowSelection"
                                     selectionMode       = "MULTILINEEDIT"
                                     width               = "880"
                                     filter              = "SERVER"
                                     emptyTableText      = "<%= otr(Z_SUS/EMPTYTABLE_MATERIALS) %>"
                                     iterator            = "<%= iterator %>"
                                     table               = "<%= gt_materials %>" />
    In eventhandler OnInputProcessing :
    DATA: lt_fields type tihttpnvp ,
               ls_fields like line of lt_fields.
    call method request->get_form_fields
                changing
                  fields = lt_fields
    Now the internal table lt_fields contains all the editable cell values , just update the internal table of your tableview with these values.
    You can try these threads
    [Thread-I.|Re: Retrieve changes made in tableView]
    [Thread-II|https://forums.sdn.sap.com/click.jspa?searchID=24460585&messageID=5516977]
    Search the forum for more information on this.
    Regards,
    Anubhav

  • Issue with tableview data storing

    Hi,
    We are using MVC model, it has view-model-main controller and sub controller. I am displaying
    4 columns on the tableview where 2 columns are editable. when i click update button on the screen
    i have called do_handle_event method on sub controller, when i debug the code i am getting
    table as initial always. I am not sure what am i missing here..can any one help me ?
    Here is code
    method DO_HANDLE_EVENT
    data: o_event    type ref to cl_htmlb_event,
          visible_row type int4,
          visible_last_row type int4,
          visrow_count type int4 value 10,
          it_osha like line of it_mfgprf_osha,
          wa_osha type zpp1_mfgprf_osha,
          o_app  type ref to zcl_mfg_perf.
    o_event = cl_htmlb_manager=>get_event( request ).
        if o_event is not initial.
            if o_event->id = 'osha_update'.
                  data: tv type ref to cl_htmlb_tableview.
                  tv ?= cl_htmlb_manager=>get_data(
                              request      = runtime->server->request
                              name         = 'tableView'
                              id           = 'it_osha_history' ).
                    if tv is not initial.
                    data: tv_data type ref to cl_htmlb_event_tableview.
                    tv_data = tv->data.
                if it_mfgprf_osha is not initial.
                    visible_row = tv_data->visiblefirstrowindex.
                    visible_last_row = visrow_count + visible_row - 1.
                    loop at it_mfgprf_osha into it_osha
                          from visible_row to visible_last_row.
                    it_osha-zosha_ytd = tv_data->get_cell_value(
                                row_index    = sy-tabix column_index = 3 ).
                     endloop.
               endif.
                   endif.
                 endif.
         endif.
    view
                  <htmlb:tableView id              = "it_osha_history"
                                   table           = "<%=o_app->it_mfgprf_osha%>"
                                   iterator        = "<%=o_cont->osha_iterator%>"
                                   headerText      = "OSHA History"
                                   headerVisible   = "True"
                                   sort            = "SERVER"
                                   onHeaderClick   = "sort"
                                   visibleRowCount = "10"
                                   width           = "100%"
                                   design          = "ALTERNATING"
                                   allRowsEditable = "<%=o_app->ALLOW_RECORD_EDIT%>" />
    Thanks!
    Lakshmikandh

    Hi Guys,
    Thanks for valuable suggestion. Let me give you over view of application. We have sub-controller
    for all views, one controller and one model for those sub controllers and views.
    Hi Sebastian,
    Are you suggesting to use new model for all table view iterator ?
    If i use iterator on that one model i can't use
    that for other table view iterator..right ?
    Hi raju,
    If i get all the values on 'do_handle_data' method in the controller class, can i use that
    for other table view iterator if i create a new table view iterator?  can i have some
    outline(example coding) of passing those values to sub controller ?
    Thanks in advance.
    Lakshmikandh

  • Updation of internal table from tableview

    Hi,
    I am using a tableview in which coloumn-3(last_days) is editable.After editing it when user pressess on the button SAVE I should capture the changes and update it in database.
    But here I am facing a problem.Always the field last_days is being filled with '000' irrespective of the value entered.
    The below is the piece of code which I had written:
    DATA: tv TYPE REF TO CL_HTMLB_TABLEVIEW,
    wa like line of  R_GT_VIEW.
    tv ?= CL_HTMLB_MANAGER=>GET_DATA(
    request = runtime->server->request
    name = 'tableView'
    id = 'tvx' ).
    IF tv IS NOT INITIAL.
    DATA: tv_data TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
    tv_data = tv->data.
    loop at R_GT_VIEW into wa .
    wa-last_days =  tv_data->get_cell_value( row_index = sy-tabix
                                       column_index = '3' ).
    modify R_GT_VIEW from wa index sy-tabix.
    endloop.
    ENDIF.
    Helpful answers will be rewarded.
    Thanks

    Hi,
    Sorry....coz I replied in a haste...
    Just to let you know....The method get_cell_value will not work if you are rendering a column as InputField.
    Use the below mentioned code and this it should work....
    DATA: tv TYPE REF TO cl_htmlb_tableview.
              wa like line of R_GT_VIEW.
    tv ?= cl_htmlb_manager=>get_data(
                        request = runtime->server->request
                        name = 'tableView'
                        id = 'tvx' ).
    IF tv IS NOT INITIAL.
      DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.
      tv_data = tv->data.
      LOOP AT itab INTO wa .
        data : if_value type ref to cl_htmlb_inputfield.
        data : p_cell_id type string,       
               row_ix type string.
        clear p_cell_id.
        clear row_ix.
        row_ix = sy-tabix.
        condense row_ix.
        concatenate p_cell_id 'TV_' row_ix '_3' into p_cell_id.    "generating cell ID...Make Sure to use ur TableView Id instead of TV
        if_value ?= cl_htmlb_manager=>get_data( request = request
                                                name    = 'inputField'
                                                id      = p_cell_id
           if if_value->value is not initial.
             wa-last_days  = if_value->value.
           endif.
        MODIFY itab FROM wa INDEX sy-tabix.
      ENDLOOP.
    <i>Do reward each useful answer..!</i>
    Thanks,
    Tatvagna.

  • How to read vales from dropdownlistbox placed in tableView Cells

    Hi,
      Thanks for reply.. I got problem of reading values from Dropdownlist box placed in tableView Cells. Please correct me or give some sample to read vales from dropdownlistbox placed in tableView Cells.
    TableView column defined as
            <htmlb:tableViewColumn columnName = "OT_REASON_CODE"
                                   title      = "OT Reason"
                                   type       = "User"
                                   width = "6"
                                   edit       = "true" >
              <htmlb:dropdownListBox id                = "rcode"
                                     table             = "<%= I_YH008 %>"
                                     nameOfKeyColumn   = "OT_REASON_CODE"
                                     nameOfValueColumn = "OT_REASON_DESC" />
            </htmlb:tableViewColumn>
    OnInput processing I am trying to read dorpdown list values selected.
              W_YH022-ENDUZ = TABLE_EVENT->GET_CELL_VALUE(
              ROW_INDEX = SY-TABIX
              COLUMN_INDEX = 3 ).  " Get time
    DATA: data TYPE REF TO CL_HTMLB_DROPDOWNLISTBOX.
    DATA: value type string.
         value = TABLE_EVENT->GET_CELL_ID( row_index    = SY-TABIX
                                      column_index = '7').  " get Cell ID
    data ?= CL_HTMLB_MANAGER=>GET_DATA(
                                     request = runtime->server->request
                                     name    = 'dropdownlistbox'
                                     id      = value
    IF data IS NOT INITIAL.
    W_YH022-OT_REASON_CODE = data->selection. " +Cell Values...I am not getting cell values here+
    endif.

    Hi:
    Do like this
    Layout
          <htmlb:dropdownListBox id="mydropdownlist" >
            <htmlb:listBoxItem key   = "bpno"
                               value = "Business Partner Details" />
            <htmlb:listBoxItem key   = "bpaddress"
                               value = "Business Partner Address" />
          </htmlb:dropdownListBox>
    OnInpurProcessing event - >
    DATA: lcl_dropdown TYPE REF TO cl_htmlb_dropdownlistbox.
    data : selection2 type string.
    lcl_dropdown ?= cl_htmlb_manager=>get_data(
        request = runtime->server->request
        name    = 'dropdownListBox'
        id      = 'mydropdownlist' ).   
    IF NOT lcl_dropdown->selection IS INITIAL.
      selection2 = lcl_dropdown->selection.
    ENDIF.
    Regards
    Shshi

  • "Select All" in tableview does not trigger event?

    Hi,
    I have a MULTISELECT table, and whenever I use the "Select all" or "Deselect all" feature, I don't seem to be able to capture the resulting event... Whenever I select one line, there's always a "tableView" event being triggered, allowing me to run the following code to recover the selected entries:
    me->check_groups = table_event->GET_ROWS_SELECTED(
    includeCurrentSelectedRow = 'X' ).
    However, when I select all entries, there's not even an event being generated:
    event = CL_HTMLB_MANAGER=>get_event( request ).
    if event is not initial...
    endif.
    The above code fails; no event seem to be generated!!
    Have I missed out on something; or is this a bug...? I would assume the built-in "select all" would trigger some kind of event... or do we have to check/program this manually?
    Trond

    hi trond,
    what i know is that for catching <b>request</b> u have to use <b>runtime</b> object.
    so u may try this:
    event = CL_HTMLB_MANAGER=>get_event( <b>runtime->server-></b>request ).
    might be possible it will solve your problem.
    Regards,
    kamaljeet

  • How to get editable value from thtmlb:tableView

    Hi,
    I create a tableview using tag thtmlb:tableView and set column editable. Now the value in the tableview can be changed, but I don't know how to get the changed value from tableview. Pls help me.
    thanks in advance!

    Hi,
    You can get the collection of the context node and any line of the table is an entity in the context node.
    If it is not helpfull try to find a table called 'table' or 'tableview', maye it's an attribute in your context node.
    Best regards,
    Caíque Escaler

  • Retrieving table values from tableview multiselect

    Hi everyone,
    I have a BSP with a tableView set on multiselect. When the user clicks on a button I want to rertieve the selected rows in my ABAP code and send them to a function module (in the form of a table). But I haven't been able to find code examples on how to do this, ie how to retrieve the selected rows. Can someone provide me with an example or a link to where I can find one? I can catch the button onClick event, but after that I need to get the rows that were selected by the user.
    Thanks!
    best regards,
    Dionisios

    HI Dionisios,
    In your input processing,
    do something like
    CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
    IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
    DATA: event TYPE REF TO CL_HTMLB_EVENT.
    event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
    if  event->id = 'but1' and event->event_type = 'click'.
      DATA: tv TYPE REF TO CL_HTMLB_TABLEVIEW.
      tv ?= CL_HTMLB_MANAGER=>GET_DATA(
                      request      = runtime->server->request
                      name         = 'tableView'
                      id           = 'tab1' ).
    IF tv IS NOT INITIAL.
    DATA: tv_data TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
      tv_data = tv->data.
    refresh itab2.
    refresh itab3.
    <b>call method tv_data->GET_ROWS_SELECTED
          receiving selected_rows = itab2.</b>
    endif.
    data : ind type SELECTEDROW,
           row_s type row.
    if itab2 is not initial.
        data :rw LIKE LINE OF itab.
        loop at itab2 into ind.
          READ TABLE itab INDEX ind-index into
          rw.
           if rw is not initial.
           row_s = rw.
          append row_s to itab3.
          clear row_s.
          endif.
        endloop.
    endif.
    Endif.
    Where
    TYPES
    types : tab type table of <table_name>.
    types : row type <table_name>.
    PAGE ATTRIBUTEs :
    Irow type row
    Itab type tab.
    Itab3 type tab.
    Itab2 type selectedrows.
    Rowselected type string.
    And in layout
    <htmlb:tableView id="tab1"
                      table="<%= itab %>"
    ="true" >
                     visibleRowCount="8"
                      design="ALTERNATING"
                      footerVisible="TRUE"
                     selectionMode="multiSelect"
                     keepSelectedRow
         </htmlb:tableView>
    <htmlb:button  id = "but1"
                   onClick="test"/>
    HOpe this helps,
    Regards,
    Siddhartha

  • Getting filtered values from TableView

    Hi,
      We have a TableView whose columns can be sorted. Iwant to select a few rows and make the selected rows editable in another page.
      If it is a unsorted/unfiltered TableView, am able to do it as the ABAP Internal Table and the TableView are the same in terms of record index positions. But am facing problem after i sort/filter the TableView because now the index of the TableView are different from the index of the ABAP Internal Table present in server.
      Anybody who has dealt with this problem earlier and can guide us.
    Thanks,
    Chathia.

    Welcome to SDN.
    Search the forum before you post a question, generally in mose cases you would find a answer, if not you can post a new thread.
    here is a list of threads where your question was discussed. (as others mentioned its about using keyColumn attribute of htmlb:tableview)
    check out these threads, its got code samples as well.
    Re: HTMLB Tableview: questions..;
    Re: pic actual data from a table view
    Re: Error when using Filter and Sort together on a tableview
    Re: Change rendering of the title column...
    Have a great time in SDN.
    Regards
    Raja

Maybe you are looking for

  • How can I submit my research ideas to Apple?

    Hello Community, can you please answer my question in the title? Do I have to use a specific e-mail address or other means of communication? I am pleased to answer many. Thank You! Greetings DaniN89

  • How can I import keywords and albums from iphoto 5?

    I have new imac with iPhoto 7.1. I'd like to import the keywords and albums along with the pics from my old imac and iphoto 5. Photos import, but not tags or albums. Any suggestions?

  • REG: Recovery Disc - HP Pavilion G6-2231TX

    Dears,              I have replaced my HDD and I not able to recover the OS. I logged new ticket in HP support and i sent my bill copy to the mail id which is given by support engineer from HP. I have received a mail regarding that ticket is closed w

  • OCS 10.1.2.3 apps with OID from AS 10.1.2.0.0?

    Hi all, we run Oracle Application Server 10.1.2.0.0, and we received a request to have the OID of our system used by applications build with Oracle Collaboration Suite 10.1.2.3. In general: Is it possible to run OCS 10.1.2.3 apps against the OID of a

  • FireWire suddenly not recognising device?

    I have searched high and low for an answer to this and now I'm just plain tired, so I hope someone here can help me in a hurry. I have a Sony DCR-HC15E Camcorder which used to transfer fine in iDVD and burn DVDs for me with no problem at all. Suddenl