ADF Intersection table / create intersection rows

Good morning everybody,
can anyone help me with the task of using a intersection table (Many-to-Many relationship between A and B) with ADF BC ?
This is my database design:
TABLE A
ID (PK)
TABLE X (intersection table)
TableA.ID (PK)(FK)
TableB.ID (PK)(FK)
Number n (PK)
TABLE B
ID (PK)
I have a new bounded task flow, a dialog (2 pages), which first allows the user to create an A-object.
The next step is to create B-Objects which belong to the A-Object.
Then the user can commit or add more new B-objects to the A-Object.
I have created alle the entity objects and view objects via the assistant of "new business components from tables" which created:
Entity A
Entity X
Entity B
X Assoc Fk1
X Assoc Fk2
VO A
VO X
VO B
VL Fk1
VL Fk2
My task flow does this :
1. create new VO-A (via Create with parameters)
2. view activity CreateA
3. create new VO-B (via Create with parameters)
4. view activity CreateB
from this activity you can commit transaction or go back to 3. to add more VO-Bs.
So, how is it possible to handle the intersection table ?
I read something about "intersection associations and intersection view links" but some people say in this context, that you dont need it (all what is build by the assistant from the tables is ok). Sorry, but this made me very confusing :-/
Some guys recommended to create one VO which contains alle three entities (A,X,B).
First thought was, to handle all this business logic (create new VO-X and use setter to the FK/PK IDs...) in the managed bean, but this would be very dirty... There should be a way of doing this automatically...
I am very new to ADF and would be very happy, if anyone could help me!
Thanks in advance,
best regards
Marcus
Edited by: moonbird on 20.10.2010 00:46

Hi John,
my question is, how can I insert new rows to a intersection table ?
Is there a declerative way or do I have to write code ?
As I described before, I have two views as a bounded task flow. In the first view the user creates a new Object-A and in the second view the user creates an Object-B.
Before each view is started, I create the correspondent VO via CreateInsert declerative, so my views shows the empty row (all its attributes to fill out).
Thank you very much,
Marcus

