Af:selectBooleanCheckbox inside rows of a af:table

Hello again:
I want to do something i was thinking that should be simple, but...
I have a af:table where in one column i have a af:selectBooleanCheckbox that is related to some data on table's row. Since i give up on building the table using a BC component (Re: ADF BC creating table from view i just put up a ArrayList based on that database table and build my af:table around it.
Now i want to change some values on each row when it's selected/deselected, so i put in a valueChangeListener.
However, in my back-end method, how can i know what's the row where the selectBooleanCheckbox that triggered the event is?
I have access to the component itself - selectBooleanCheckbox - to it's parent - CoreColumn - and to it's parent parent - CoreTable - but how can i do a table.getRowData() withou knowing what was the row where the selectBooleanCheckbox was?
Thanks again.

Thanks for your answer, however it didn't helped at all. The problem now is that i can't update the column table under the BC that is "bounded" to the selectBooleanCheckbox. I havd that column as BIT (SQLServer) but then changed to INT, where i store values of 1/0.
I tryed the aproach of the link you gave (mapping int to boolean), but the pages simply "hangs" when trying to update it.
UIXTable table = (UIXTable) action.getComponent().getParent().getParent();
Boolean value = !(Boolean)((CoreSelectBooleanCheckbox)action.getComponent()).getValue();
Integer id = (Integer)((Object[])table.getRowData())[0];
Object[] ki = {id};
Key k = new Key(ki);
QwebdevicelistViewRow row = (QwebdevicelistViewRow)devices.getRow(k);
row.setActive(value?1:0);
qwebAM.getTransaction().commit();
the code seems to hang in the setActive method.
Any more hints?
Thanks a lot.

