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.

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

    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

  • Problem in HTMLB..setOnClientClick()..Urgent Help....:)

    Hello All,
    I have 2 jsp files named:
    1> NewOrder.jsp -> This file uses HTMLB Taglib style. includes form and set its layout to gridlayout. It further includes/calls another jsp called "i1_NewOrder.jsp"
    2> i1_NewOrder.jsp -> This includes all the GUI elements like inputfield, textview, etc. This forms a TableView.
    Question:
    I have added a button in i1_NewOrder.jsp and have fired an event using AddLine.setOnClientClick("javascript:AddLines()");
    Now, an alert is being executed (refer to the code below), which has been written in NewOrder.jsp file.
    What I want is that when I click on this button (say "AddNewLine"), a new row should be added in the TableView that is being built up using i1_NewOrder.jsp file.
    How can I get a reference of TableView from i1_NewOrder.jsp to NewOrder.jsp??
    If you se the code, I have tried to do this, but failed
    Code:
    1> NewOrder.jsp
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <%@ page import="com.sapportals.htmlb.*" %>
    <%@ page import="com.sapportals.htmlb.enum.*" %>
    <%@ page import="com.sapportals.htmlb.table.*" %>
    /*<script language="JavaScript">
    function AddLines()
    { var rowcnt;
    alert("Hi");
    rowcnt = tvOrderDetails.getRowCount();
    document.write(rowcnt);
    rowcnt++;
    </script> */
    <jsp:useBean id="beanOrderDetails" scope="session" class="com.sap.NewOrderAssignment.BeanOrderDetails" />
    <hbj:content
    id="contextNewOrder">
    <hbj:page
    title="New Order">
    <hbj:form
    id="formNewOrder">
    <hbj:gridLayout
    id="gridNewOrder"
    debugMode="False"
    width="100%"
    cellSpacing="2">
    <%@ include file="i1_NewOrder.jsp"%>
    </hbj:gridLayout>
    </hbj:form>
    </hbj:page>
    </hbj:content>
    2> i1_NewOrder.jsp
    <%
    //****** define the cells **********//
    GridLayoutCell cellEmpty = new GridLayoutCell(" ");
    GridLayoutCell cellLabelEmpty = new GridLayoutCell(" ");
    GridLayoutCell cellGeneralOrderInfo = new GridLayoutCell(" ");
    GridLayoutCell cellDetailsOrderInfo = new GridLayoutCell(" ");
    GridLayoutCell cellLabelYourOrderNo = new GridLayoutCell(" ");
    GridLayoutCell cellLabelCustomer = new GridLayoutCell(" ");
    GridLayoutCell cellLabelOrderDate = new GridLayoutCell(" ");
    GridLayoutCell cellLabelAddress = new GridLayoutCell(" ");
    cellLabelAddress.setVAlignment(CellVAlign.TOP);
    GridLayoutCell cellLabelRequestedDelDate = new GridLayoutCell(" ");
    GridLayoutCell cellLabelCompletedelivery = new GridLayoutCell(" ");
    GridLayoutCell cellLabelGIM = new GridLayoutCell(" ");
    GridLayoutCell cellLabelDeliveryAddress = new GridLayoutCell(" ");
    GridLayoutCell cellInputYourOrderNo = new GridLayoutCell(" ");
    GridLayoutCell cellinputRequestedDelDate = new GridLayoutCell(" ");
    GridLayoutCell cellTvCustomer = new GridLayoutCell(" ");
    GridLayoutCell cellTvOrderDate = new GridLayoutCell(" ");
    GridLayoutCell cellTvAddress = new GridLayoutCell(" ");
    GridLayoutCell cellTvDeliveryAddress = new GridLayoutCell(" ");
    GridLayoutCell cellCBCompleteDelivery = new GridLayoutCell(" ");
    GridLayoutCell cellCBGIM = new GridLayoutCell(" ");
    GridLayoutCell cellTVOrderLines = new GridLayoutCell(" ");
    GridLayoutCell cellButtonAddLine = new GridLayoutCell(" ");
    //****** define design values for cells **********//
    // Design values for labels
    //****** define the visible gui elements and assign to the cell **********//
    //order details
    TableView tvOrderDetails = new TableView("tvOrderDetails");
    tvOrderDetails.setModel(beanOrderDetails.getOrderLines());
    tvOrderDetails.setSelectionMode(TableSelectionMode.MULTISELECT);
    cellTVOrderLines.setColSpan(6);
    cellTVOrderLines.setContent(tvOrderDetails);
    //General order info: header>
    TextView tvGeneralOrderInfo = new TextView("General Order Information");
    cellGeneralOrderInfo.setColSpan(6);
    cellGeneralOrderInfo.setContent(tvGeneralOrderInfo);
    //General order details>
    TextView tvDetailsOrderInfo = new TextView("Order details");
    cellDetailsOrderInfo.setColSpan(6);
    cellDetailsOrderInfo.setContent(tvDetailsOrderInfo);
    //label Your order number
    TextView labelYourOrderNo = new TextView("Your order number");
    cellLabelYourOrderNo.setWidth("150");
    cellLabelYourOrderNo.setContent(labelYourOrderNo);
    //Input Your order number
    InputField inputYourOrderNo = new InputField("InputYourOrderNo");
    cellInputYourOrderNo.setWidth("200");
    cellInputYourOrderNo.setContent(inputYourOrderNo);
    //label Customer
    TextView labelCustomer = new TextView("Customer");
    cellLabelCustomer.setWidth("150");
    cellLabelCustomer.setContent(labelCustomer);
    //Textview customer
    TextView tvCustomer = new TextView("tvCustomer");
    cellTvCustomer.setContent(tvCustomer);
    //label Order date
    TextView labelOrderDate = new TextView("Order Date");
    cellLabelOrderDate.setContent(labelOrderDate);
    //Text view order date
    TextView tvOrderDate = new TextView("tvOrderDate");
    cellTvOrderDate.setContent(tvOrderDate);
    //last check
    //Label address
    TextView labelAddres = new TextView("Address");
    cellLabelAddress.setContent(labelAddres);
    //text view address
    TextView tvAddress = new TextView("Tjaskerlaan");
    cellTvAddress.setContent(tvAddress);
    //Label Requested delivery date
    TextView labelRequestedDelDate = new TextView("Requested Delivery Date");
    cellLabelRequestedDelDate.setContent(labelRequestedDelDate);
    //Label Complete delivery
    TextView labelCompleteDelivery = new TextView("Completed Date");
    cellLabelCompletedelivery.setContent(labelCompleteDelivery);
    //Checkbox Complete delivery
    Checkbox cbCompleteDelivery = new Checkbox("cbCompleteDelivery");
    cellCBCompleteDelivery.setContent(cbCompleteDelivery);
    //Label Complete GIM
    TextView labelGIM = new TextView("GIM");
    cellLabelGIM.setContent(labelGIM);
    //Checkbox GIM
    Checkbox cbGIM = new Checkbox("cbGIM");
    cellCBGIM.setContent(cbGIM);
    //Label delivery address
    TextView labelDeliveryAddres = new TextView("Delivery Address");
    cellLabelDeliveryAddress.setContent(labelDeliveryAddres);
    //text view address
    TextView tvDeliveryAddress = new TextView("Tjaskerlaan");
    cellTvDeliveryAddress.setContent(tvDeliveryAddress);
    // listbox delivery addresses
    ListBox lbDeliveryAddress = new ListBox("lbDeliveryAddress");
    cellTvDeliveryAddress.setContent(lbDeliveryAddress);
    Button AddLine = new Button("AddLine","Add New Line");
    cellButtonAddLine.setContent(AddLine);
    //AddLine.disabled=true;
    AddLine.setOnClientClick("javascript:AddLines()");
    //****** add cells to grid **********//
    gridNewOrder.addCell(1, 1, cellGeneralOrderInfo);
    gridNewOrder.addCell(2, 1, cellLabelYourOrderNo);
    gridNewOrder.addCell(2, 2, cellInputYourOrderNo);
    //gridNewOrder.addCell(2, 3, cellEmpty);
    gridNewOrder.addCell(2, 4, cellLabelCustomer);
    gridNewOrder.addCell(2, 5, cellInputYourOrderNo);
    gridNewOrder.addCell(2, 6, cellEmpty);
    gridNewOrder.addCell(3, 1, cellLabelOrderDate);
    gridNewOrder.addCell(3, 2, cellTvOrderDate);
    //gridNewOrder.addCell(3, 3, cellEmpty);
    gridNewOrder.addCell(3, 4, cellLabelAddress);
    gridNewOrder.addCell(3, 5, cellInputYourOrderNo);
    gridNewOrder.addCell(4, 1, cellLabelRequestedDelDate);
    gridNewOrder.addCell(4, 2, cellInputYourOrderNo);
    //gridNewOrder.addCell(4, 3, cellEmpty);
    gridNewOrder.addCell(4, 4, cellLabelEmpty);
    gridNewOrder.addCell(4, 5, cellInputYourOrderNo);
    gridNewOrder.addCell(5, 1, cellLabelCompletedelivery);
    gridNewOrder.addCell(5, 2, cellCBGIM);
    //gridNewOrder.addCell(5, 3, cellEmpty);
    gridNewOrder.addCell(5, 4, cellLabelDeliveryAddress);
    gridNewOrder.addCell(5, 5, cellTvDeliveryAddress);
    gridNewOrder.addCell(6, 1, cellLabelGIM);
    gridNewOrder.addCell(6, 2, cellCBGIM);
    gridNewOrder.addCell(6, 3, cellEmpty);
    gridNewOrder.addCell(6, 4, cellLabelEmpty);
    gridNewOrder.addCell(7, 4, cellLabelEmpty);
    gridNewOrder.addCell(6, 6, cellEmpty);
    gridNewOrder.addCell(8, 1, cellEmpty);
    gridNewOrder.addCell(9, 1,cellDetailsOrderInfo);
    gridNewOrder.addCell(10, 1,cellTVOrderLines);
    gridNewOrder.addCell(11,1,cellButtonAddLine);
    %>
    Awaiting Reply.
    Please help.
    Thanks and Warm Regards,
    Ritu

    >>AddLine.setOnClientClick("javascript:AddLines()");
    I guess AddLine.setOnClientClick("AddLines()"); this wud work!
    Regards,
    P.

  • Scrollview with Tableview, Tableviewcell touch feedback question

    I am trying to make a scrollview with some tableview in it so that I can slide new tableview with drag&slide. Does anyone know if this is all possible? I tried to implement this but scrollview blocks all the event and doesn't let the table view to scroll up&down.
    My second questions is if it is possible to highlight the some portion of tableviewcell when touched? The whole cell is highlighted to blue but I would like only some part of the cell to be highlighted to blue. Would it be possible?
    Thanks.

    Never assume they will fix it immediately. You have no way of being certain that they will even be able to fix it at all without sending it off to a service centre.
    Was this post helpful? If so, please click on the white "Kudos!" star below. Thank you!

  • 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

  • Javafx 2.1: TableView CSS Removal Question

    Hi all i was hoping someone would be able to advise me on a query as regards TableView CSS.
    I have a tableView, inside of which i have a CellFactory to render my data. Inside of which i have the following condition check. That when found true i want to highlight the full row of the table.
    if (checkData(FullData, TableItem)) {
    this.getTableRow().getStyleClass().add("triggerHighLight");
    } else {
    this.getTableRow().getStyleClass().remove("triggerHighLight");
    CSS Entry
    #myTable .triggerHighLight{
    -fx-background-color: #ebc500;
    #myTable .triggerHighLight .table-cell {
    -fx-text-fill: black;
    This works fine.
    However, if i want to highlight the row and also change the color of the text, i need to add .table-cell in order to change the text color. But when i go to remove the style. The change of text color remains. Would anyone be able to advise how i can remove the fx-text-fill also? I have tried the below but this dosnt appear to work.
    this.getTableRow().getStyleClass().remove("triggerHighLight .table-cell");

    Have you tried 2.2?
    Add a style that reverts the color back to the caspian default:
    #myTable .table-cell {
        -fx-text-fill: -fx-text-inner-color;
    }By the way, this.getTableRow().getStyleClass().remove("triggerHighLight .table-cell") will not work because the styleClass property is a List<String> (technically and ObservableList<String>) so you need to remove each styleClass individually.
        this.getTableRow().getStyleClass().remove("triggerHighLight");
        this.getTableRow().getStyleClass().remove("table-cell");
        But then, you really don't want to remove the table-cell styleClass.

  • Newbie Tableview question

    I'm taking a crack at my first app.
    I have 5 items (cells) in a table.  I need the first 3 items to point to three seperate plists.  The fourth would go to a tabbar view and the last to a regular view.   I need help getting the rootcontroller to point to these different plists.  This rootcontroller tableview will look different then the plist tableviews (if that makes any sense).
    This is the format
    Item 1 -> plistA
    Item 2 -> plistB
    Item 3 -> plist C
    Item 4 -> tabbar view
    Item 5 -> viewcontroller
    Can someone provide some sample code.  You can't "dumb" this down enough for me as I'm brand new at this and need all the help I can get.
    Thanks in advance.

    Cocoa makes heavy use of the "delegate" pattern. Any time you see something like this where the first parameter is a tableView or similar, you are dealing with a delegate pattern. You can see all of the possible delegate methods if you look at the definition of the table view protocols. When you connect your controller to the table view object as a data source or delegate, these methods will get called.
    While you are in the delegate method, "self" is the controller itself. You usually can't do fancy things with the delgate method parameters because they are always passed as core Cocoa classes instead of your derived classes. You can cast them, but it is poor practice. It is better to have your own appropriately typed instance variable and make method calls on that.
    To properly call another delgate method, you would do something like this:
    CGFloat height = [self tableView: tableView heightForHeaderInSection: section];

  • Question abt using 2 tableview

    Hi, I 'm a iphone programming newbie. I m trying to implement an app with multi-level tableviews.
    The idea is if someone selects something on the first screen say then a new view opens(tableview)
    Quote:
    car make> list of models
    Honda > Acura, S2000,accord ...
    My challenge is to show the list of models in a new tableview & secondly change the size of hte list depending on the car selected.
    I have programmed so that when i select 'Honda' a new tableview opens. How do i populate data for the second table??
    Any suggestions on how to proceed?

    Hi JB -
    jBourne08 wrote:
    I have programmed so that when i select 'Honda' a new tableview opens. How do i populate data for the second table??
    If you're comfortable with core data, that would probably offer the most general solution. But if not, I think plists will work just fine for what you described. If you're new to Cocoa, the plist solution is much easier to understand and maintain, so that's the approach I'll go over here.
    I'll assume you know what a property list is, but if you don't, instructive references are plentiful (see [Quick Start for Property Lists|https://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual /PropertyLists/QuickStartPlist/QuickStartPlist.html#//apple_ref/doc/uid/10000048 i-CH4-SW5] or [iPhone tutorial: Storing and retrieving information using plists|http://humblecoder.blogspot.com/2009/05/iphone-tutorial-storing-and-retr ieving.html]). For what you've described thus far, we just need to store arrays of dictionaries. The top level file will look something like this:
    /* cars.plist */
    Root (array)
    Item 1 (dictionary)
    Make (string) Honda
    Image (string) Honda.png
    etc.
    Item 2 (dictionary)
    Make (string) Ford
    Image (string) Ford.png
    etc.
    etc.
    Of course if you don't need anything in the dictionaries except for the Make, the above can be reduced to an array of strings instead of an array of dictionaries. But an array of dictionaries is a good choice if you think you might want something besides just the one string (e.g. a logo).
    Once you know how to make the first plist, the second level plists will be easy, e.g.:
    /* honda.plist */
    Root (array)
    Item 1 (dictionary)
    Model (string) Accord
    Mileage (number) 31
    Price (number) 21055
    Image (string) Accord.png
    etc.
    Item 2 (dictionary)
    Model (string) Civic
    Mileage (number) 34
    Price (number) 15455
    Image (string) Civic.png
    etc.
    etc.
    Now we just pass the name of the selected Make to the second-level controller, which (luckily!) has an instance variable for this very purpose. e.g.:
    // RootViewController.m (first table view delegate)
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // create the second level view controller
    SecondViewController *secondViewController = [[SecondViewController alloc]
    initWithNibName:@"SecondViewController" bundle:nil];
    // get the name of the selected Make
    NSDictionary *dict = [self.dataArray objectAtIndex:indexPath.row];
    NSString *selectedMake = [dict objectForKey:@"Make"];
    // pass the selected Make to the new view controller
    secondViewController.selectedMake = selectedMake;
    // push the second view controller onto the navigation stack
    [self.navigationController pushViewController:secondViewController animated:YES];
    // reduce the second view controller's retain count to 1
    [secondViewController release];
    When the secondViewController is pushed onto the stack it's view will load, and the controller will read the data it needs:
    // SecondViewController.m
    - (void)viewDidLoad {
    // obtain the correct data file pathname from the selectedMake
    NSString *pathName = [[NSBundle mainBundle]
    pathForResource:self.selectedMake ofType:@"plist"];
    // read the data file into the data source array
    self.dataArray = [NSArray arrayWithContentsOfFile:pathName];
    // display the data in the tableView
    [tableView reloadData];
    Note viewDidLoad in the root controller will look just like the above except the plist file name will be hardcoded (@"cars").
    Disclaimer: These example methods aren't tested and may have syntax errors or throw runtime exceptions. They're only intended to illustrate the basic idea. If you want to use this solution, but can't make the examples work, I'll be happy to clean them up for you.
    Hope that helps!
    - Ray

  • Question about HTMLB:tableView with nested tag

    Dear experts.
    1. I have one question that can I code like below.
    2. And what is the mean of "$something$". when I run the page I met the error $TVCID$ is no more supported from design2003.
    <htmlb:tableViewColumn  columnName    = "myicon"
                            type          = "user"
                            title         = "Image"
                            horizontalAlignment="center" >
         <htmlb:link         id            = "$TVCID$"
                             onClick       = "$CARRNAME$"
                             tooltip       = "$CARRNAME$">
          <htmlb:image        src           = "$TVCVALUE$"
                              alt           = "$TVCVALUE$"
                              tooltip       = "$CARRNAME$" />
         </htmlb:link>
    </htmlb:tableViewColumn>

    Hi.
    You have more options to solve the problem.
    First you can set your design to 2002.
    <htmlb:content design = "DESIGN2002" >
    or
    you can use an iterator
    or
    you can use the following code
    <htmlb:tableViewColumn columnName = "TVCVALUE"
                           type       = "LINK"
                           linkClickTarget = "ONCLICK" (<- InputProcessing)
                           title      = "Image"
                           horizontalAlignment = "center"
                           tooltip    = "CARRNAME" >
    </htmlb:tableViewColumn>
    Hope this helps
    Greetings
    Claudia

  • TableView Question

    I have a form with few fields and a table view.  I want like an inline editing function, where the user would enter the fields, and click on a button.  These data should be added to the tableview on the top, clear the fields for additional data entry.  I created the application, and When I run the application, only the last entry shows up in the tableview.   This is a BSP with simple page logic (NO MVC).  The internal table is flagged auto in the page attribute.  When I look at the internal table in onInputProcessing, I dont see any data from the internal table.
    Any thoughts?
    Albert

    Hi ,
    I hope the internal tables values are getting refreshed after server event . This is common in a stateless application.
    For this you should ensure that your data entry to the internal table should be in a general area where it can be populated on any server events.
    For adding entries , place a button and in that particular event and add this code
    "APPEND INITIAL LINE TO THE TABLE"
    After adding the values , modify the internal table with the values.
    Regards,
    Meikandan.

  • Tableview question in BSP programming

    Hi All,
    I am new to the HTMLB programming.
    I am trying to use a Tableview in a BSP page.
    This table contains multiple-page data.
    When I navigate to a certain page in this view(for example page 3)and select a row, it triggers an event and branches to another view, which is fine.
    However when I navigate back to this tableview, the tableview does not keep the selected page and row, it always goes to the first page and shows the first row.
    How can I keep the selected page and row in the tableview?
    Any attribute in the tableview I need to set up in order to do this?
    Thanks a lot,
    Bin

    supply the tableview attributes 'SelectedRowKey' or 'SelectedRowIndex' with a class attribute where you collect all selection.
    Cheers.
    Marc

  • 2 questions about  TableView

    1-With table.getSelectionModel().selectedItemProperty() returns the actual selected item.
    Well, I want to get the last selected item too, a method like lastSelectedItemProperty() ?
    2-Is there a way to create a calculate column, that is not a property of the actual bean class passed to this TableView in an ObservableList ? I mean a property of another bean or a value that is calculated by a bind with the properties of the actual bean and others.

    Q1
    liveTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<LiveTableItem >()
         @Override
         public void changed(ObservableValue<? extends LiveTableItem> observable, LiveTableItem oldValue, LiveTableItem newValue)
              //you get current and previous selected object. either of them could also be null so check for that.
         });

  • HTMLB Tableview: questions..;

    Hello,
    Simply I output my table as follows :
    <htmlb:form>
      <htmlb:tableView id              = "tv1"
                       visibleRowCount = "10"
                       selectionMode   = "lineEdit"
                       table           = "<%=mytable%>"
                       iterator        = "<%=iterator%>" />
    </htmlb:form>
    (NOTE: where iterator is type IF_HTMLB_TABLEVIEW_ITERATOR)
    Ok, its nice, but I need to customize things a bit.  I have 5 fields... and I want 4 uneditable, and the 5th able to be updated and modified back into the SAP table.
    How can I do this?
    Thanks,
    Timothy

    Hello,
    I have read many times the iterator weblogs, especially 830.  I understand most but still have trouble.  Allow me to show you what I have, and please tell me what is wrong.
    My BSP, index.htm:
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title="EPCOT" >
        <%
      SELECT * FROM ZEPCT002 INTO TABLE epcots
               WHERE ZANNE = anne
               AND   ZPAYS = pays.
        %>
        <htmlb:form>
          <htmlb:tableView id              = "tv1"
                           visibleRowCount = "12"
                           selectionMode   = "lineEdit"
                           table           = "<%= epcots %>"
                           iterator        = "<%= iterator %>" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    For my iterator, I have made the 5th field an input field (CL_HTMLB_INPUTFIELD).  And the 6th field an ICON:
    image2->onclick = 'OnSaveClick'.
            image2->src = cl_bsp_mimes=>sap_icon( `ICON_SYSTEM_SAVE` ).
    I want, when user selects a line, enters text in this 5th field, and then clicks the icon... an event to write/modify directly this change into my table (SAP table I created).  So, for index.htm, in OnInputProcessing, I have:
    DATA: event TYPE REF TO CL_HTMLB_EVENT,
          id type string,
          row type string,
          col type string,
          other type string.
    CLASS cl_htmlb_manager DEFINITION LOAD.
    clear: event, id, row, col, other.
    event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
    id = event->id.
    split id at '_' into other row col.
    case col.
    WHEN '6'.
    <b>?????</b>
    endcase.
    My <b>?????</b> is where I have tried many things and just dont get it.  In weblog 830, I see what he is doing, but some things he does don't work for me, like:
    id = htmlb_event->id.
        case htmlb_event->server_event.
          when 'OnUpdateUserClick'.
            data: event1 type ref to cl_htmlb_event_selection.
            event1 ?= htmlb_event.
            read table model->ug_users index i_row assigning <irow>.
    this <b>htmlb_event->id</b>, <b>htmlb_event</b>, and <b>model->ug_users</b>... for these I get syntax errors.
    So, could you tell me what I need to do here?
    Any guidance would be greatly appreciated,
    Thanks,
    Tim

  • 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