How to Listen to click on Row of ADF table?

Hi,
How to listen to an event on Selection of Row in table?
I need to capture the data of selected row, listening to event on selection of row(on click on table row).
Thanks in Advance
Thoom

Are you looking for selectionlistener to find the current selected row?
Take a look at the below snippet for the sample:
<af:table value="#{bindings.Employees.collectionModel}" var="row"
rows="#{bindings.Employees.rangeSize}"
emptyText="#{bindings.Employees.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.Employees.rangeSize}"
rowBandingInterval="0"
selectionListener="#{EmpTableBean.onTableNodeSelection}"
rowSelection="single" id="t1">
</af:table>
The following code can be used to get the selected node - after the user selects a node:
public void onTableNodeSelection(SelectionEvent selectionEvent) {
resolveMethodExpression("#{bindings.Employees.collectionModel.makeCurrent}",
null, new Class[] { SelectionEvent.class },
new Object[] { selectionEvent });
RichTable object = (RichTable)selectionEvent.getSource();
Row row = null;
for (Object facesRowKey : object.getSelectedRowKeys()) {
object.setRowKey(facesRowKey);
Object o = object.getRowData();
JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)o;
row = rowData.getRow();
System.out.println(row.getAttribute("FirstName").toString());
public Object resolveMethodExpression(String expression, Class returnType,
Class[] argTypes,
Object[] argValues) {
FacesContext facesContext = FacesContext.getCurrentInstance();
Application app = facesContext.getApplication();
ExpressionFactory elFactory = app.getExpressionFactory();
ELContext elContext = facesContext.getELContext();
MethodExpression methodExpression =
elFactory.createMethodExpression(elContext, expression, returnType,
argTypes);
return methodExpression.invoke(elContext, argValues);
Thanks,
Navaneeth

Similar Messages

  • How can we pass the entire rows of a table to a web service in a VC model ?

    Hi,
    On the click of the submit button, I have to pass the rows of two tables into an enterprise service. This service also takes other fields of a form as an input.
    How can we pass the entire rows of a table into a service ?
    Regards,
    Nitin

    Hi Nitin,
    It seems that you have two or three different structures to pass data using your webservice. In your main question, two tables, you can join both in one table and from there call the webservice. In order to pass the entire table you need:
    1. Draw a line between your joinned table and your service,
    2. Map the fields,
    3. Create a 'SUBMIT' in your table tool bar. Right click on your table and choose 'Create Toobar', '+', name and choose 'Submit' as your event.
    4. Go to Configure Element (Table View) 'Multiple' at Selection Mode.
    Reward points if helps you to solve your question.
    Regards,
    Gilson Teixeira

  • Problems with Click a row in the Table

    Dear All,
    I am new to Java GUI. I got some problems with clicking the row in a table.
    My table allows the user to delete some rows fromt the table. When the user click a row or some rows in my table, the delete button should be enabled. It does work in most of the time. But sometimes, even the row being hight lighted, the button is still not enabled.
    Do you have any idea for what can cause this problem?
    What I did is :
    1. add a mouse listener to the table
    _userTable.addMouseListener(new java.awt.event.MouseAdapter()
    public void mouseClicked(MouseEvent e)
    userList_mouseClicked(e);
    2. then, if the row being selected is > 0, I will enable my delete button.
    Can anybody help?
    Thanks!

    Dear All,
    I am getting problems with single selection in a table. Although I have set the selection model to single, if I select a row int the table and then depress Ctrl/Shift multiple rows are selected.
    The code for set single selection is :
    ListSelectionModel seleModel = myTable.getSelectionModel();
    seleModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    Any idea about this? Is this a bug in JAVA?
    Thanks!

  • How to display more than 200 rows in the table?

    Hi Experts,
    Is that possible to display more than 200 rows in a Table.
    when i query from table, it has 1000 rows, i want to display all the 1000 rows in the Table.
    when i query, the values are displaying up to 201 rows only,
    when i click next on 200 - 201 it throws Exception says
    *"Query has exceeded 200 rows. Potentially more rows exist, please restrict your query."*
    let me know how to display all the 1000 rows in a table without Exception.
    Any idea will be highly appreciated.
    Thanks
    Aswath

    The number of rows retrieved is controlled by profile option "FND: View Object Max Fetch Size". I believe 200 is the default value. Pl see these MOS Docs
    386402.1- Query Has Exceeded 200 Rows
    275876.1 - Oracle Application Framework Profile Options Release 11i (11.5.10)
    HTH
    Srini

  • How to set a row as default row in adf table

    Hi,
    I have a requirement: when page is launched there are multiple records with different status displayed on the page and i had to make the first record with Status = XXX as default selected row in adf table. How to code it?
    Thanks!
    Susan

    Hi Frank,
    Thanks a lot for your quick response!
    We are using Jdev 11g. After received your response, i went through all of your responses in ADF coner and OTN for the related topics (setting detail row) and got some ideas(Specially, i got your detail coding for moving makeCurrent expression into selection listener method into backing bean, etc ) and was ready for coding this function. But our PM changed their mind and we dont need this function. So, I had to move to another area......
    Your articles and your responses really help me!
    Thanks again for your help!
    Susan

  • Reinitialize a task flow on click of row in a table

    Hi All
    I am using JDev 11.1.1.6 and WLS 10.3.6
    I have a requirement where i would like to re initialize the task flow each time by clicking on row of another table.
    I have a table in a page and there is other region which I need to refresh every time any row is clicked on the table.
    I am using the activation flag and active property in the task flow binding
    Any suggestions ?

    Refer to: http://andrejusb.blogspot.in/2011/08/adf-dialog-framework-and-adf-task-flow.html
    http://www.adftips.com/2010/11/adf-ui-region-interaction-interaction.html

  • How could I insert the deleted row into another table within a trigger?

    Hi,
    How could I insert the deleted row into another table within a trigger? The destination table has the same columns as the source table. Since the statements are in the trigger, it is not allowed to query the source table named 'test'. Thanks! The trigger is as follows, uncompleted:
    CREATE TRIGGER delete_trigger
    AFTER DELETE
    ON test
    FOR EACH ROW
    BEGIN
    -- How could I insert the deleted row into another table
    END delete_trigger;
    Message was edited by:
    user569548

    Hi,
    I'm not sure what's wrong there.
    I read the oracle docs about ANALYZE and ALL_TAB_COLUMNS, and did the following:
    ANALYZE TABLE my_tab VALIDATE STRUCTURE; //went ok.
    SELECT column_name
    FROM all_tab_columns
    WHERE table_name = 'my_tab'; //but no rows selected?
    This topic might not be what this thread should be about. Here I posted a new thread:
    How to get colum names of the newly created table?
    Thanks.
    Message was edited by:
    user569548

  • How to disable right click option re-size on table column header?

    Hi All,
    Please let us know how to disable right click option re-size on table column header.
    The issue is that when I right click on the column header, the column is selected and the context menu with options like Sort, Columns, Resize Columns, etc.. is popping. we want to disable column  re-size option.
    We are binding the table values programatically (not using Bc4J) and the Jdeveloper version is 11.1.2.2
    Thanks in advance,
    - Vignesh S.

    Hi Gawish,
    Thanks for the reply.
    This will make the particular column frozen and only work for that particular column.
    My use case is that to remove the resize columns option from the context menu or to disable the right click option.
    Making column selection as none will disable the right click option but we need column selection for sorting.
    Is there any other way to achieve this?
    Thanks in advance,
    -Vignesh S.

  • Fixed number of rows in ADF table

    Can we specify fixed number of rows for ADF table so even no rows displayed it will still show 10 empty rows.

    the rangesize property determines how many rows will be displayed and controls paging. If there are no rows to begin with (if I understand the question correctly) rangesize won't have any effect.

  • Add row in ADF table

    I'm trying to add a new row to ADF table. Here are my steps:
    1. Create new entities from tables (New -> EJB -> Entities from Tables)
    2. Create Session Bean (New -> EJB -> Session Bean) with all requested methods for earlier created entity
    3. Create Data Control out of it (right click on session bean -> Create Data Control) - it creates "testFindAll"
    4. After these steps, I drag&drop my "testFindAll" from data controls to form and create table
    5. Now, I drag&drop operation Create from my "testFindAll -> Operations", create button and change action from Create to CreateInsert
    And now, the troubles : ((.. When I click button to add new row I get null pointer exception. Here is part of trace:
    java.lang.NullPointerException
    at oracle.adf.model.adapter.bean.UpdatableBeanDataControl.createRowData(UpdatableBeanDataControl.java:137)
    at oracle.adf.model.bean.DCBeanDataControl.createRowData(DCBeanDataControl.java:642)
    at oracle.adf.model.bean.DCDataVO.doCreateData(DCDataVO.java:870)
    at oracle.adf.model.bean.DCDataRow.create(DCDataRow.java:306)
    at oracle.jbo.server.ViewRowImpl.callCreate(ViewRowImpl.java:432)
    at oracle.jbo.server.ViewObjectImpl.createInstance(ViewObjectImpl.java:4679)
    at oracle.adf.model.bean.DCDataVO.createInstance(DCDataVO.java:567)
    at oracle.jbo.server.QueryCollection.createRowWithEntities(QueryCollection.java:1818)
    at oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(ViewRowSetImpl.java:2211)
    at oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(ViewRowSetImpl.java:2257)
    at oracle.jbo.server.ViewRowSetImpl.createRow(ViewRowSetImpl.java:2233)
    at oracle.jbo.server.ViewObjectImpl.createRow(ViewObjectImpl.java:9404)
    at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1223)
    at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2120)
    at oracle.adf.model.bean.DCBeanDataControl.invokeOperation(DCBeanDataControl.java:464)
    at oracle.adf.model.adapter.AdapterDCService.invokeOperation(AdapterDCService.java:307)
    at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:693)
    at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:394)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:217)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    I know that I it possible to do this if you create ViewObject instead of Entities from Tables and SessionBean. But I need this approach.
    Thanks a lot!

    Hi Goran,
    What is your JDev version? Are you trying with EJB 3.0 or 2.1? I just tried (with 3.0) and it is working fine (tested in JDev 11.1.1.2.0).
    Here is my pagedef
    <action IterBinding="deptFindAllIterator" id="Create"
                RequiresUpdateModel="true" Action="createRow"/>Infact, i don't have to change the Create action to CreateInsert. By default it was CreateInsert only.
    -Arun

  • Focusing a field/column in the new row of adf table

    Hi all,
         I am using JDeveloper 11.1.2.4.0. and UI-Shell Template in Main application and sub applications are added to this master application as ADF library jar files. Application is working fine.
    I am trying to focus to make focus on a column in the newly created row in one of the sub application by referring the below link
    http://adfnbpel.wordpress.com/2013/08/14/focusing-a-fieldcolumn-in-the-new-row-of-adf-table/
    I created a single application and found that its working
    But in my application focus is not working.
    When i checked the java script by using FireBug console it is found that comp = AdfPage.PAGE.findComponent(‘”+inputId+”‘); is getting as "undefined" , where inputId = table.getClientId(facesCtx) + “:” + rowId + “:” + “it3″; I am getting the exact row id also. When i tried with by passing the table id as input id like inputId = table.getClientId(facesCtx) ; the fire bug console then showing the table id. So its sound strange.
    What may be the cause of not able to find the input text it3 by using findComponent ?
    Is any body can suggest a solution for this.
    Thanks in advance,
    Gijith

    Hi,
    read up about "findComponentByAbsoluteLocator" in http://www.oracle.com/technetwork/developer-tools/jdev/1-2011-javascript-302460.pdf
    or check ...
    AdfPage JS doc
    Frank

  • How to set a default value in an ADF table when adding a new row

    Hi Guys,
    I have a view object which I am using to create an ADF table. I also have a button which uses a CreateInsert binding to add a new row to the table. I have four fields: created_by, creation_date, last_update_by and last_update_date.
    I want these values to be set automatically when I click add new row.
    The values I want are:
    created_by - admin
    creation_date - sysdate
    last_update_by - admin
    lsat_update_date - sysdate
    Any suggestions on how to do this would be appreciated
    Thanks
    -Mark

    mark,
    Those four fields can be set completely declaratively in the Entity Object (check out the History Colum feature). Copied from the (11g) documentation:
    If you need to keep track of historical information in your entity object, such as when an entity was created or modified and by whom, or the number of times the entity has been modified, you specify an attribute with the History Column option selected (in the Edit Attribute dialog).
    If an attribute's data type is Number, String, or Date, and if it is not part of the primary key, then you can enable this property to have your entity automatically maintain the attribute's value for historical auditing. How the framework handles the attribute depends which type of history attribute you indicate:
    * Created On: This attribute is populated with the time stamp of when the row was created. The time stamp is obtained from the database.
    * Created By: The attribute is populated with the name of the user who created the row. The user name is obtained using the getUserPrincipalName() method on the Session object.
    * Modified On: This attribute is populated with the time stamp whenever the row is updated/created.
    * Modified By: This attribute is populated with the name of the user who creates or updates the row.
    * Version Number: This attribute is populated with a long value that is incremented whenever a row is created or updated.
    John

  • How to change background color of row of a table in a panel table

    hi! im trouble right now, somebody help me. i have a matrix of row and column, panel row and panel table in jsp. my problem is how can i change the background color of a row once it clicked. i have row in table which have panel table with panel column and panel row.
    i have already work for it but i only change the background color once i clicked is the first row and first column then the rest row and column is not working..pls.. give me sample code for it..thnx a lot!!!
    Thnank's,
    froilet

    Ok! I have 2 jsp, the input jsp and display.jsp! Once i input value on input.jsp, it will display on display.jsp. I have also my javascript named updateBin.js. Now, how can i update each row once i clicked it... the succeeding rows and columns..hope u help me with this..here is my code:
    Display.jsp
    <html:html locale="true">
    <head>
         <html:base/><meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Strip Map Loader</title><script type="text/javascript" src="js/updateBin.js"></script>
    </head>
         <%      
              int intRow = Integer.parseInt(request.getParameter("intRows"));
              int intColumn = Integer.parseInt(request.getParameter("intColumns"));
              int intPanelRow = Integer.parseInt(request.getParameter("intPanelRows"));
              int intPanelColumn = Integer.parseInt(request.getParameter("intPanelColumns"));
         %>
    <BODY bgcolor="#33b9ec" leftmargin="50%">
         <b>Strip ID:  </b><font color="red" face="arial"><b><bean:write name="strStripID" scope="request" /></b></font>
         <br><br>
         <font size="3" face="tahoma"><b>Bins Updater Tool:</b></font>
         <table border="1" width="365px" bgcolor="#1ea6f7" height="15">
              <tr>
                   <td valign="top" align="center">
                        <table><tr><td><font size="2">Select Bin Type:</font></td>
                        <td><select id="binType" onchange="updateBin()" size="1">
                             <OPTION></OPTION>
                             <OPTION value="green">Good Bin</OPTION>
                             <OPTION value="red">Reject Bin</OPTION>
                        </select></td></tr></table>
                   </td>
    </tr>
    </table>
    <table id="tbl" align="center" border="1" cellspacing="3" cellpadding="5" bgcolor="#CC9900">
    <tr>
    <td>                                                  
         <%for (int pnlrows=1; pnlrows<=intPanelRow; pnlrows++){%>     
              <table id="table" width="100%" border="1" bgcolor="#CC9900" cellspacing="7" cellpadding="0" align="center">
              <tr>
              <%for(int pnlcols=0; pnlcols<intPanelColumn;pnlcols++){%>               
              <td>
                        <%for (int rows=1;rows<=intRow; rows++){%>                    
                        <table cellspacing="5" width="100px" align="center" bgcolor="#CC9900">
                        <tr>
                             <td>                    
                             <%for(int cols=1; cols<intColumn; cols++){%>
                             </td>     
                             <td id="col" bgcolor="#008000" align="center" ondblclick="changeCol()"> X </td>          
                             <%}%>
                             <td id="row" bgcolor="#008000" align="center" ondblclick="changeRow()"> X </td>
                             <td></td>     
                             <%}%>                                                  
                        </tr>
                        </table>
              <%}%>
              </td>
              </tr>
              </table>     
         <%}%>
    </td>
    </tr>
    </table>
    and this is my javascript code:
         function updateBin()
              var binType=document.getElementById("binType")
              if(binType.value == "green")
              [binType.selectedIndex].value
              //binType = changeR();
              //alert('Good Bin Selected');
              if(binType.value == "red")
              [binType.selectedIndex].value
              //binType = changeC();
              //alert('Reject Bin Selected');
              if(binType.value == "")
                   alert('Please select only on the category!')
         function changeRow()
              if(binType.value=="green")
              x=document.getElementById('row').style.background="green";     
              alert('Updated!')     
              if(binType.value=="red")
              x=document.getElementById('row').style.background="red";
              //alert('Reject Bin Updated!')
         function changeCol()
              if(binType.value=="green")
                   x=document.getElementById('col').style.background="green";     
                   alert('Updated!')     
              if(binType.value=="red")
              x=document.getElementById('col').style.background="red";
              //alert('Reject Bin Updated!')
    this code only updates the first row and column..but the succeeding panel row and panel column can't update...what will i do? theres something wrong in my javascript or in my jsp...pls help me......thanx.....in advance!!

  • How to add new row to adf table progrmatically

    Hi,
    I have a bean with a list and correspoding getter & setter methods inside it.
    I created a datacontrol out of the bean and I am displaying af:table in the ui
    binded to this list.
    Ex:
    public class StudentBean {
    private List<Student> students;
    // getter & setter methods.
    jsp
    <af:table value="#{bindings.students.collectionModel}" var="row"
    rows="#{bindings.students.rangeSize}"
    emptyText="#{bindings.students.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.students.rangeSize}"
    rowBandingInterval="0"/>
    How to add a new row programitically to this adf table.
    I dragged and dropped 'Create' from operations menu on to jsp.
    But on click of that.no new row is being added to the current table.
    On click of a button in u.i I want to add a new row to the table.
    Thanks,
    Praveen

    Hi,
    The source code is as below.
    <af:table value="#{bindings.students.collectionModel}" var="row"
    rows="#{bindings.students.rangeSize}"
    emptyText="#{bindings.students.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.students.rangeSize}"
    rowBandingInterval="0"
    filterModel="#{bindings.rscGroupsQuery.queryDescriptor}"
    queryListener="#{bindings.rscGroupsQuery.processQuery}"
    filterVisible="true" varStatus="vs"
    selectedRowKeys="#{bindings.rscGroups.collectionModel.selectedRow}"
    selectionListener="#{bindings.rscGroups.collectionModel.makeCurrent}"
    rowSelection="single" id="t1"/>
    <af:commandButton actionListener="#{bindings.Create.execute}"
    text="Create" disabled="#{!bindings.Create.enabled}"
    id="cb1" partialTriggers="t1"/>
    Please let me know where am I doing wrong?
    On click of this button,it is not adding a row dynamically.
    Thanks,
    Praveen

  • How to delete a selected row from adf table

    Hi
    I am using a ADF Table to get data from the database, i need to select a specific row and then delete it how to get
    this done.
    Thanks in Advance.

    Or try this code:
    In your backing bean:
        public void deleteRows(ActionEvent actionEvent) {
            ((AppModuleImpl)getApplicationModuleForDataControl()).deleteRowEmp();
        public static Object resolveExpression(String expression)
                try
                    FacesContext facesContext = FacesContext.getCurrentInstance();
                    Application app = facesContext.getApplication();
                    ExpressionFactory elFactory = app.getExpressionFactory();
                    ELContext elContext = facesContext.getELContext();
                    ValueExpression valueExp =
                        elFactory.createValueExpression(elContext, expression, Object.class);
                    return valueExp.getValue(elContext);
                catch (Exception e)
                   ;// log you message here
                return null;
             * Get application module for an application module data control by name.
             * @param name application module data control name
             * @return ApplicationModule
            public static ApplicationModule getApplicationModuleForDataControl()
                return (ApplicationModule) resolveExpression("#{data.AppModuleDataControl.dataProvider}");
            }In your AppmoduleImpl:
        public void deleteRowEmp(){
            this.getEmpView1().removeCurrentRow();
            this.getDBTransaction().commit();
        }And another option is to expose the appmodule method as a client and bind to the jspx as a button.

Maybe you are looking for

  • Error Message when opening Apps in PSE10

    I don't have any issues opening external Apps such as IPhoto, PSE Organizer, ACDSee outside of PSE10.  All of my photo's and elements are stored on these three programs and work fine on their own. However when I open PSE10 and try to open and access

  • Unable to boot from ODD or USB after windows 8.1 update on P850-31L

    Hi I just updated a P850-31L to windows 8.1 from windows 8 through the windows store. Before the update I was able to boot from a USB drive by pressing F12 during start up. After the update I was no longer able to boot from the USB drive. Selecting t

  • Nokia n8 nokia store wont open

    hey guys. after hard resetting the N8, nokia store wont open. i also did a restore and it still wont open. also ninja fruit wont open also but angry birds opens. and not all applications are backed up. i am missing 4 applications and one of them is o

  • Show more than 10 points in iOS Maps Api?

    Does someone know how i can show more than 10 points in the iOS Maps Api? I am searching for some shop´s in the user´s location. 10 points are not enough. Has somebody an idea?

  • How to make Serial Communication in windows

    Hello, I want to do serial communication using windows platform.Sun provides javax.comm package for solaris & unix but there is no any provision for windows platform.Can I use it in Windows Platform.?