Iterate through table rows

Hi Experts ,
JDEV 11.1.2
how can we iterate through Richtable rows one by one......?
if we have a 5 rows in a table , i need an iteration thorugh all 5 rows in order to check attribute values......how can i implement this?
please give me some rference code...
PMS
Edited by: pms on Apr 4, 2012 2:40 PM

Hi
getAllRowsInRange() method in the DCIteratorBinding will help you to get the number of rows and u can perform the check of attribute values inside the loop.
Example:
DCIteratorBinding dcib1 = (DCIteratorBinding) bindings.get("ViewObjectIteratorName");
DCIteratorBinding dcib2 = (DCIteratorBinding) bindings.get("ViewObjectIteratorName");
for(Row r1 : dcib1.getAllRowsInRange){
for(Row r2 : dcib2.getAllRowsInRange){
regards,
KR

Similar Messages

  • Iterate through filtered rows

    I have a table (af:table) with a filterable column. How could I iterate through the rows after the filter was applied?
    Thanks in advance
    jleon
    (JDeveloper 11.1.2.4.0)

    Have you tried to get the iterator in the bean method and iterate over it?
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            //access the name of the iterator the table is bound to. Its "EmployeesVOVIIterator"
            //in this sample
            DCIteratorBinding dciter = (DCIteratorBinding)bindings.get("EmployeesVOVIIterator");
            //access the underlying RowSetIterator
            NavigatableRowIterator rsi = dciter.getNavigatableRowIterator();
            while(rsi.hasNext()) {
                Row row =rsi.next();
                // work with the roe
            }Timo

  • A script to delete all table rows containing a specific text

    Hello,
    I've tried some old scripts but can't get around to the right solution.
    I need a script that will delete all rows in a table that contain a specific single-word text, something like "xxx".
    Anyone's got an idea?
    Thanks

    Hi,
    To remove a row use row.remove() method.
    So iterate through table.rows and remove the one matched a condition.
    If we talk about condition you have to be more accurate - what do you mean "a row contain a text":
         ==> 1st cell contains,
         ==> any cell contains.
    Entire row contents is an array of its cells.contents, so your 1st row text is:
    rows[0].contents.join(" ")     ==> string
    Jarek

  • For loop to iterate through temp table in store procedure in pl/sql

    Hi,
    how to create For loop to iterate through the temporary table in the store procedure?

    Neha RK wrote:
    hi,
    its not working , i need to check each record of table and do some task using if else loop inside that for..
    if not possible to loop each row of table using for then how to use while loop.
    please helpWhat's not working? We haven't got psychic powers so we can't see the code you say isn't working.
    Please provide more information like create table statements, insert statements with test data, the code you've tried
    and the output you are expecting from the input data.
    Read {message:id=9360002} and follow the advice there.

  • Java documentation / iterate through row values

    Hi there,
    I have a OAF page that I need to edit and didn't originally create. The page shows record details and each row has an updatable field that the user can enter values and submit. i need to be able to iterate through what has been entered and make updates from there. (Some of this functionality is currently coded but it is not working correctly)
    Can someone please point me in the right direction for where I can find documentation/code samples on how/best way to write this code? (Am I on the right track with RowIterator?) I have the Users' Guide for the jDeveloper RUP version but I think I need additional references. We are on RUP7. I'm sure there's a java guide somewhere, but I don't even know where or under what to look!
    Thanks for helping a complete novice!!
    Janel.

    Why do you need to loop through the result set? This is very easy to do with simple set based SQL:
    DECLARE @Status INT = 0;
    DECLARE @tbl table (BoolCol bit);
    insert @tbl values (1), (null)
    SELECT
    @Status = CASE WHEN COUNT(
    CASE WHEN BoolCol = 0 THEN 1 ELSE NULL END) > 0 THEN 1
    WHEN COUNT(
    CASE WHEN BoolCol = 1 THEN 1 ELSE NULL END) = COUNT(*) AND COUNT(*) > 0 THEN 2
    ELSE 0 END
    FROM @tbl;
    select @status
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • TreeModel - Iterate through child records using row EL

    Hi all,
    Jdev Version: Studio Edition Version 11.1.1.7.0
    I have a search page where I need to display the search results of Header and on one of the columns need to display a concatenated list of children.
    Header is a Task and children are Assignees of the task. I am looking to achieve this by using a normal table bound to a tree binding inside which the 'Assignee' view link is added as a child. So the binding is ready. I attempt to use the af:table using the treeModel which also seems to be working fine.
    Now I am stuck on how to iterate through the assignees for each task using EL - #{row.???}
    Jsff  Code snippet
              <af:table value="#{bindings.Task1.treeModel}" var="row"
                          rows="#{bindings.Task1.rangeSize}"
                          summary="#{ResourcesGenBundle['Header.SearchResults']}"
                          varStatus="tableMetadata"
                          selectionListener="#{backingBeanScope.TaskSearchBean.selectHandler}"
                  width="100%" columnStretching="column:resId1c5" autoHeightRows="15">
                    <af:column id="c3" headerText="Assignees">
                        <af:iterator id="i1" rows="2" var="assigRow"
                                 value="#{row.Task11.collectionModel}">                 
                            <af:outputText value="#{assigRow.UserName}" id="ot2"/>
                            <af:spacer width="10" height="10" id="s2"/>
                        </af:iterator>
                    </af:column>
                </af:table>
    Page Def Snippet
        <tree IterBinding="Task1Iterator" id="Task1">
          <nodeDefinition DefName="sample.common.publicModel.components.view.TaskVO"
                          Name="Task10">
            <AttrNames>
              <Item Value="TaskId"/>
              <Item Value="Subject"/>
              <Item Value="Description"/>
              <Item Value="PastDue"/>
            </AttrNames>
            <Accessors>
              <Item Value="TaskUser"/>
            </Accessors>
          </nodeDefinition>
          <nodeDefinition DefName="sample.common.publicModel.components.view.TaskUserVO"
                          Name="Task11">
            <AttrNames>
              <Item Value="ListName"/>
              <Item Value="PersonId"/>
              <Item Value="UserRole"/>
            </AttrNames>
          </nodeDefinition>
        </tree>
    Thanks,
    Srini

    Trying out with
    <af:iterator id="i1" rows="2" var="assigRow"  value="#{row.children}">
    Will keep the thread posted on my progress. Meanwhile, any suggestions welcome .
    Another way I could think of achieving this is to not use a UI iterator and instead get the value for my outputText using a bean method where I could get the present row of the tree and get the children and concatenate the Assignee names and return. But UI iterator should be a better way to do this if possible. So still exploring.

  • Iterate through all the records in a table using Java API

    Hi All,
    What is the easiest way to iterate through all the records in a given table using Java API? I cannot find any methods that will return all records in a table and the only way I can use is to perform a free form search with a condition that is always true. The code works but is pretty ugly. Is there an alternative to this approach?
    Thanks!
    Kenny

    Hi Kenny,
    You can construct a new Search object with your table's code name, a new ResultSetDefinition object for your table and just execute this search using the GetResultSet method of CatalogData.
    Please look at the following code:
    Search search = new Search(<code name of your table>);
    ResultSetDefinition rsd = new ResultSetDefinition(<code name of your table>);
    rsd.AddField<code name of a field>);
    rsd.AddField(<code name of a field>);
    String sortField = <code name of your sort field>;
    boolean sortAscending = true;
    int page = 0; //page number
    A2iResultSet rs = <your CatalogData object>.GetResultSet(search, rsd, sortField, sortAscending, page);
    for (int i = 0; i < rs.GetRecordCount(); i++)
        Value fieldValue = rs.GetValueAt(i, <code name of a field>);
    Hope this helps,
    Nir
    PS - I really recommend you to start using the new API, as it is much more efficient and straight-forward.

  • Loop through table's rows

    Hi folks,
    I have a table with multiple rows which each one of them contains one dropdown list.
    In my code I want to loop through this table rows and check each dropdown list's selected-item.
    How can I do this in code(JavaScript).
    Thank you,
    Yair

    Check this thread,
    it has solutions for JavaScript ind FormCalc.
    http://forums.adobe.com/message/3345384#3345384

  • Iterate through RichTable with custom cells

    Hi.
    I create a RichTable by drag and drop a view in DataControls. View is from table xxx and table contains only one column, binding description field in the table.
    This description is shown in an OutputText UI component.
    Then, I add a column with a SelectOneRadio component (to check Yes/No).
    Finally, I add another column with an Input Text to write comments.
    So, when I click one button, I capture the action event and want to process table content. But, how can I iterate through this table?
    How can I get each row, and each cell in its row (each radio, each text)?
    My JDeveloper version is 11.1.1.7.0
    Thanks in advance. Best regards
    EDIT: _________Final solution_________
    Add two transient attributes and iterate the VO object is very easy.
    For the specific issue about radio button, add a switcher and bind the radio group with the transient attribute.

    Hi,
    You could do something like
                   <af:switcher id="s1" defaultFacet="input" facetName="#{row.type eq 0?'radio':'input'"}>
                    <f:facet name="input">
                        <af:inputText id="it2" value="#{row.answer.inputValue"}/>
                    </f:facet>
                    <f:facet name="radio">
                        <af:selectBooleanRadio id="sbr1" value="#[row.answer.inputValue"}/>
                    </f:facet>
                    </af:switcher>
    -Arun

  • Can anyone tell me how to iterate through a cmponent tree in JSF

    HI,
    I am new to JSF.Can any one help me in iterating through a component tree.
    For eaxmple , i have a JSF page.When i send a request for the first time for a page ,
    it will build the component tree.So i want to iterate through that component tree.
    Actullay my requirement is that in my page, i will have a datatable and some command buttons.
    when i select a row in a datatable,it should be highlighted.But again onpage load, highlighting is missing.
    So i want to save the id of the element, which i selected in the table in the request object.
    Pls help me out....

    The view root is available by FacesContext#getViewRoot(). Its getChildren() returns a List<UIComponent>. For every UIComponent you can get the children by UIComponent#getChildren() which on its turn also returns a List<UIComponent>. You can easily write a recursive method for that.

  • Loop through table(table is created dynamically)

    Hi all,
    I have a table that is created dynamically.It has got 3 columns and 8 rows.In first row - first column,I have a value that is set dynamically.Now, How can I loop through this table and get this value?
    The table context node and value attributes are also created dynamically.
    Table node is "TimesheetData" and value attribute is col1.Value,col1.Value and col3.Value
    TimesheetData
    col1.Value
    col2.Value
    col3.Value
    Again.... this node and attributes are not there in my view context by default, its getting created and binded dynamically here.
    Thanks Kukku

    Hi,
    Following is the code to iterate through the elements
    //Table node is "TimesheetData" and value attribute is col1.Value,col1.Value and col3.Value
    for(int x=0;x<wdContext.getChildNode("TimesheetData",0).size(); x++)
                IWDNodeElement nodeElement = wdContext.nodeTimesheetData().getElementAt(x);
                String value1 = (String) nodeElement.getAttributeValue("col1");
                String value2 = (String) nodeElement.getAttributeValue("col2");
                String value3 = (String) nodeElement.getAttributeValue("col3");
    Regards
    Ayyapparaj

  • How do I loop through tables, not columns in a table?

    Sorry if this is a long one. My problem is actually quite simple. I am trying to write either an ad hoc PL/SQL block or a stored procedure to loop 18 times (thru 18 tables) and perform a SQL query on those tables, returning 18 resultsets. I would like the results to show up on the screen (or in a spool file, whatever).
    So far I have tried 3 different approaches, none of which have worked.
    1. I tried to assign the select query to a variable (qry) and use EXECUTE IMMEDIATE qry. This forced me thru a variety of errors to declare variables and assign the result to them--EXECUTE IMMEDIATE qry into nm0, nm1, nm2...
    The problem with that was the resultset returned more than the variable was built for as there might be no rows returned, or it might be a thousand rows of data. So I tried changing the variables to VARRAYS, but it gave me a type mismatch as the underlying columns were NUMBER and VARCHAR2.
    DECLARE
         ctr number;
         TYPE NUMLIST IS VARRAY (1000) OF NUMBER;
         TYPE VARLIST IS VARRAY (1000) OF VARCHAR2(15);
         nm0 NUMLIST NOT NULL DEFAULT 1;
         nm1 VARLIST;
         nm2 NUMLIST NOT NULL DEFAULT 1;
         nm3 VARLIST;
         nm17 NUMLIST NOT NULL DEFAULT 1;
         qry VARCHAR2(2000) := 'klx_uln_p000_cells';
    BEGIN
    FOR ctr IN 1..17 LOOP
         IF ctr &lt; 10 THEN
              qry := 'SELECT
              A.DIM_0_INDEX,
              S0.SYM_NAME,
              A.DIM_1_INDEX,
              S1.SYM_NAME,
              A.DIM_2_INDEX,
              S2.SYM_NAME,
              A.DIM_3_INDEX,
              S3.SYM_NAME,
              A.NUMERIC_VALUE,
              B.NUMERIC_VALUE
              FROM
              KHALIX.klx_uln_p00'||ctr||'_cells A,
              KHALIX.klx_ucn_p00'||ctr||'_cells B,
              KHALIX.KLX_MASTER_SYMBOL S0,
              KHALIX.KLX_MASTER_SYMBOL S1,
              KHALIX.KLX_MASTER_SYMBOL S7
              WHERE
              A.DIM_0_INDEX=B.DIM_0_INDEX AND
              A.DIM_1_INDEX=B.DIM_1_INDEX AND...
              A.DIM_7_INDEX=S7.SYM_INDEX';
         ELSE
              qry := 'SELECT
              A.DIM_0_INDEX...
              A.DIM_7_INDEX=S7.SYM_INDEX';
         END IF;
         BEGIN
         dbms_output.put_line('SELECT FOR KLX_ULN_P00'||ctr||'_CELLS');
         dbms_output.put_line(nm16);
         dbms_output.put_line(nm17);
         EXECUTE IMMEDIATE qry into nm0,nm1,nm2,nm3,nm4,nm5,nm6,nm7,nm8,nm9,nm10,nm11,nm12,nm13,nm14,nm15,nm16,nm17;
    --     dbms_output.put_line(qry);
         dbms_output.put_line(nm16);
         dbms_output.put_line(nm17);
         EXCEPTION
              WHEN NO_DATA_FOUND THEN
                   dbms_output.put_line('No data found for Query '||ctr);
         END;
    END LOOP;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
              dbms_output.put_line('No data found for Query '||ctr);
    END;
    2. So then I used REF CURSOR to create a stored procedure and return the values. That allowed me to run my query AND tokenize the tablenames with a counter so that it would loop through the different tables! However, I still could not get it to display the results without going to SQL Plus and typing 'print c;'.
    3. So, finally I tried to create a looping wrapper around the ref cursor to have some variable (ctr) increment so my query would get performed on table0_cells through table17_cells. This, too, did not work.
    If I manually go to SQL Plus and type:
    variable ctr number
    begin
    :ctr := 1;
    end;
    exec dupe_find(1,:c);
    it will execute for the first table (klx_uln_p001_cells) and I can then type 'print c' to see what was returned. But when I try putting this within a wrapper PL/SQL block with a Loop to make ctr go from 0 - 17 (to loop through table_names klx_uln_p000_cells to klx_uln_p017_cells), it does not work.
    Help! It should be very simple to loop through tables, shouldn't it? I just want a script that will loop through tables, perform a query on each table and display the results. For some reason, I can only find documentation examples on looping through columns that are all in the same table.
    Dave

    Here's a working example using your first strategy ...
    create table t1 (id number);
    create table t2 (id number);
    insert into t1 values (100);
    insert into t1 values (101);
    insert into t2 values (200);
    insert into t2 values (201);
    declare
    v_table_name user_tables.table_name%type;
    type ttab_id is table of t1.id%type index by binary_integer;
    tab_id ttab_id;
    begin
    for i in 1 .. 2 loop
    v_table_name := 't' || i;
    execute immediate 'select id from ' || v_table_name
    bulk collect into tab_id;
    dbms_output.put_line('query from ' || v_table_name);
    for j in 1 .. tab_id.count loop
    dbms_output.put_line(tab_id(j));
    end loop;
    end loop;
    end;
    There are many other ways to do this (especially if you need to do more than just print out the data).
    Richard

  • Triggering "exit" event of a drop-down list in all instances of a table row

    I have a drop-down list in a table row with multiple instances that performs a calculation on the exit event. This calculation draws information from 2 other dropdown lists contained above in non-repeating rows of the same table.
    The desired behavior is: should the user change their choices above, all instances of the drop-down list below would perform the "Exit" event script  accessing the new values above.
    My script is:
    RowOptionalCoverage.DdlCoverageType.execEvent("exit");     this works, sort of
    It only updates the first instance of RowOptionalCoverage and none of the subsequent instances. The user can "Tab" through the instances and trigger the Exit event for each instance, but this is not a reasonable solution.
    I have tried using the resolveNodes method without success. I understand, using the resolveNodes method may be necessary when referencing multiple instances of an object:
    this.resolveNodes("RowOptionalCoverage[*].DdlCoverageType[*]").execEvent("exit");     doesn't work
    xfa.resolveNodes("RowOptionalCoverage[*].DdlCoverageType[*]").execEvent("exit");      doesn't work
    No doubt, I must be using the resolveNodes incorrectly or missing something? Probably something simple.
    Any advice is greatly appreciated.
    Stephen

    PERFECT!!! Works right out of the box!
    This has opened my eyes to the essential nature of loops. My form is very large and complex and functions correctly, Yet the coding is lacking in sophistication--no loops, functions, fragments or other code efficiencies. I am teaching myself (with the help here) and I have skipped learning and using some techniques when I could things to work using the  limited skill set I have.
    Sometimes, I just don't "get it". After I fail a few times, I skip it and try something else. Functions are a great example. I could utilize a bunch of these if I could only write one that works. It is frustrating. If I got one to work, I know could write a ton of them. But, there is some essential part of functions I am missing that's preventing me from having my first success with them. (I think it has to do with not understanding arguments completely).
    Anyway, I am overjoyed with the solution you provided and I understand it well enough to be able to use again in other situations.
    Thanks again!
    Stephen

  • How to get the index of table row without selection?

    Hi all,
    I have an table designed in XML view.Now i have added an change method for qty cell "valqty". When user inputs the qty in the cell and press enter this method is triggered now I want to know which index of the table is currently edited.Through which i can get the value of other cell in the same row.
    NOTE: The table row doesn't have selection either multiple or single
    I tried the following inside the valqty method but it now working
    this.getValue();
    this.getBindingContext().getProperty('PRD_NUM');
    <Table id="idProductsTable"
    inset="false"
    items="{oModel>/deliverylist}"
    visibleRowCount= "7"
    mode="MultiSelect"
    modeAnimationOn="true">
    <headerToolbar>
    <Toolbar>
    <Label text="Products"></Label>
    </Toolbar>
    </headerToolbar>
    <columns>
    <Column
    minScreenWidth="Tablet"
    demandPopin="true">
    <Text text="Order" />
    </Column>
    <Column
    minScreenWidth="Tablet"
    demandPopin="true">
    <Text text="Quantity" />
    </Column>
    </columns>
    <items>
    <ColumnListItem>
    <cells>
    <Text text="{oModel>PRD_NUM}" />
    <Input value="{oModel>DEL_QUAN}" change="valqty" maxLength="13"  />
    </cells>
    </ColumnListItem>
    </items>
    </Table>
    Thanks

    Thanks Robin,
    But in my case oEvent.getSource() is returning the cell instance and
    oEvent.getSource().getBindingContext() is undefined
    Hence not getting the value
    I also tried the following
    oEvent.getSource().getParent().getParent().indexOfItem()
    But index returned is -1

  • How to add blank line below the table/row whenever there is no data

    Hello Everyone,
    I have a table in my report template like below:-
    Children / Dependents: Name / Comments: Grandchildren: Name / Comments:
    Son John Daughter Smith
    Daughter Laura Son Kevin
    Son Bill None NA
    When i run the report I need to achieve the following conditions:-
    Condition 1: Loop through all rows and whenever there is data in any row in the table...I need to Populate and print it.
    Condition 2: When Loop is ended, when you see there is no data in any row in the table... add a dash line at the end of the table.
    Condition 3: Total no of populated rows + blank dash line <= Max no of rows in DB. And when max no of populated rows in report = max no of rows in DB/UI ... don’t print dash line.
    I want to achieve these conditions. Can you please help me.
    Thanks..Rithesh

    Hello Everyone,
    I have a table in my report template like below:-
    Children / Dependents: Name / Comments: Grandchildren: Name / Comments:
    Son John Daughter Smith
    Daughter Laura Son Kevin
    Son Bill None NA
    When i run the report I need to achieve the following conditions:-
    Condition 1: Loop through all rows and whenever there is data in any row in the table...I need to Populate and print it.
    Condition 2: When Loop is ended, when you see there is no data in any row in the table... add a dash line at the end of the table.
    Condition 3: Total no of populated rows + blank dash line <= Max no of rows in DB. And when max no of populated rows in report = max no of rows in DB/UI ... don’t print dash line.
    I want to achieve these conditions. Can you please help me.
    Thanks..Rithesh

Maybe you are looking for

  • SSRS report does not rendering properly in sharePoint 2013

    Hi everyone, I'm a newbie with the MSBI development tool, I've tried to create a testing SSRS reports and its layout showed correct when preview them in Visual Studio (2010 and 2012). Then I migrated the report in SharePoint 2013, but the layout do n

  • Statutory Register Templates

    Hi I have to provide statutory registers for India context for various customers like VAT / Sales Tax register, Excise Register. If yes, where can i find this, the sample xl reporter section on SAP portal does not have anything on India context. Is t

  • Database performance, deadlocks

    Hi all, I'm trying to settle a discussion I'm having internally. If you have a database server with high I/O wait, continously (over 60% for extended periods of time) and that server has only one disk mirrored for the whole system. (database is way t

  • Re: Counter in the report

    Hi Gurus, Can any one help me out how can I be able to print the counter of invoice details for a check in the output of the report. I am having a report where there are 2 repetitive frames one for check number and other for invoice number. --> After

  • Setting up ALE to integrate cProjects and HR CATS

    Hi Gurus, We're wondering if it is mandatory to set up ALE to integrate cProjects and HR CATS.  We found SAP note 954860 and we were trying to understand it, on a functional point of view, before to send it to our Basis team. We would like to get som