Similar Messages

  • Creating an intersection table record

    I want to add an intersection table record and the related FK record at the same time. I have three tables with cardinality shown below:
    Restaurants 1:N RestaurantRatings 0..1:1 Ratings
    Thus, a restaurant can have zero or more customer ratings (i.e. restaurant reviews).
    We use an intersection table (i.e. "RestaurantRatings") because table "Ratings" is also used for rating food items, which involves another intersection table (not mentioned above) to keep track of the food
    ratings.
    I followed the instruction in the ADF Developers Guide 11g Release 1 (11.1.1) for the following sections:
    38.8 Controlling Entity Posting Order to Avoid Constraint Violations
    39.9 Creating a View Object with Multiple Updatable Entities
    Per section 38.8, I created the following override of EO method RestaurantRatingsImpl::postChanges for intersection table RestaurantRatings.
    public void postChanges(TransactionEvent e) {
    //If current entity is new or modified
    if (getPostState() == STATUS_NEW ||
    getPostState() == STATUS_MODIFIED)
    //Get the associated restaurant for this intersection-table row
    EntityImpl restaurants = this.getRestaurants();
    //If there is an associated restaurant
    if (restaurants != null)
    //And if it's post-status is NEW
    if (restaurants.getPostState() == STATUS_NEW)
    * Post the restaurant first, before posting this
    * entity by calling super below
    restaurants.postChanges(e);
    EntityImpl rating = this.getRatings();
    //If there is an associated rating
    if (rating != null)
    //And if it's post-status is NEW
    if (rating.getPostState() == STATUS_NEW)
    * Post the rating first, before posting this
    * entity by calling super below
    rating.postChanges(e);
    super.postChanges(e);
    Then I use RestaurantRatingsViewLink, in the "Oracle Business Component Browser", to create a new Ratings record that is linked to an existing Restaurants record. My debugging session reveals that line
    "this.getRatings();" returns null when I create a new Ratings record.
    Any ideas, or better examples for how to properly create an intersection table record or update a view object with multiple entities objects.
    Thanks,
    Travis

    Setting Composition on RestaurantRatingsRatingFk1Assoc didn't fix the problem. This association defines "Ratings.id" as the source and "RestaurantRatings.RatingId" as the destination.
    Using the Oracle Business Component Browser, I attempted to insert a new row in the ResataurantRatings intersection table. I get the following error:
    (oracle.jbo.AttrValException) JBO-27014: Attribute RatingId in AppModule.RestaurantRaitingsView1 is required.
    I suspect we can't use composition because we have two associations from intersection table "RestaurantRatings". That is, table "RestaurantRatings" has two foreign keys. One to table "Restaurants". The other to table "Ratings".
    Our RestaurantRatingsView has "Restaurant" as the master EO and "Ratings" as the detail EO. They are both set as "Updatable" in the view's "Entity Objects" tab.
    Is composition really usable in this situation? Is there a similar example?
    Travis

  • How do I Create a Tabular Form for an Intersection Table

    Situation
    There are three tables involved (PROJECT, STAFF, TASK)
    PROJECT(PROJECT_ID, PROJECT_NAME)
    STAFF(STAFF_ID, STAFF_NAME)
    TASK(PROJECT_ID, STAFF_ID, HOURS)
    There is a many to many relationship between PROJECT and STAFF. The intersection table is TASK.
    Issue
    I would like to create a tabular form for the TASK table. I would like to be able to click on a button (Add Row) to add a row to the existing tabular form. The row will have a LOV for the PROJECT_ID (showing PROJECT_NAME) and one for the STAFF_ID (showing STAFF_NAME) and a free form text field for the hours.
    I've tried a bunch of different ways but am unable to acheive this functionality. I must be doing something wrong. This sort of thing is trivial.
    Any guidance/suggestions are greatly appreciated.
    Thanks

    Adding a new surrogate key column to an existing table is not that big a deal.
    alter table t add (pk int primary key);
    create a before-insert row-level trigger to populate the key;Other than that, you are out of luck w.r.t the wizards. Yes, you can define a 2nd PK column in the wizard, but then the 2 PK columns becomes read-only (but you want to update them).
    You can write your own tabular form using htmldb_item APIs and your own after submit processes to process the updates. See the manual Tabular Form Howto in the documentation.
    Thanks

  • Querying multiple intersection tables against another table for row exists

    Hi all,
    Running on:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    With the Partitioning and OLAP options
    JServer Release 9.2.0.8.0 - Production
    I am setting up email subscription service for news service website. News articles are tagged with multiple audiences, topics, regions and departments. Legacy data model we're dealing with implements one intersection table (M:N) for each of audience, topic, region and department lookup table and main news article table.
    Email subscribers can pick any combination of the above options (audience, dept etc..) to customize the content of their email. Emails will be either daily or weekly digests of articles of interest, based on their chosen options.
    The subscriber options are captured in one table, each option type being its own column. I'm trying to write one query to basically extract all articles that match a given subscriber's chosen options.
    create table audiences(articleid number, audienceid number);
    create table topics(articleid number, topicid number);
    create table regions(articleid number, regionid number);
    create table depts(articleid number, deptid number);
    create table subscriber_options(emailid number,audienceid number,topicid number, regionid number, deptid number);
    insert into audiences(articleid,audienceid)
    SELECT
    ceil(dbms_random.value(1,10)),
    ceil(dbms_random.value(1,50))
    from all_objects where rownum < 100;
    insert into topics(articleid,topicid)
    select
    ceil(dbms_random.value(1,10)),
    ceil(dbms_random.value(1,50))
    from all_objects where rownum < 100;
    insert into regions(articleid,regionid)
    select
    ceil(dbms_random.value(1,10)),
    ceil(dbms_random.value(1,50))
    from all_objects where rownum < 100;
    insert into depts(articleid,deptid)
    select
    ceil(dbms_random.value(1,10)),
    ceil(dbms_random.value(1,50))
    from all_objects where rownum < 100;
    INSERT INTO subscriber_options (
       EMAILID, audienceid, topicid,
       regionid, deptid)
    select
    ceil(dbms_random.value(1,10)),
    ceil(dbms_random.value(1,50)),
    ceil(dbms_random.value(1,50)),
    ceil(dbms_random.value(1,50)),
    ceil(dbms_random.value(1,50))
    from all_objects where rownum < 100;
    commit;If a subscriber hasn't chosen any options, then no rows will exist in the subscriber_options table, which implies that they will receive all articles.
    I am struggling with this query.. can this be achieved using only 1 query or is this a case where some PL/SQL is required?
    All I really want to know is if a given subscriber option matches an option for a given article, using the following boolean logic (topic OR audience) AND dept AND region.
    Because I'm more concerned with row existence, I thought of using the "EXISTS" with subquery approach.
    Thanks for tips and advice.

    Well.. a little persistence, and I think I cracked this nut. ;-)
    WITH instant_subscribers AS
         (SELECT   email_subscriber_id, email_subscriber.subscriber_email,
                   email_subscriber.subscriber_first_name,
                   email_subscriber.subscriber_last_name,
                   email_subscriber.subscriber_identifier_code,
                   email_subscriber.languageid, COUNT (newscreatorid)
                                                                     dept_options,
                   COUNT (newscategoryid) topic_options,
                   COUNT (newscoveragespatialid) region_options,
                   COUNT (newsaudiencetypeid) audience_options
              FROM email_subscriber LEFT OUTER JOIN subscriber_option
                   USING (email_subscriber_id)
             WHERE email_subscriber.subscription_frquncy_type_id = 1
               AND email_subscriber.subscription_status_id = 2
               and email_subscriber_id=53169
          GROUP BY email_subscriber_id,
                   email_subscriber.subscriber_email,
                   email_subscriber.subscriber_first_name,
                   email_subscriber.subscriber_last_name,
                   email_subscriber.subscriber_identifier_code,
                   email_subscriber.languageid)
    SELECT subscr.*, d.*
      FROM instant_subscribers subscr,
           (SELECT ccnews.newsid, ccnews.title, ccnews.embargodate, ccnews.description,
                   ccnews.languageid
              FROM ccnews
             WHERE ccnews.embargodate >= TRUNC (SYSDATE - 7)
               AND ccnews.embargodate < TRUNC (SYSDATE)
               AND ccnews.newsstatusid = 2
               AND ccnews.isreadingroom = 'FALSE'
               )  d
    WHERE subscr.languageid = d.languageid and ( (subscr.audience_options=0 OR subscr.topic_options=0 OR EXISTS (
                        SELECT NULL
                              FROM subscriber_option INNER JOIN ccnews_audience_rel
                                   USING (newsaudiencetypeid, languageid)
                             WHERE subscriber_option.email_subscriber_id =
                                           subscr.email_subscriber_id
                               AND ccnews_audience_rel.newsid = d.newsid))
            OR ( EXISTS (
                     SELECT NULL
                              FROM subscriber_option INNER JOIN ccnews_category_rel
                                   USING (newscategoryid, languageid)
                             WHERE email_subscriber_id =
                                           subscr.email_subscriber_id
                               AND ccnews_category_rel.newsid = d.newsid))
       AND (subscr.dept_options = 0 OR EXISTS (
                    SELECT NULL
                          FROM subscriber_option INNER JOIN ccnews_creator_rel
                               USING (newscreatorid, languageid)
                         WHERE email_subscriber_id =
                                           subscr.email_subscriber_id
                           AND ccnews_creator_rel.newsid = d.newsid))
       AND (subscr.region_options = 0 OR EXISTS (
                        SELECT NULL
                          FROM subscriber_option INNER JOIN ccnews_coverage_spatial_rel
                               USING (newscoveragespatialid, languageid)
                         WHERE email_subscriber_id =
                                           subscr.email_subscriber_id
                           AND ccnews_coverage_spatial_rel.newsid = d.newsid)) order by d.embargodate DESCI basically outer join my subscriber (supertype) with my subscriber_options (subtype)... and count each option type groupe by subscriber, to determine if they have any options for given type (if count is 0, then they chose "all")
    From there, I use this count to "short-circuit" the predicates.. if count=0 OR exists subquery with inner join on chosen options matched to article.
    Explain plan reveals the following:
    Plan
    SELECT STATEMENT  CHOOSECost: 70  Bytes: 727  Cardinality: 1                                                    
         36 SORT ORDER BY  Cost: 70  Bytes: 727  Cardinality: 1                                               
              35 FILTER                                          
                   10 TABLE ACCESS BY INDEX ROWID NEWSROOM.CCNEWS Cost: 64  Bytes: 371  Cardinality: 1                                     
                        9 NESTED LOOPS  Cost: 68  Bytes: 727  Cardinality: 1                                
                             7 VIEW NEWSROOM_DEV02. Cost: 4  Bytes: 356  Cardinality: 1                           
                                  6 SORT GROUP BY  Cost: 4  Bytes: 121  Cardinality: 1                      
                                       5 FILTER                 
                                            4 NESTED LOOPS OUTER  Cost: 2  Bytes: 605  Cardinality: 5            
                                                 2 TABLE ACCESS BY INDEX ROWID NEWSROOM_DEV02.EMAIL_SUBSCRIBER Cost: 1  Bytes: 80  Cardinality: 1       
                                                      1 INDEX UNIQUE SCAN UNIQUE NEWSROOM_DEV02.EMLSUBSR_PK Cardinality: 1 
                                                 3 INDEX RANGE SCAN UNIQUE NEWSROOM_DEV02.SUBSCRIBER_OPTION_UQ_IDX Cost: 1  Bytes: 205  Cardinality: 5       
                             8 INDEX RANGE SCAN NON-UNIQUE NEWSROOM.CCNEWS_IN Cost: 1  Cardinality: 317                           
                   16 TABLE ACCESS BY INDEX ROWID NEWSROOM.CCNEWS_AUDIENCE_REL Cost: 5  Bytes: 12  Cardinality: 1                                     
                        15 NESTED LOOPS  Cost: 5  Bytes: 39  Cardinality: 1                                
                             12 TABLE ACCESS BY INDEX ROWID NEWSROOM_DEV02.SUBSCRIBER_OPTION Cost: 2  Bytes: 297  Cardinality: 11                           
                                  11 INDEX RANGE SCAN UNIQUE NEWSROOM_DEV02.SUBSCRIBER_OPTION_UQ_IDX Cost: 2  Cardinality: 4                      
                             14 BITMAP CONVERSION TO ROWIDS                           
                                  13 BITMAP INDEX SINGLE VALUE NEWSROOM.CCNEWS_AUDIENCE_REL_IN                     
                   22 TABLE ACCESS BY INDEX ROWID NEWSROOM.CCNEWS_CATEGORY_REL Cost: 5  Bytes: 12  Cardinality: 1                                     
                        21 NESTED LOOPS  Cost: 5  Bytes: 78  Cardinality: 2                                
                             18 TABLE ACCESS BY INDEX ROWID NEWSROOM_DEV02.SUBSCRIBER_OPTION Cost: 2  Bytes: 297  Cardinality: 11                           
                                  17 INDEX RANGE SCAN UNIQUE NEWSROOM_DEV02.SUBSCRIBER_OPTION_UQ_IDX Cost: 2  Cardinality: 4                      
                             20 BITMAP CONVERSION TO ROWIDS                           
                                  19 BITMAP INDEX SINGLE VALUE NEWSROOM.CCNEWS_CATEGORY_REL_IN                     
                   28 TABLE ACCESS BY INDEX ROWID NEWSROOM.CCNEWS_CREATOR_REL Cost: 5  Bytes: 14  Cardinality: 1                                     
                        27 NESTED LOOPS  Cost: 5  Bytes: 41  Cardinality: 1                                
                             24 TABLE ACCESS BY INDEX ROWID NEWSROOM_DEV02.SUBSCRIBER_OPTION Cost: 2  Bytes: 297  Cardinality: 11                           
                                  23 INDEX RANGE SCAN UNIQUE NEWSROOM_DEV02.SUBSCRIBER_OPTION_UQ_IDX Cost: 2  Cardinality: 4                      
                             26 BITMAP CONVERSION TO ROWIDS                           
                                  25 BITMAP INDEX SINGLE VALUE NEWSROOM.CCNEWS_CREATOR_REL_IN                     
                   34 TABLE ACCESS BY INDEX ROWID NEWSROOM.CCNEWS_COVERAGE_SPATIAL_REL Cost: 5  Bytes: 12  Cardinality: 1                                     
                        33 NESTED LOOPS  Cost: 5  Bytes: 39  Cardinality: 1                                
                             30 TABLE ACCESS BY INDEX ROWID NEWSROOM_DEV02.SUBSCRIBER_OPTION Cost: 2  Bytes: 297  Cardinality: 11                           
                                  29 INDEX RANGE SCAN UNIQUE NEWSROOM_DEV02.SUBSCRIBER_OPTION_UQ_IDX Cost: 2  Cardinality: 4                      
                             32 BITMAP CONVERSION TO ROWIDS                           
                                  31 BITMAP INDEX SINGLE VALUE NEWSROOM.CCNEWS_SPATIAL_REL_IN                     To me it looks pretty good... I'd be curious to know how it looks to a trained eye.. ;-)
    I do get my results back as expected...
    Edited by: pl_sequel on Sep 24, 2010 4:24 PM

  • Create a BC with intersection table as base table.???

    Hi Axel,
    U have replied that for MVG with M:M create a new BC with the intersection table as the basetable.

    Hi Axel,
    Thank u for ur information its more useful also. Iwant to know one morething .will make u clear about the situation. I need to create an MVG taking Campaign and Offer BCs having M:M link between them. did i need to create an MVG Applet in Offer BC or in Action Employee? Intersection table comes into picture when i need to create a MVG in M:M link without using association applet.
    Regards,
    devu

  • Adding/removing many-to-many associations with intersection tables

    Hello,
    I am using Jdeveloper 11g with ADFBC.
    I have some many to many associations in my application. For example User and Category are associated and there is an intersection entity (UserCategory - Columns are UserId, CategoryId) to save these associations.
    What is the correct method for adding or removing categories assigned to user?
    Thanks.
    Edited by: Deniz Gulmez on 01-Nov-2009 03:25

    I found an example for Jdeveloper 10g, which is discussed [ADF] Adding/deleting entries in a many-to-many relationship
    In that example, many-to-many association is defined as two 1-to-many associations. Actually i've been searching since last week for an example which is made with many-to-many associations but no help. I will change my Model structure if it is not an efficient way to define many-to-many associations with intersection tables.
    I wonder if it is possible to write some methods like :
    addCategoryToUser(String userId, String categoryId)
    removeCategoryToUser(String userId, String categoryId)
    addCategories(String userId, List categoryIds)
    vs.
    Of course i am able to do these by creating a new Row in UserCategoryView (Intersection view), setting it's attributes and saving. Or the opposite, finding the row in intersection table and deleting it.
    For example:
    public void removeCategoryFromUser(String userId, String categoryId){
    ViewObjectImpl vo = this.getUserCategories1();
    vo.setWhereClause("USER_ID = :userId AND CATEGORY_ID = :categoryId");
    vo.defineNamedWhereClauseParam("userId", null, null);
    vo.defineNamedWhereClauseParam("categoryId", null, null);
    vo.setNamedWhereClauseParam("userId", userId);
    vo.setNamedWhereClauseParam("categoryId", categoryId);
    vo.executeQuery();
    Row row = vo.first();
    row.remove();
    I wonder if there is a more efficient way. Any samples would be appreciated.
    Edited by: Deniz Gulmez on 01-Nov-2009 05:49

  • Intersection table

    Hello,
    I have the table customer:
    CREATE table customer
    cust_id NUMBER(5),
    phone_number NUMBER(10) NOT NULL,
    first_name VARCHAR(12) NOT NULL,
    last_name VARCHAR(30) NOT NULL,
    credit NUMBER(5, 2) DEFAULT 0 NOT NULL,
    CONSTRAINT cust_pk PRIMARY KEY (cust_id),
    CONSTRAINT phone_unique UNIQUE (phone_number)
    and the table movie:
    CREATE TABLE movie
    title VARCHAR(30) PRIMARY KEY,
    production_year NUMBER(4),
    rating VARCHAR(5) NOT NULL,
    max_days NUMBER(1) DEFAULT 1,
    quantity NUMBER(2),
    CONSTRAINT check_ratings CHECK (rating IN ('G', 'PG', 'PG-13', 'R', 'NC-17')),
    CONSTRAINT check_maxDays CHECK (max_days IN (1, 3, 7))
    now I want to store the rent of a movie, I come up with the following table:
    CREATE TABLE cust_rent_movie
    title VARCHAR(30),
    cust_id NUMBER(5),
    rent_date DATE DEFAULT current_date NOT NULL,
    return_date DATE,
    CONSTRAINT cust_rent_movie_pk PRIMARY KEY (title, cust_id, rent_date)
    Is the table cust_rent_movie an intersection table. Have I to declare the title and cust_id are foreign keys, the primary key consist of an extra attribute the rent_date.
    When a customer rent a movie I want to subtract one from the movie.quantity and when the customer return the movie I want to add one to the movie.quantity subtract from customer.credit
    Yiannis P.

    IPapas wrote:
    Is the table cust_rent_movie an intersection table. Yes. It allows for a many to many relationship between customer and movie, though it would seem that you would want to connect customers to a table with 1 row per physical DVD. That table could then be joined to the title movie table in order to get the title.
    Have I to declare the title and cust_id are foreign keys, the primary key consist of an extra attribute the rent_date.Title is not a good column to use for the primary key, consider adding title_id. Though unlikely, it is possible that the title wil be updated, ie to correct a typo. Currently you will not be able to update it as there mat be dependent transactions. You will want to add a PK for this table, ie cust_movie_pk.
    When a customer rent a movie I want to subtract one from the movie.quantity and when the customer return the movie I want to add one to the movie.quantity subtract from customer.creditIt is usually better to derive values like quantity at run time (or query time) rather than trying to keep a running total of all changes. With appropriate indexes you should be able to quickly calculate that column when required.
    CONSTRAINT phone_unique UNIQUE (phone_number)This will cause a problem for you if you have multiple customers in the same household with the same phone number.

  • 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 select rows in adf faces table

    Hi guys
    im new to adf faces .I created a adf faces table with some data.My task is to select one row and if i click tht row, the data of tht row will be displayed in an input text fileds.How can i select a row in a adf faces table and give actions to rows...i read so many tutorials...none of them didnt give a correct idea....plz help me...
    thanks in advance..
    rajiv

    You're here in the Sun JSF forum, not in the Oracle JSF forum.
    Try here: JDeveloper and ADF
    If the ADF datatable is technically comparable with the RI datatable, check http://balusc.xs4all.nl/srv/dev-jep-dat.html to get some insights how to retrieve the selected row object.

  • How to Create multiple rows in Rich table programatically

    Hello ADF Exparts.
    I am Using below Code to create Rich Table Programatically on Clicking a button but I can't able to Create multiple tables will you please help me to create new row programatically
    public class NewTable {
        private RichInputText txtSearching;
        private RichShowDetailItem resultTab;
        private RichShowDetailItem simpleSearchTab;
        private RichColumn firstColumn;
        private RichOutputText outPutText;
        private String searchString;
        AdfFacesContext ctx=AdfFacesContext.getCurrentInstance();
        Connection conn;
        RichTable table;
        Statement stmt;
        private RichShowDetailItem basicSearchTab;
        private RichTable basicResultTable;
        private RichPanelGroupLayout panelGL;
        public NewTable() {
        public String buttonClicked() {
            // Add event code here...
            //Starrt Creating Table
            table =new RichTable();
            table.setId("demo");
            table.setVisible(true);
            table.setWidth("1024px");
            table.setValue("mat_search");
            table.setVar("Search");
            table.setFilterVisible(true);
            table.setAllDetailsEnabled(true);
            table.setRowKey("0");
            table.setFetchSize(25);
            table.setRows(10);
            table.setRowBandingInterval(0);
            table.setRowSelection("single");
           // table.setHorizontalGridVisible(false);
            //table.setVerticalGridVisible(false);      
            //Start Table Header Text Declaretion and Assignment
            RichOutputText colTextMat_No = new RichOutputText(); 
            colTextMat_No.setValue("Material No ");
            RichOutputText colTextShotDes = new RichOutputText(); 
            colTextShotDes.setValue("Short Description");
            RichOutputText colTextLongDes = new RichOutputText(); 
            colTextLongDes.setValue("Long Description");
            //Start Table Columan Creatin
            RichColumn colMat_No = new RichColumn(); 
            colMat_No.setVisible(true);
            colMat_No.setHeader(colTextMat_No);
            colMat_No.setWidth("100px");  
            colMat_No.setSortProperty("Material No");
            colMat_No.setSortable(true);
            colMat_No.setFilterable(true);
            colMat_No.setSeparateRows(true);
            RichColumn colShotDes = new RichColumn(); 
            colShotDes .setVisible(true);
            colShotDes .setHeader(colTextShotDes);
            colShotDes.setWidth("500px");
            colShotDes.setSortProperty("Short Description");
            colShotDes.setSortable(true);
            colShotDes.setFilterable(true);
            colShotDes.setSeparateRows(true);
            RichColumn colLongDes = new RichColumn(); 
            colLongDes .setVisible(true);
            colLongDes .setHeader(colTextLongDes);
            colLongDes.setWidth("500px");
            colLongDes.setFilterable(true);
            colLongDes.setSeparateRows(true);
            //End Table Columan Creatin
            //Start Creating table Children
            List<UIComponent> tblChild;
            tblChild=table.getChildren();
            //Start adding Columan to Table
            tblChild.add(colMat_No);
            tblChild.add(colShotDes);
            tblChild.add(colLongDes);
           List<UIComponent> displayPanel;
           displayPanel=panelGL.getChildren();
            List<UIComponent> matChild;
            matChild=colMat_No.getChildren();
            RichOutputText rot=new RichOutputText();
            rot.setValue("15000");
            matChild.add(rot);
           displayPanel.add(table);
             System.out.println("RowIndex="+table.getRowIndex());
             System.out.println("Row Count="+table.getRowCount());
            return null;
    Thank you very much

    Maybe you can get some ideas from here -
    http://adfdeveloper.blogspot.com/2011/07/simple-implementation-of-af.html

  • How to create dublicate row in af:table ?

    Hi All,
    In my use case i have to add one custom button name as duplicate just above of af:table where user have option to click that button to create a row in table which contains duplicate value of the current row.
    How would i achieved this scenario
    Please let me know
    Thanks
    Edited by: ADFORCLE on Jan 16, 2012 6:48 PM

    Take a look at the blog post which provides the solution for the use-case:
    http://www.adftips.com/2010/10/adf-model-creating-duplicate-row.html
    Thanks,
    Navaneeth

  • JDEV 10.1.3: Using "Create" binding on BC view object with ADF Faces Table

    Hello,
    I am trying to get this to work, but to no avail:
    I've got a very simple page (ADF Faces - JSPX) created by dragging an iterator from the data control pallete on to my page and picking "ADF Table..." as my chose to create. This creates a table on my page that allows me to edit each row in place. Very nice.
    Now, I dragged the create operation for that iterator on to the page. What I had hoped to see is that when I click "Create," a new blank row appears in my table (well, at least a row that is blank except for any default values specified in the EO/VO and my overriden create() method).
    However, this doesn't happen. The page submits and refreshes, but no blank row shows up. I initially tried setting the Create button to do partial submit and setting the partialtriggers for the table to include the Create button, to no avail. I also tried it without the partial submit with the same results.
    So:
    1). Should this work, or is this behavior a bug.?
    2). If not, is there a different/better way of doing it?
    Regards,
    John

    G'day John
    I think I can give you a hint of what is occuring... I'm still trying to work out what is happening exactly.
    In JDev 10.1.2 UIX, when the user invoked the create action, they would see the blank record added to the underlying table. Under 10.1.3 Faces the functionality is somewhat different.
    When you the user clicks on the create action a blank record is created but not shown in the table control. To prove the blank record is there try this:
    1) Build an ADF Input Form based on the same VO iterator
    2) In your JSF navigation, create a navigation case between the existing page and the new page, and another back again,
    3) In the existing page, map the Create button's action attribute to navigate to the ADF Input Form
    4) In the ADF Input Form, map the Submit button's action attribute to navigate to the ADF Table page.
    Now when you run your app, notice when you create a new record in the ADF Table which automatically takes you to the ADF Input Form, note the blank record, and the details you enter into the record here and submit, are then visible in the ADF Table on the return.
    This is a long way of proving that the new record is in the table. It's just you can't see it.
    I have a theory which I'm trawling through the newly updated documentation to verify. This issues goes back to the VO createRow vs insertRow method calls that have been documented by Steve Muench a couple of times. I'm guessing the table control is now smarter and doesn't show createRow records, only insertRow records.
    Read one of Steve's posts here regards the createRow vs insertRow method calls:
    http://www.oracle.com/technology/products/jdev/tips/muench/blankrow/index.html
    If I find anymore info I'll endeavour to post it.
    Meanwhile this of course doesn't help you if you actually want to show the blank row in the ADF Table editable control, but I'd thought I'd give you an idea of what's happening behind the scenes.
    Hope this helps.
    CM.

  • Creating a LINK in ADF UIX table

    Dear sirs...
    is it possible to create a link for each row in an adf uix table? the link selects the row and forwards to another page.
    i have seen this in a JSP page, but uix????
    best regards

    Dear sirs...
    is it possible to create a link for each row in an adf uix table? the link selects the row and forwards to another page.
    i have seen this in a JSP page, but uix????
    best regards

  • ADF Editable Table : CANNOT Insert Multi Rows , Please hellppppssss

    Hi All,
    Our customer requirement is being able to insert Multi Rows in an Editable Table and submit ALL of them with just one Click ?
    Is it Really Possible ?
    I have tried, even I can insert three Empty Rows and Fill them all with values, when I press Submit ONLY one row will be submitted, the other TWO will become BLANK again, is this my code is wrong ?
    Or this is limitation of ADF Editable Table ?
    Here is my codes, I have tried two ways, all same problem :
    (1) public String create_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("Create");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    public String myCreate_action() {
    create_action();
    create_action();
    create_action();
    return null;
    (2) public String createMultiRows() {
    DCBindingContainer dcbc = (DCBindingContainer)getBindings();
    //get iterator binding
    DCIteratorBinding ib = (DCIteratorBinding)dcbc.get("DeptView1Iterator");
    // get viewobject
    ViewObject vo = ib.getViewObject();
    System.out.println(vo.getCurrentRowIndex());
    vo.clearCache();
    int currentRowIndex = vo.getRowCount() -1;
    Row row1 = vo.createRow();
    row1.setNewRowState(Row.STATUS_NEW);
    vo.insertRowAtRangeIndex(++currentRowIndex, row1);
    Row row2 = vo.createRow();
    row2.setNewRowState(Row.STATUS_NEW);
    vo.insertRow(row2);
    Row row3 = vo.createRow();
    row3.setNewRowState(Row.STATUS_NEW);
    vo.insertRow(row3);
    return null;
    Please help... I am stuck ...
    Thank you very much,
    xtanto

    Xtanto,
    Could you try changing
    bindings.getOperationBinding("Create");to
    bindings.getOperationBinding("CreateInsert");in your first example to see if it fixes your problem?
    Regards,
    John

  • How to create multiple rows in a child table from the multi select Lov

    Hi
    We have Departments and EmployDept and Persons tables and each employee can associate multiple departments and vice versa.While creating a Department page there should be a Multi Select LOV(values from Persons table) with search option for the Persons.From the search panel we can select multiple persons for that department.Suppose we have selected 5 persons and click on submit, then it should create 5 rows in the EmployDept table for 5 persons with that department id.
    Any inputs on how to implement this scenario please..

    Maybe you can get some ideas from here -
    http://adfdeveloper.blogspot.com/2011/07/simple-implementation-of-af.html

Maybe you are looking for

  • Wireless internet, Do i need a card?

    Okay, i've never owned myself a apple computer but i know my fair share on the pc side. I know on a pc laptop you need to have a wireless card to connect to a wireless connection (the little card thingy you stick into the side of a windows laptop). W

  • How to handle Responce in FILE to RFC Scenario

    Hi All, In file to RFC[sync] scenario... Sender side we are using FTP server. Many folders are there .Data is located in folder1 . File adapter picked the data and forwarded it to XI. RFC adapter processes the data.If RFc adapter sends responce , how

  • Replace text with data while viewing

    Hello, I have data in table like below id name 1 tanveer 2 ali khan 3 tasir I want to write a query that display result on my abbreviated vales e.g. tanveer =tan,ali khan=al. so my query result will be id name 1 tan 2 al regards, tanveer

  • Date Object as a key in Hash table

    Hi, I'm having a hash table with date object as key , the purpose is I can pick the value which is available in given date range. Consider the below example Coffee Powder[Code CODE1] - Effective 21-Jan & Expiry 20-Jun Coffee Powder[Code CODE1] - Effe

  • How to Call Precalculated Web Template

    Hi.Buddies:     I created an iView of BW query in portal,and have arranged pre- calculation process.when I call the iview in portal i hide the variables(directly to the result).     I set a button in the Web Application to change period(Selection par