How to disable first row selection in a table

Hi,
I have three tables which have master child relationship. I need to enable a button for each table based on row selection of corresponding table.But first row is being selected automatically and the buttons are enabled.
what should i do in order to avoid first row selection in a table.I tried by removing selected Row Keys.But still i am getting the same problem.can anyone suggest on this.
Thank You,
Sukumar

I know a hack but I don't recommend it, anyway here it goes:
Remove selected Row Keys
Change selectionListener from the default and create a custom action listener (You can call the default one inside of it) (Tip: use makeCurrent function in this PDF
This will make sure that there is no selected row highlighted for the first time, but it actually means that the first row is selected, it's just not shown.
This method is tested with 11.1.1.7

Similar Messages

  • First row selected automatically in table

    Hi Experts,
    I have a table displayed in my view, but I found the first line of the table is always selected automatically, how can I change this?
    I don't want any line of the table be selected automatically....
    Please help me on this.
    Thanks for your time!
    Anna

    Hi,
    Check this.
    The node to which u have bind ur table, click on th node.
    go to property part(Bottom of screen)
    Initialization Lead Selection : Uncheck this check box.
    Regards,
    Arvind

  • How to make first row as selected in af:table

    Hi,
    I am using JDeveloper 11.1.1.4 and ADF-BC in my application.
    In all the pages across my application we have multi select enabled for the table[af:table].
    But when the pages are displayed,the first row is not selected by default.
    My requirement is to display first row as selected across all the tables in my app.
    I have the selectionListenerset as for example selectionListener="#{bindings.RSCMapVO2.collectionModel.makeCurrent}" in all the pages.
    Please suggest on how to make first row as selected.
    Regards,
    Praveen

    Hi
    Put these codes in your selection listner method(You have to define a selectionListner method in your backing bean and put this code segment
    (Special thanks go to Franks how posted this code segment. threadID=1089583)
    RichTable yourTable = (RichTable) selectionEvent.getSource();
    //the Collection Model is the object that provides the structured data
    //for the table to render
    CollectionModel yourTableModel = (CollectionModel) yourTable.getValue();
    //the ADF object that implements the CollectionModel is JUCtrlHierBinding. It
    //is wrapped by the CollectionModel API
    JUCtrlHierBinding yourTableBinding = (JUCtrlHierBinding) yourTableModel.getWrappedData();
    //Acess the ADF iterator binding that is used with ADF table binding
    DCIteratorBinding yourTableIteratorBinding = yourTableeBinding.getDCIteratorBinding();
    //the role of this method is to synchronize the table component selection
    //with the selection in the ADF model
    Object _selectedRowData = yourTable.getSelectedRowData();
    //cast to JUCtrlHierNodeBinding, which is the ADF object that represents
    //a row
    JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding) selectedRowData;
    //get the row key from the node binding and set it as the current row in the
    //iterator
    Key rwKey = nodeBinding.getRowKey();
    tableIteratorBinding.setCurrentRowWithKey(rwKey.toStringFormat(true));
    Thanks
    Padma

  • How to populate a table based on a row selection from another table.

    Hi, i just started to use ADF BC and Faces. Could some one help me or point me a solution on the following scenario .
    By using a search component , a table is being displayed as a search result. If i select any row in the resulted table , i need to populate an another table at the bottom of the same page from another view. These two tables are related by primary key . May i know how to populate a table based on a row selection from another table. Thanks
    ganesh

    I understand your requirement and the tutorial doesn't talk about Association between the views so that you can create a Master-Detail or in DB parlance, a Parent-Child relationship.
    I will assume that we are dealing with two entities here: Department and Employees where a particular Department has many Employees and hence a Parent-Child relationship.
    Firstly, you need to create an Association between the two Entities - Department and Employees. You can do that by right clicking on the model's entity and then associating the two entities with the appropriate key say, DepartmentId.
    Once you have done that, you need to link the two entities in the View section with this Association that you created. Then go to AppModule and make sure that in the Available View Objects: 'EmployeesView' appears under 'DepartmentView' as "EmployeesView via <link you created>". Shuttle the 'DepartmentView' to the right, Data Model and then shuttle
    "EmployeesView via <link you created>" to the right, Data Model under 'DepartmentView'.
    This will then be reflected in your Data Controls. After that, you simply would have to drag this View into your page as a Master-Detail form...and then when you run this page, any row selected in the Master table, would display the data in the Detail table.
    Also, refer to this link: [Master-Detail|http://baigsorcl.blogspot.com/2010/03/creating-master-detail-form-in-adf.html]
    Hope this helps.

  • How to Disable the Lead selection Action on aTable n How to Refreh a Page

    HI....
    1)How to Disable the Lead selection Action on aTable n How to Refreh a Page r web dynpro application.
    In my case i have a table n user enters data on multiple rows in table , n i have some input fields outside of table for those Inputs fields am settiing the data  at the screen initilization(in Init() moethod by hard code).the problem is whenever the is clicking in th 2nd row of a table the Lead Selection is triggerig and the data in the Input Fields outside the table is not displayinig.
    So by removing the lead Selection Action of a table i thought i can reslove this,
    2) How to refresha page(like we click F5 on key board),is it can be done thru code in web dynpro application
    Regards
    Rajesh

    Hi,
    You did not explained what is your functionality or coding in leadselection. Is that action on leadselection is necessary for you?.
    1)If you just want to remove the action then go to table properties and remove the action for leadselection.
    2)If you still want to continue with your leadselect action, then what you can do is.. write the code in leadselection action to again set the input fields which are out from table.  That is what you did in your init method.
    Page Refreshing
    3) What do you mean by page refreshing? is that refreshing your table only or both the table and input fields. 
         What I understood is you are allowing the user to enter values in table and soon after pressing a button the values should be saved and the data in input fields shld be deleted.  For this if you only invalidate the node then the user entered data will be lost. 
    So what you do is after getting the input data from the user add it to a ArrayList and then invalidate the node which clears the data in input field. Finally bind the Arraylist to your node.  see the following code. This is a concept make changes according to your requirement
    ArrayList list1=new ArrayList();
    wdContext.nodeAbc().bind(list1);
    IPrivateExcelviw.IAbcElement ele = wdContext.createAbcElement();
      ele.setNo(wdContext.currentAbcElement().getNo());
      ele.setName(wdContext.currentAbcElement().getName());
      ele.setMarks(wdContext.currentAbcElement().getMarks());
      list1.add(ele);
      wdContext.nodeAbc().invalidate();
    wdContext.nodeAbc().bind(list1);
    Revert me if you have any doubts
    Regards
    Raghu
    Edited by: Raghunandan Madarikuruva on Oct 16, 2008 8:07 AM

  • How to disable a default selection checkbox in the tableview

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

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

  • Table- Why first row Selected from itself

    Hi,
    i have a jspx that have some fields and a button ,
    the user should fill this fields with data then click the button
    the button pass those values to a function that call a Stored Proceudre in the DB
    then the last code in that button is to refresh a table (by execute param) that read the inserted data
    why everytime the table refreshed give me the data with the first row SELECTED!!!!!!!!
    i am using ADFBC + JSF
    thanks in advance

    Hi,
    hope you handled the case where a user hits submit - or performs some other action that is performed on the current row - because you are now in an unpredictable state. Ideally you disable all related command buttons until a user selects a row
    Frank

  • How to display first row value returened from a query as checked as default in a report

    How to display first row value returned from a query as checked as default in a report
    Example
    Parameter 1
    Paramerter2
    ABD
    x(checked)
    Test
    DEF
    JMG
    Mudassar

    Hi Mudassar,
    The issue is caused by the order in which the parameters appear in the report data tab can be difference between our report execution and it failing. In other words, “Parameter2” is execution before parameter “A” due to this issue. We can adjust the parameter’s
    order to solve the issue.
    If “Parameter2” is parameter “A”, we cannot use that expression. Because fields cannot be used in report parameter expression, if we want to display the first value returned from a query as default value, we have to fill the “Specify values” text box with
    the specific value in Default Values dialog box.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • How to dynamically display the data from a table base on row selection of another table in ADF

    Hi ,
    I have a requirement in ADF. I need to change the data of a table  based on row selection of another Table . Both the table have a Parent Child relationship between them. They have a common attribute say department_id.
                                                                                         For this I created bind variable in view object of employees table and wrote a where clause in the sql query using that bind variable. Then I created method for selection listener of department Table in java bean.
    My method is following
        public void onrowselection(SelectionEvent selectionEvent) {
            RichTable richTable = (RichTable)selectionEvent.getSource();
                            CollectionModel tableModel = (CollectionModel)richTable.getValue();
                            JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
                            Object selectedRowData = richTable.getSelectedRowData();
                            JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
                    oracle.jbo.domain.Number newVal = (oracle.jbo.domain.Number) nodeBinding.getAttribute("DepartmentId");
                    Number pallet = newVal.bigDecimalValue();
                    System.out.println("Selected values " + pallet);
            BindingContext bindingctx = BindingContext.getCurrent();
                          BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
                          DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
                  DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("EmployeesView1Iterator");//access the iterator by its ID value in the PageDef file
                          ViewObject vo =dciter.getViewObject();
                          vo.setNamedWhereClauseParam("DepartmentId", pallet);//enter your value
                          vo.executeQuery();
    It is printing the selected value of department id from department table in the log. But it is not able to pass the value to employees view. It is showing the following error in the log
    "Definition DepartmentId of type Variable is not found in EmployeesView1."
    I will be very thankful if someone helps me to solve this errror or is there any other way to achieve the same requirement.
    Thanks
    Nilesh

    Note quite sure why you simply wont create a viewlink for the viewobject the tables are based on..
    The viewlink attribute will be based on the departmentId and it's a simple master detail relationship which automatically uses ppr.
    However, if both tables are on the same page; using your hack about;
    On the underlying viewobject, define a viewcriteria e.g. "listById" and set your bind variable here.
    I would bind table two to a RichTable component:
    RichTable t2;
    public void onrowselection(SelectionEvent selectionEvent) {
            RichTable richTable = (RichTable)selectionEvent.getSource();
                            CollectionModel tableModel = (CollectionModel)richTable.getValue();
                            JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
                            Object selectedRowData = richTable.getSelectedRowData();
                            JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
                    oracle.jbo.domain.Number newVal = (oracle.jbo.domain.Number) nodeBinding.getAttribute("DepartmentId");
                    Number pallet = newVal.bigDecimalValue();
                    System.out.println("Selected values " + pallet);
                   refreshTable2(pallet);
            BindingContext bindingctx = BindingContext.getCurrent();
                          BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
                          DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
                  DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("EmployeesView1Iterator");//access the iterator by its ID value in the PageDef file
                          ViewObject vo =dciter.getViewObject();
                          vo.setNamedWhereClauseParam("DepartmentId", pallet);//enter your value
                          vo.executeQuery();
    private void refreshTable2(Number pallet){
    RichTable x=getT2();
    CollectionModel cm=(CollectionModel)x.getValue();
    JUCtrlHierBinding jcb=(JUCtrlHierBinding)cm.getWrappedData();
    BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
    DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
    DCIteratorBinding dciter = bindingsImpl.findIteratorBinding(jcb.getName()+"Iterator");
    ViewObject vo =dciter.getViewObject();
    ViewCriteriaManager vcm=vo.getViewCriteriaManager();
    ViewCriteria vc=vcm.getViewCriteria("listById");
    vo.applyViewCriteria(vc);
    vo.setNamedWhereClauseParam("DepartmentId",pallet);
    vo.executeQuery();
    AdfFacesContext.getCurrentInstance().addPartialTarget(getT2());

  • Reg Row Selection in a Table

    Hi All,
    I am facing a problem with row selection in a table. When I navigate from one screen to another in my application, the selected rows in the previous screen should be populated in the table in the next screen.
    If I have to use checkboxes inside the table for multiple row selection, how could I populate the table in the next screen with all the selected rows of the table from the previous screen.
    Also, is it possible to select multiple rows in a table without using checkboxes, and by selecting the "selection mode" of table as "multi", so that initially when the page is loaded no record (row) should be selected automatically.
    Please help me regarding this.
    Regards,
    Murthy.

    Hi,
    As Armin suggested you can use the inbuilt multiselection property of the table.
    For populating the selected values in a table in second view
    First view Context structure
    -EmpDetails (Table node) (cardinality 0..n,selection 0..n,intializeleadSelection - false)
    ---EmpID (table column)
    ---Name  (table column)
    Second View Context structure
    -DispalySelected (Table node)-EmpDetails (Table node) (cardinality 0..n,intializeleadSelection - false)
    --- ID(table column)
    --- Name(table column)
    create a navigation link form first view to second view
    In the InBoundPlug of second view
        wdContext.nodeDisplaySelected().invalidate();
        for(int i=0;i<wdContext.nodeEmpDetails().size();i++)
             if(wdContext.nodeEmpDetails().isMultiSelected(i))
                   IPrivateDisplayView.IDisplaySelectedElement ele = wdContext.nodeDisplaySelected().createDisplaySelectedElement();
                   wdContext.nodeDisplaySelected().addElement(ele);
                   ele.setID(wdContext.nodeEmpDetails().getEmpDetailsElementAt(i).getEmpID());
                   ele.setName(wdContext.nodeEmpDetails().getEmpDetailsElementAt(i).getName());
    <b>For multiselecting you have to use Ctrl tab</b>

  • How to increase the row height of the table in the smartform

    Hi,
    Can any one say,
    How to increase the row height of the table in the smartform.
    It is presently show the row width very small, i want to increase the row with of the table in the smartform.
    Plase say how can we increase the row height in the smartform.

    Hi Ravi,
         In Smartforms , Select the Table and you can adjust the cell hieghts in OUTPUT OPTIONs TAB.
        Reward points if that Helps.
    Manish

  • Read first row of the internal table

    Dear All,
    Please let me know how to read the first row of the internal table?
    I used following read statement but it is not working
    READ TABLE t_cdhdr INDEX 1.

    Hi,
    i think you are not reading an internal table
    according to your code i think you are reading a type
    which may be declared as types...
    types are declared just for reference
    eg
    types: begin of t_cdhdr .
    include strucuture  cdhdr .
    types: end of t_cdhdr .
    types: t_it_cdhdr type standard table of t_cdhdr.
    data: git_t_cdhdr  type t_it_cdhdr.
    data: gwa_t_cdhdr type t_cdhdr.
    now have to fill the iternal table
    and
    read table git_t_cdhdr into gwa_t_cdhdr index 1.
    reward points if helpful
    thanks & regards,
    venkatesh

  • Reg Row Selection in a Table UI Element

    Hi All,
    Can anyone help me in writing code to select a row from a table.
    I need to read the data from a row selected in a table and print it in the next page of my application.
    I request anyone to send me some coding line on how to select a row from a table and read data from it.
    Regards,
    Murthy.

    Hi Narayana,
    Follow the steps.
    Step1: Create a WD Component.
    Step2:  Under Component Controller create a
    i)  2  Node “EmployeeInfo” and “EmployeeRecord”  with attribute “EmployeeName” and “Position”  of cardinality 0..n for both the node and a context attribute “WindowInstance” of type “com.sap.tc.webdynpro.services.session.api.IWDWindow”
    Step3: Go to the Diagram View. Do the mapping between “EmployeeView” and “Component Controller” and between “DisplayView” and “Component Controller”
    Step4: Design 2 Views layout
    i>EmployeeView
    Layout like
    Employee Name |                                  Employee Position
    EmployeeInfo.EmployeeName| EmployeeInfo.Position
    EmployeeInfo.EmployeeName| EmployeeInfo.Position
    DisplayResultButton
    ii>DisplayView
    Layout like
    Employee Name   |                      Employee Position
    EmployeeRecord.EmployeeName |    EmployeeRecord.Position
    EmployeeRecord.EmployeeName |    EmployeeRecord.Position
    CloseWindowButton
    Step5: Create 2 Windows
    1>EmployeeWindow
    2>DisplayWindow.
    Under “EmployeeWindow” add the “EmployeeView”
    and “DisplayWindow” add the “DisplayView”
    Step5: Associate action “DisplayResult” with the “DisplayResultButton” and use this code inside the Implementation of “EmployeeView”
    public void wdDoInit()
        //@@begin wdDoInit()
    //initialize nodes
    wdContext.nodeEmployeeInfo().addElement(wdContext.createEmployeeInfoElement());
    wdContext.nodeEmployeeRecord ().addElement(wdContext.createEmployeeRecordElement());
        //@@end
    public void onActionDisplayResult(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionDisplayResult(ServerEvent)
    try
    IPrivateDisplayView.IEmployeeRecordElement empRec =
    wdContext.createEmployeeRecordElement();
    int n = wdContext.nodeEmployeeInfo().size();
    int leadSelected = wdContext.nodeEmployeeInfo().getLeadSelection();
    // loop backwards to avoid index troubles     
    for (int i = 0; i < n ; i++) {
    if (wdContext.nodeEmployeeInfo().isMultiSelected(i) || leadSelected == i) {
    empRec.setEmployeeName(wdContext.nodeEmployeeInfo().getElementAt(i).getAttributeValue("EmployeeName"));
    empRec.setPosition(wdContext.nodeEmployeeInfo().getElementAt(i).getAttributeValue("Position"));
    wdContext.nodeEmployeeRecord().addElement(empRec);
    catch(Exception e)
    e.printStackTrace();
    IWDWindowInfo windowInfo =(IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows(
         "DisplayWindow");
    //        create the Window
         IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);
         window.setWindowPosition(WDWindowPos.CENTER);
         window.setTitle("WindowTitle");
         window.setWindowSize(200,200);
    //        Save WindowInstance in Context
         wdContext.currentContextElement().setWindowInstance(window);
    //        and show the window
         window.show();
         //wdThis.wdFirePlugInDisplay();
        //@@end
    Step6: Associate action “CloseWindow” with the “CloseWindowButton
    ” and use this code inside implementation of  “DisplayView”
      public void onActionCloseWindow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionCloseWindow(ServerEvent)
       IWDWindow window = wdContext.currentContextElement().getWindowInstance();
       window.destroyInstance();
        //@@end
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5f699f90-0201-0010-14a4-8950177281ed">Developing with Tables in WebDynpro</a>
    Regards,
    Mithu

  • Keep view in row selected in the table

    Hello,
    i have a webdynpro view with a table. This table has 256 records, and visibleRowCount property is set to 10 records.
    My problem is when i selected the record number 174 for example, the scroll table returns to position 1 and i can not see the record selected.
    How can i do for the scroll table keep the row selected in the table?
    Thank you

    Hi,
    Try this.
    1. create one context ctx_va_firstvisblerow.
    2.get the leadselection record and set ctx_va_firstvisblerow context.write this code in wdDoModifyView.and also following code in wdDoModifyView.
    IWDTable table = (IWDTable) view.getElement("Ur table id");
        table.setFirstVisibleRow(wdContext.currentContextElement().getCtx_va_visiblerow());
    3.Bind the ctx_va_firstvisblerow context to the table FirstVisibleRow.
    Thanks
    Abhilasha
    Edited by: Abhilasha Dahare on Sep 14, 2010 3:35 PM

  • How to find out the selected column in Table Control

    Hi all,
          How to find out the selected column in Table Control?
    Thanks & Regards,
    YJR

    Hi,
    Let your table control name in Screen painter be TC1.
    READ TABLE TC1-COLS INTO WA_COLS (some wok area)
                 WITH KEY SELECTED = 'X'.
            IF SY-SUBRC = 0.
              CLEAR: W_DUMMY, W_COL_NAME.
              SPLIT WA_COLS-SCREEN-NAME AT '-' INTO W_DUMMY
                                                   W_COL_NAME.
            endif.
    W_COL_NAME gives you the column name.
    Hope it helps.
    cheers
    sharmistha

Maybe you are looking for