Similar Messages

  • Programmatically refresh components inside a specific row of an af:table

    How to programmatically refresh components inside a specific row of an af:table without refreshing the whole table ?_
    I have an af:table displaying a read-only view object. There is an edit button inside the table calling an af:popup, where the user can update some informations and click a submit button to validate his changes.
    The action property of this button is a method in a backing been where
    -     1 : A stored procedure is called to update several tables (related to my read-only VO).
    -     2 : The VO is re-queried (VO. refreshQueryKeepingCurrentRow() )
    -     3 : The whole table is refreshed (AdfFacesContext.getCurrentInstance().addPartialTarget(myTable) )
    Is it possible to programmatically refresh some components of the current row of the table without refreshing the whole table (point 3)?
    I’ve tried to play with the “partialTrigger” property of af:outputText (table:column:outputText), without success.
    Thanks
    Nicolas

    "+do you happen to want to refresh following an action on the row? Like a link/button click?+" : NO
    There is a table on my page. The user select a row and click on an edit button. This edit button call a popup where the user can modify some information (not directly on the viewObject. All fields in the popup are dummy fields bind to attributes in my backing bean) and then he click on a submit button.
    The submit button action execute a method "submitInformation" in a backing been.
    public String submitInformation(){
            Map<String, Object> params = new HashMap<String, Object>();
            params.put("pManNo", xManNo.getValue()); //xManNo is an attribute of the backing bean
            params.put("pDate", xPeriod.getValue()); //xPeriod is an attribute of the backing bean
            // Execute Operation
            OperationBinding oper = ADFUtils.findOperation("serviceSubmitInfo");
            oper.getParamsMap().putAll(params);
            String results = (String)oper.execute();
            // Close Popup & Refresh Row if OK
            if(!StringUtils.isStringEmpty(results) && results.equals("TRUE")){
                 closePopup("pt1:popAbs");
                 refreshMyCol();
    }The serviceSubmitInfo method is defined in my serviceImpl
        public String serviceSubmitInfo (String pManNo, String pPeriod, ......){
             String results =
                callStoredFunction("? :=myDatabaseFunction(?, ?, ?, ?)",
                                   new Object[] { pManNo, pPeriod, ...... });
              // Commit
              getDBTransaction().commit();
              // Refresh VO (re-query & set currentRow)
              getMyVO().refreshQueryKeepingCurrentRow();         
              return results; // TRUE if ok
        }I want the " refreshMyCol()" method to refresh only the current row and not the whole table...
    Regards
    Nicolas

  • How to compare each row in an internal table

    Hi,
    Say I have an internal table with 3 fields in each row, num1, num2, num3, each type of integer i, now I want to get the maximum of num1, num2, num3 and put this maximum number into num4, may I know how can I do that? Also, if say I need to pull out this num4 and play around with it, sould I just loop it into my workarea of internal table and assign a variable for whatever that is in the work area? Thanks a lot!
    Regards,
    Anyi

    Hi,
    Inside a loop of the table compare each field like this:
    loop at itab.
    l_num4 = itab-num1.
    if l_num4 < itab-num2. l_num4 = itab-num2. endif.
    if l_num4 < itab-num3. l_num4 = itab-num3. endif.
    Here you can play with the maximum number
    itab-num4 = l_num4.
    modify itab.
    endloop.
    You can also do the same using field-symbols (it's faster to assignations) :
    loop at itab assigning <a>.
    endloop.
    Regards.

  • How to get the selected rows & columns in the table?

    hi everybody,
                         In my application the table is kept inside the event structure.I select the cells  in the table (using mouse) on running time.How to get the selected number of rows & columns in that table?

    Hello,
    You can fill selected values of the table by writing to it or the corresponding property using a property node - the table is just a 2D array of strings.  I think for your "disable" question you are referring to the shortcut menu (when you right click).  If you are using LabVIEW 8.x, you can edit or disable that shortcut menu - just right click on your table at edit time and choose Advanced >> Run-Time Shortcut Menu.
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • Inserting rows in PL/SQl table

    Hi,
    I have a PL/SQl table which i populated through bulk collect and now i am trying to loop through the table (actually quite a few nested loops) ... Now inside one of my loops i might need to insert a new row by splitting field in the existing row in the table. Can I insert the row in the pl/sql table within the loop without affecting the 'FOR i IN tab.first..tab.last' loop ??
    Also what would be the index of such a row inserted in the table. Can I access it with tab.last+1 (doesnt look like it can be done if i insert in the various levels of loops).
    OR
    If I insert the rows insde the nested loops , then I can access the new rows once I close all the loops and open a fresh loop ??. Will the new rows be at the last of the table.
    Any help will be appreciated ...

    user2309906 wrote:
    Hi,
    I have a PL/SQl table which i populated through bulk collect and now i am trying to loop through the table (actually quite a few nested loops) ... Now inside one of my loops i might need to insert a new row by splitting field in the existing row in the table. Can I insert the row in the pl/sql table within the loop without affecting the 'FOR i IN tab.first..tab.last' loop ??
    Also what would be the index of such a row inserted in the table. Can I access it with tab.last+1 (doesnt look like it can be done if i insert in the various levels of loops).
    OR
    If I insert the rows insde the nested loops , then I can access the new rows once I close all the loops and open a fresh loop ??. Will the new rows be at the last of the table.
    Any help will be appreciated ...With an associative array:
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    type t_arr is table of varchar2(10) index by pls_integer;
      3    v_arr t_arr;
      4    v_cnt number := 0;
      5  begin
      6    -- populate the associative array
      7    for i in (select ename from emp)
      8    loop
      9      v_cnt := v_cnt + 1;
    10      dbms_output.put_line('Populating: '||i.ename);
    11      v_arr(v_cnt) := i.ename;
    12    end loop;
    13    -- now process the associative array
    14    for i in v_arr.first .. v_arr.last
    15    loop
    16      dbms_output.put_line('Processing: '||i||':'||v_arr(i));
    17      if v_arr(i) IN ('KING','TURNER','JAMES') then
    18        v_arr(v_arr.last+1) := v_arr(i)||to_char(i);
    19        dbms_output.put_line('Added: '||v_arr.last||':'||v_arr(i));
    20      end if;
    21    end loop;
    22    -- now what's in the associative array?
    23    for i in v_arr.first .. v_arr.last
    24    loop
    25      dbms_output.put_line('Result: '||i||':'||v_arr(i));
    26    end loop;
    27* end;
    SQL> /
    Populating: SMITH
    Populating: ALLEN
    Populating: WARD
    Populating: JONES
    Populating: MARTIN
    Populating: BLAKE
    Populating: CLARK
    Populating: SCOTT
    Populating: KING
    Populating: TURNER
    Populating: ADAMS
    Populating: JAMES
    Populating: FORD
    Populating: MILLER
    Processing: 1:SMITH
    Processing: 2:ALLEN
    Processing: 3:WARD
    Processing: 4:JONES
    Processing: 5:MARTIN
    Processing: 6:BLAKE
    Processing: 7:CLARK
    Processing: 8:SCOTT
    Processing: 9:KING
    Added: 15:KING
    Processing: 10:TURNER
    Added: 16:TURNER
    Processing: 11:ADAMS
    Processing: 12:JAMES
    Added: 17:JAMES
    Processing: 13:FORD
    Processing: 14:MILLER
    Processing: 15:KING9
    Processing: 16:TURNER10
    Processing: 17:JAMES12
    Result: 1:SMITH
    Result: 2:ALLEN
    Result: 3:WARD
    Result: 4:JONES
    Result: 5:MARTIN
    Result: 6:BLAKE
    Result: 7:CLARK
    Result: 8:SCOTT
    Result: 9:KING
    Result: 10:TURNER
    Result: 11:ADAMS
    Result: 12:JAMES
    Result: 13:FORD
    Result: 14:MILLER
    Result: 15:KING9
    Result: 16:TURNER10
    Result: 17:JAMES12
    PL/SQL procedure successfully completed.With standard array (PL/SQL table):
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    type t_arr is table of varchar2(10);
      3    v_arr t_arr;
      4    v_cnt number := 0;
      5  begin
      6    -- populate the pl/sql table
      7    select ename bulk collect into v_arr from emp;
      8    -- now process the pl/sql table
      9    for i in v_arr.first .. v_arr.last
    10    loop
    11      dbms_output.put_line('Processing: '||i||':'||v_arr(i));
    12      if v_arr(i) = 'KING' then
    13        v_arr.extend;
    14        v_arr(v_arr.last) := 'PRESIDENT';
    15      end if;
    16    end loop;
    17    -- now what's in the pl/sql table?
    18    for i in v_arr.first .. v_arr.last
    19    loop
    20      dbms_output.put_line('Result: '||i||':'||v_arr(i));
    21    end loop;
    22* end;
    SQL> /
    Processing: 1:SMITH
    Processing: 2:ALLEN
    Processing: 3:WARD
    Processing: 4:JONES
    Processing: 5:MARTIN
    Processing: 6:BLAKE
    Processing: 7:CLARK
    Processing: 8:SCOTT
    Processing: 9:KING
    Processing: 10:TURNER
    Processing: 11:ADAMS
    Processing: 12:JAMES
    Processing: 13:FORD
    Processing: 14:MILLER
    Processing: 15:PRESIDENT
    Result: 1:SMITH
    Result: 2:ALLEN
    Result: 3:WARD
    Result: 4:JONES
    Result: 5:MARTIN
    Result: 6:BLAKE
    Result: 7:CLARK
    Result: 8:SCOTT
    Result: 9:KING
    Result: 10:TURNER
    Result: 11:ADAMS
    Result: 12:JAMES
    Result: 13:FORD
    Result: 14:MILLER
    Result: 15:PRESIDENT
    PL/SQL procedure successfully completed.
    SQL>So, in answer to your questions...
    Inserting additional rows in the array during the loop will effect the "last" value and alter the array. If you need to avoid this effect, store the "last" value in a variable and loop up to that value of the variable.
    New rows will generally be additional rows on the end of the array unless you are using associative arrays which will then depend on how you reference the rows in the array.

  • 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

  • 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

  • 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>

  • Columns inside rows

    Hi,
    Can anyone pls tell me how to put columns inside rows? For ex: I want to display all sales orders in a table with columns having header details (Order number, created date, sales org etc). Now when the user selects a record, then within that table and under that record i should be able to show the line items. The line items should have their own column headings.
    I hope i am clear. Any advise?
    Edited by: Aditya Atluri on Jan 15, 2009 2:06 AM

    Hi Aditya,
    You can use this workaround:
    Have a table for the line items initially set invisible in the following way:
    ==>You can create a context Va_Visible> make it of the type visibility (click on the last button in the property type> chk the Dictionary Simple Type>in it expand the node com.sap.ide.webdynpro.uielementdefinitions>select visibility)
    Bind this context to the visibility property of the disabled(keep the enabled property true) line item table.
    In the implementation of the view: in wddoinit make the line item field invisible using the following code:
    {wdContext.currentContextElement().setVa_Visible(WDVisibility.NONE);}
    ==>Now you can assign the action to the column of header table that when user clicks on one particular column the line item table is made visible
    {wdContext.currentContextElement().setVa_Visible(WDVisibility.VISIBLE);}
    and the data is fetched as per the column clicked.
    Regards.
    Rajat

  • Title/Heading/Row-Align Multi-Column Tables

    File under: Frame Annoyances, with a limited hacky work-around
    In the two-column format we commonly work in, we often need a table that is column-wide, but may flow into multiple colums.
    The problem is that the continuation heading (and TableTitle, if used), never align with the starting heading/title. This is because the continuations start at top of column, whereas the table itself starts (by "Anywhere" default) below the anchor line (presumed to be "In Column" for this discussion)..
    OK, what if we change Table > Table Designer [Basic] Start to:
    Top of Column: Oops, that becomes top of next column, leaving the anchor text column-widowed (but it gave me an idea).
    Top of Page: Oops, that becomes top of next page, leaving the anchor text page-widowed.
    Float: No effect
    OK, what if we change the anchor text Format > Paragraph > Para Designer [Pagination] Format to:
    [Pagination] Across All Columns (AAC): Oops, table appears only in left column on all pages, or;
    [Basic] Space & Line Spacing, including negative values, appears to have no effect. Using a tiny font only minimizes the problem, and doesn't cure it.
    I thought I had figured out how to solve this at one time, but could not recall it. I'm posting this in part to solicit some simpler solution. Web searching found only one solid candidate solution, and it was, of course, 404. Perhaps Frame versions later than the FM7/Win and FM7.1/Unix that I routinely use have enhancements to address this.
    We normally just sidestep the problem by using an AAC format and a table that spans the page, with a fake center gutter, simulating a multi-column flow. But in a recent case, I wanted a real single-column-wide table of variable length (due to conditional rows and expected future growth), but I wanted the headings to align across columns. The table did fit on a single page, which is a limitation of the following hack.
    Hack: This example presumes a normal 2-column page text frame that is 7.5in wide with a 0.24in gutter (3.63in columns), and table that needs no more than one page. It works for 3- and 4-column layouts as well.
    Use an AAC anchored frame text line.
    Create a full page width (7.5in) anchored frame (which can be Below, Top of Col, as desired).
    Create a text frame inside the anchored frame. This frame is:
    one more than your standard page (3-column for this example)
    Same gutter size (0.24in for this example).
    Initially draw the text frame to fit inside the the anchored frame, so you can easily grab it.
    Make sure the default (anchored table) paragraph format of the first column is "In Column".
    Use Graphics > Object Properties to adjust the inside text frame:
    Set Width: to your standard text frame total width plus 1 column and 1 gutter (11.37in for this example).
    Set Offsets: to 0 and 0 (this will push the rightmost column out of sight for the moment).
    Insert your table at the anchored table text of the inside text frame.
    In Table Designer, set Start: to Top of Column (this pushes the start of table to column 2).
    Select the internal text frame again.
    Set Offset From: Left: to negative one column + one gutter (-3.87in for this example).
    The table now appears to start in page column one, and flows to additional columns with heading alignment.
    This worked perfectly for my recent requirement. In fact, I used a 3-column layout (4 actual) for the text frame inside the anchored frame. Some math is required, sorry .

    I'm not sure if I followed that correctly, but if I read it right, you
    have a single-column table that spans multiple columns, and the issue is
    that the first column does not butt up against the top of the text
    frame, while the additional columns do. You want the table in all
    columns to butt up against the top of the text frame so that they are even.
    If that is the case, the solution is this:
    1. Create a paragraph format called "TableAnchor" in the Paragraph
    Designer. Assign it with a negative Space Below of -12.0 pt, "Fixed"
    line spacing, "Start Anywhere.," "In Column." Assign the font size as
    12.0 pt.
    2. Create your table format. Give it a Space Above of 12.0 pt.
    3. Then, always insert your table into its own, empty TableAnchor
    paragraph. You will get the alignment you seek.
    NOTES: Anywhere I said "12.0 pt," you can use a different font size-- as
    long as you use the same number in each place. You may also want to
    create a TableAnchorAAC paragraph format, which is identical except for
    the Across All Columns setting, to hold tables that span multiple columns.
    I hope I understood the question correctly and was of help.

  • Multiple row selection in ADF Table using addition column with checkbox

    I am using ADF table(Jdeveloper11g) and i want to selecte multiple rows it may be more than one OR all rows.
    For that i added one Column to the table with Header Delete and checkbox
    <af:table....
    <af:column sortProperty="Delete" headerText="Delete" width="100"
    sortable="false">
    <af:selectBooleanCheckbox label="#{row.favoriteId}"
    valueChangeListener="#{Mybean.onCheck}"
    id="checkbox" autoSubmit="true">
    </af:selectBooleanCheckbox>
    </af:column>
    </af:table>
    backing bean:Here i added code to get Value of one column with id favoriteId and use an arrayList(listForDelete) to monitor the state of the checkboxes
    public void onCheck(ValueChangeEvent valueChangeEvent) {
    BindingContainer bindings = getBindings();
    DCBindingContainer dcBindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterBind =
    (DCIteratorBinding)bindings.get("getUserFavoritesByUserIDIterator");
    if (iterBind != null && iterBind.getCurrentRow() != null) {
    RichSelectBooleanCheckbox ch = (RichSelectBooleanCheckbox)valueChangeEvent.getSource();
    if (!ch.isSelected()) {
    Long issueId = (Long)iterBind.getCurrentRow().getAttribute("favoriteId");
    listForDelete.add(issueId);
    else
    Long issueId = (Long)iterBind.getCurrentRow().getAttribute("favoriteId");
    listForDelete.remove(issueId);
    Problem is that when i select single row checkBox, onCheck() method of backing bean gets called multiple times(equals to the number of rows)
    I think this is beacuse of <af:selectBooleanCheckbox id is same that is "checkbox" but i am not sure.Even i tried to assign some unique id but no any success in assigning Id with value Expression.
    I also find related post
    Re: ADF Table Multiple row selection by Managed Bean
    but that is related to Select All rows or Deselect all rows from table.
    From the simillar post i follow the steps given by Frank.but problem with below step
    ->have an af:clientAttribute assigned to the checkbox with the following EL #{row.key} ,here I added <af:clientAttribute name="#{row.key}"></af:clientAttribute> and i am getting error
    Error(64,37):  Static attribute must be a String literal, its illegal to specify an expression.
    Please let me know if any one had already implemented same test case.
    Thanks for all help
    Jaydeep
    Edited by: JaydeepJ on Aug 7, 2009 4:42 AM

    just to update after the rollback is called in the cancel button i wrote following code which does not change the row focus to the first row
    DCBindingContainer bc =
    (DCBindingContainer)BindingUtils.getBindingContext().getCurrentBindingsEntry();
    DCIteratorBinding profItr =
    bc.findIteratorBinding("ProfileSearchInstIterator");
    Row cRow = profItr.getRowAtRangeIndex(0);
    if(cRow != null){
    System.out.println("Current row is not null so fixed ");
    profItr.setCurrentRowIndexInRange(0);
    RowKeySetImpl rks = new RowKeySetImpl();
    ArrayList keyList = new ArrayList();
    keyList.add(cRow.getKey());
    rks.add(keyList);
    profileTable.setSelectedRowKeys(rks);
    AdfFacesContext.getCurrentInstance().addPartialTarget(profileTable);
    }

  • 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());

  • How to populate rows in the detail table of a form from another table.

    please can someone help me here:
    i have a master/detail page. the master data is created and then i would like to do this: when one goes to the detail page (when first created), i would like somehow to populate all the rows in the detail table from rows retrieved in another table (with conditions).
    i am new to apex so if this is a stupid question i apologise in advance!

    Hi
    Firstly, there are no stupid questions, we all start somewhere!
    However, I could do with some more detail (or even better an example on apex.oracle.com). Please can you post exactly what you have so far and what you want to achieve with simple details of the tables involved.
    It sound like you may need to create a custom process to populate the details. You say 'with conditions'... what conditions?
    Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Maintain the current row position of a table after refresh.

    Hi,
    I use a poll to refresh tables continuously. when a table is refreshed, the current referring row is reset.
    To maintain the current row position after a refresh I use the following poll method.
    public void refreshTableT1(PollEvent pollEvent) {
    FacesContext fctx = FacesContext.getCurrentInstance();
    ValueBinding dcb = fctx.getApplication().createValueBinding("#{bindings}");
    DCBindingContainer bindings1 = (DCBindingContainer) dcb.getValue(fctx);
    DCIteratorBinding dciter = bindings1.findIteratorBinding("<VOIterator>");
    if(dciter!=null){
    if(dciter.getCurrentRow()!=null){   
    Key current_row_key = dciter.getCurrentRow().getKey();
    dciter.executeQuery();
    if(current_row_key!=null){
    try{
    dciter.setCurrentRowWithKey(current_row_key.toStringFormat(true));
    }catch(Exception ex) {
    System.out.println("Exception in current_row_key");
    }This works for normal tables well. But when I use it to master-detail tables (pair of tables) it does not.
    At the master-detail tables, before the first data fetch, it works well. if we go below the first data fetch, it sets the current row into another position.
    how can I overcome this...??
    Thanks,
    Dinuka.

    Hi Mr.Frank,
    I have an association in two VOs.
    for example: There are 2 tables called Emp and Dept. Every Department has Employees. so there is an association (both tables have a common column). Master table is the Dept table. when you click on one record of the Dept table Detail table will show the details of the employees belongs to that selected department. That's what I referred as master-detail tables. first one is master table; second one is detail table.
    When the web page loads all the table data is not fetched from the db (it will depend on the fetch size). when we scroll down the table data fetch happens again and again.
    think my data fetch size is 25 rows per time.
    Suppose we use mine poll method and think I have clicked on the 20 ^th^ row of table1(master table). then the table2 will display details belongs to selected department. that is OK even after refresh. that works well.
    when I go to 30 ^th^ row data fetch will happen (my fetch size = 25)
    when I click on the 30 ^th^ row of the table1(master table), table2 will display details belongs to selected department. but after the poll method is called the selected row at the table1 disappears and is set to another position. now the 30 ^th^ row is not in the 30 ^th^ position. but it is the selected row and table2 displays correct details.
    I think you have got the problem now. :D
    Thanks a lot.
    Dinuka.

  • How to get the last row of a database table.

    HI ,
    I want to get record exactly from the last row of a database table.
    How is that possible?

    Hi,
    To fetch last record from an internal table, just do find the number of records in it and read using index.
    DESCRIBE TABLE ITAB LINES L_LINES.
    READ TABLE ITAB INDEX L_LINES.
    You can also use LOOP .. ENDLOOP but the above method is better (performance wise).
    using LOOP .. ENDLOOP.
    LOOP AT ITAB.
    **do nothing
    ENDLOOP.
    **process ITAB (Header record of ITAB).
    **after ENLOOP, ITAB will have the last record of the internal table.
    [here ITAB is internal table as well as header record.]
    But what is the requirement?
    If you are looking for the current record of an employee then you can use ENDDA = HIGH_DATE.
    My advice is to review your requirement again and try to fetch only that record which you need.
    Mubeen

Maybe you are looking for

  • Printing in mirror image

    I cannot not print in mirror image.  I have Microsoft word 2013 and cannot find rotate or drawing tool.  Can anyone help me?  I take this printer does not print mirror image which I am so shocked.  Didn't even think to look for this feature before pu

  • Conditions for PO approvals in R/3 system

    Hi We are on SRM 4.0 classic scenario and backend as ECC5.0 We have a requirement where PO approval is to be done in backend R/3 system, only for POs which are created from SRM sourcing cockpit and R/3 manual POs. POs that are created from catalog ba

  • Problems while restoring iPhoto library with Time machine

    Hello, I've had some problems in iPhoto 11 for a while. Pics being removed or altered in different ways. I then decided to restore my iPhoto library to an earlier date using Time machine. I used a one week old backup and after 2 hours or so when it w

  • Putting 16 gigs of RAM in a non-Retina Display MBP

    I see that the "new" non-Retina Display MacBook Pro shows a max of 8 gig of RAM.  But I'm seeing kits for 16 gig, and even the Apple Store people seem equivocal about whether it will handle 16.  Is there any harm in putting 16 gig in it?  Any benefit

  • MCX Login Items: Mounting Server Volumes

    I noticed that when you set up a policy for a user,group or computer to mount a remote volue at login, you will get a Finder error if the volume can't be mounted for some reason (i.e.; the server is down, the volume is not available etc. This can be