ADF Data Binding : Iteration in child records.

I have the following situation and I cannot find a solution :
I have two view objects, StudentList and CourseList. I have also a View Link "StudentsInCourse", connecting "StudentList" and "CourseList" with cardinality M:N. This connection is exposed in "StudentList" with a property getCourses.
I need to build a page (JSP) to show the student list, and for each student, show the courses they attend to (separeted by comma). Something like :
Student1 Course1, Course2, Course3
Student2 Course1
Student3 Course4, Course5
My first attempt to achieve this was (tags :
c:forEach var="Row" items="${bindings.StudentList.rangeSet}
c:out value="${Row.Studentname}
c:forEach var="CourseRow" items="${Row.courses}
c:out value="${CourseRow.Coursename} ,
/c:forEach
/c:forEach
Well, it didn't work. The iteration doesn`t happen, since the expression ${Row.courses} doesn't appear to be a valid collection. What object is represented by "Row" ? Is that not my ViewRowImpl?
My second attempt was to bind the view link (StudentsInCourse) in the UI Model. So I've put an iterator for it and tried this :
c:forEach var="Row" items="${bindings.StudentList.rangeSet}
c:out value="${Row.Studentname}
c:forEach var="CourseRow" items="${bindings.StudentsInCourse.rangeSet}
c:out value="${CourseRow.Coursename} ,
/c:forEach
/c:forEach
It didn't work, it shows the same course list for all students. I guess this behaviour is expected, since the current row is not changed during iteration.
I guess the possible solution would be invoke the "getCourses" property in StudentListImpl, using EL. Although, I tried several expressions and nothing.
What would be the correct expression to achieve this?
I also read (http://radio.weblogs.com/0118231/2004/07/20.html#a354) that "Tree binding" would be the way to do that, and right now I am trying this path...
thanks,
Daniel Melo

Tree Binding made the task, BUT it broke my application.
I folled the instructions of "Working with Tree Controls in ADF-Enablad Web Pages" in JDev help.
Although, before Step 9, I had to select the Iterator of the master list (in my case StudentsList) in order to the Data Collection Definitions appear.
This step is not described in the document. Is that correct?
It broke my application, because in this same page I had a button to open a form to input data.
I have a binding for "Create" operation in the StudentsList iterator (the master iterator).
The input for page was being requested by a postback pattern :
html:image src="Images/ico_new.gif" property="event_Create" /
When I click this image, I have the error :
JBO-25005: Nome do objeto Courses_1641 do tipo Definicao de Binding de Iterador é inválido
(Sorry for the translated error message. By the way, how can I configure ADF to show original english messages?)
It says something like : "Name of object Courses_1641, of type Iterator binding definition is invalid."
That happens with every submit buttons and the number after courses is random, it changes every time.
Well, I changed the "New" button to a link, like :
a href="#" OnClick="javascript: document.location.href='listStudents.do?event=Create';" img src="Images/ico_new.gif" border="0" /a
And it works like this!
The problem is that I can't change all my buttons in the page to links. I need that some of them as submit buttons.
Kind of tough situation, I guess...
Thanks very much
Daniel Melo

Similar Messages

  • How to handle html:multibox in jsp with ADF Data Binding

    Hi,
    I like to use html:multibox feature in my jsp with ADF Data Binding. I am able to retrieve checked values in the DataForwardAction form. However, when the page is refreshed, the checkboxes are not persistent and yet an error showing
    "JBO-25009: unable to create object type ....oracle.jbo.domain.Array" appears.
    Here is my jsp code:
    <c:forEach var="type" items="${bindings.SystemTypeView1.rangeSet}">
    <c:if test="${Row['SystemGroup'] == type['SystemGroup']}">
    <br>
    <html:multibox property="selectedSystemType">
    <c:out value="${type.SystemType}"/>
    </html:multibox>
    <c:out value="${type.TypeDesc}"/>
    </c:if>
    </c:forEach>
    Can anyone tell me how to handle html:multibox with ADF Data Binding and make the checkboxes persistent.

    Generally this can be done.
    I see a problem with your use case, which has nothing to do with jdev or java:
    How do you identify the user when he comes back to finish the form?
    For this you can't use information like session cookie or IP address because they change.
    So you have to save some information about the user which lets you identify him when he comes back. All other requirements can be implemented by ADF.
    Timo

  • Help for ADF data binding with MySQL BLOB type.

    Hi,
    I have a blob column called photo for table person in my MySQL database, with ADF, I want to bind this column with a JUImage control, but when I drag the column attribute from the data control palete as a JUImage, an error dialog appears, it says:
    Control cannot be bound to that Attribute.
    This control should be bound to an Attribute whose Java type is one of the following
    oracle.ord.im.OrdImageDomain
    oracle.jbo.domain.BlobDomain
    oracle.jbo.domain.Raw
    What should I do ?
    Thanks.

    Hi,
    Are you using BC4J as the persistence layer? If you use your own persistence (e.g. a bean) then you need to make sure the datatype of the atribute is defined as one of the three mentioned in your question.
    Frank

  • Ceating nested table using data binding.

    Hi,
    My requirement is to create a table using ADF data binding where against a value in column 1, there are multiple rows ( in the same row ) in column 2 . Something similar to what we do in excel when we join the 2 horizontal cells.
    I am providing sample table layout below. I have created the backend model to match this but both table and tree not providing what i am looking for. Tree does navigate the model but present this in single column.
    ========================================================================
    Column1 Columns2 Column3
    ========================================================================
    ABC First Data31
    Second Data32
    Data33
    Should i use mange bean to render this ?
    Thanks & regards
    Pankaj.

    Hi Frank i have tried that , my requirement to have the data in different column . Somehow the sample table i put does not display the format correctly , but its like a normal table but the cell with multiple values are merged. I have tried the ADF tree which displays the data but the format is of Tree not of normal table .

  • Programatically retrieve data using iterator in oracle ADF Mobile

    I want to read programatically data using iterator in ADF mobile. My code is :
    try
    ValueExpression vex = AdfmfJavaUtilities.getValueExpression("#{bindings.WeatherDescriptionIterator}", Object.class);
    AmxIteratorBinding iter = (AmxIteratorBinding)vex.getValue(AdfmfJavaUtilities.getAdfELContext());
    GenericType row = null;
    BasicIterator bIter = iter.getIterator();
    iter.getIterator().first();
    ArrayList employees = new ArrayList();
    for(int i = 0; i < iter.getIterator().getTotalRowCount(); i++)
    row = (GenericType)iter.getCurrentRow();
    String phone = "";
    String email = "";
    if(row.getAttribute("Description") != null)
    phone = row.getAttribute("Description").toString();
    if(row.getAttribute("WeatherID") != null)
    email = row.getAttribute("WeatherID").toString();
    setTempValue(phone + " " + email);
    iter.getIterator().next();
    catch(Exception e1)
    AdfException ex = new AdfException(""+e1.getLocalizedMessage(), AdfException.ERROR );
    throw ex;
    I get error :-> cant not find property bindings
    Edited by: user12190920 on May 7, 2013 5:48 AM

    Hi,
    You can try the below code. Make sure the WeatherDescription should be of type Tree binding
    ValueExpression ve1 =
    AdfmfJavaUtilities.getValueExpression("#{bindings.departments.collectionModel}", AmxCollectionModel.class);
    AmxCollectionModel model = (AmxCollectionModel)ve1.getValue(AdfmfJavaUtilities.getAdfELContext());
    Object[] myArr = model.getKeys();
    for (int x = 0; x < myArr.length; x++) {
    Object myObj = myArr[x];
    Map provider = (Map)model.getProviders().get(myObj);
    String deptName = provider.get("deptName").toString();
    Hope this article may help you - http://deepakcs.blogspot.in/2013/02/adf-mobile-iterate-through-all-rows-in.html
    - Deepak

  • Does not delete child records - ADF-BC

    I am using ADF-BC to display data from three tables.
    I have a main view and a two view links to the children. when I try to delete the master record it says - Integrity constraint violated - child record found. And one more thing even though it does not delete the child records it deletes the master record from the view (only form the view, not from the database).
    How can I make it delete the child record first.
    Thanks

    I did the while exercise one more time and it started working. thanks.
    Now I have another problem. I have to keep that commit button on the page. If I delete the comit button from the page it gives me nullpointer exception at the line
    operationBinding = bindings.getOperationBinding("Commit");
    How can I solve this
    Thanks

  • Binding ADF data form fields with column of a table

    Hii All,
    I want to create ADF data form where fields will be in form according to the request parameter of a webservice and all that elemments should be bounded to a table .can any one please tell me how to do that in ADF .I have created the webservie and also able to access it from ADF page ,plz tell me how to configure it so that it will bind it's data with table.
    with regards,
    Deekay.

    Create a WS data control using the WSDL you have.

  • ADF,how to delete parent record and related child record without manual cod

    Hi All,
    I'm using 11g adf.
    I have one parent table PAR and two child table CHD1 , CHD2 respectively.
    I'm inserting values in three tables , making a form having add , delete and edit buttons.
    Issue when i want to delete a record from PAR table , it gives child table record exists . i have did manual coding to delete the child records with related to the selected parent table PAR.
    Is there any process in ADF to delete the child records with respective selected parent record with out manual coding.
    thanks in advance.

    http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcentities.htm#BABHFJFJ
    John

  • How to delete parent table data even though it has child records

    hi all,
    How to delete parent table data even though it has child records.
    ex: delete from pa_request cascade constraints;
    But this command is not working .
    Regards,
    P Prakash

    833560 wrote:
    ex: delete from pa_request cascade constraints;cascade constraints is DROP table option. It can't be used with DELETE. You need to delete child rows first or drop foreign keys and recreate them with ON DELETE CASCADE. Then:
    delete from pa_request will automatically delete child rows. However, personally I don't like ON DELETE CASCADE. You can, by mistake, delete half of your database without even realizing it.
    SY.

  • Manual Data binding with ADF table?

    Hi,
    I am making a stored procedure call for fetching data from database on the click of action button. My query has a where clause in it. I am not able to bind my adf table manually with my data control. Can anyone provide me some link for binding my ADF table with data control manually? My requirement is like : - I have one table in which I am displaying data in ADF table. I want to display data in another table on click of some id in the coulmn of first table.

    You basically have two options - you can choose to use ADF Binding - and have your Java class return a collection - then you just right click the class to expose it as an ADF Data control.
    Or if you rather not use ADF Binding, then you'll need to have a managed bean that returns a collection and you can use "regular" JSF binding to bind the table to it.
    The second option is shown in the ADF Faces Components demo: http://www.oracle.com/technology/products/adf/adffaces/11/doc/demo/adf_faces_rc_demo.html

  • How can i get the id of the last child record in hierarchical data

    I want to get the lastest child record  of the parents like 
    the result   
    If I Select A then the result should be  'C' , 'E' , 'F' , 'G'
    If i select D then the result should be 'F' etc
    Thanks
    USE [SMEDB]
    GO
    /****** Object:  Table [dbo].[Table_3]    Script Date: 11/26/2014 2:10:49 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Table_3](
    [ID] [nvarchar](50) NULL,
    [ParentID] [nvarchar](50) NULL
    ) ON [PRIMARY]
    GO
    INSERT [dbo].[Table_3] ([ID], [ParentID]) VALUES (N'A', NULL)
    INSERT [dbo].[Table_3] ([ID], [ParentID]) VALUES (N'B', N'A')
    INSERT [dbo].[Table_3] ([ID], [ParentID]) VALUES (N'C', N'D')
    INSERT [dbo].[Table_3] ([ID], [ParentID]) VALUES (N'D', N'A')
    INSERT [dbo].[Table_3] ([ID], [ParentID]) VALUES (N'E', N'D')
    INSERT [dbo].[Table_3] ([ID], [ParentID]) VALUES (N'F', N'E')
    INSERT [dbo].[Table_3] ([ID], [ParentID]) VALUES (N'G', N'A')

    WITH cte(ID, ParentID, Lvl, HPath)
    AS (
           SELECT ID,
                  ParentID,
                  0,
                  CAST(ID AS VARCHAR(MAX)) + '\' AS HPath
           FROM   dbo.[Table_3]
           WHERE  ID ='D'
           UNION ALL
           SELECT        e.ID,
                         e.ParentID,
                         m.Lvl + 1 AS Lvl,
                         m.HPath +CAST(e.ID AS VARCHAR(MAX))+ '\'  AS HPath
           FROM          dbo.[Table_3] AS e
           INNER JOIN    cte AS m ON m.ID = e.ParentID
    ),cte1
    AS
    SELECT HPath,id,Parentid,lvl,
    RIGHT(LEFT(HPath,LEN(HPath)-1),CHARINDEX('\',REVERSE(LEFT(HPath,LEN(HPath))))) lst
    FROM   cte WHERE lvl>0
    ) SELECT lst FROM cte1 WHERE NOT EXISTS (SELECT * FROM cte1 c WHERE c.ParentID=cte1.lst)
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • ADF UIX programatic data binding

    Oracle ADF UIX Developer's Guide mentions the possibility to use the UIX framework in Java, to create new objects or alter the existing ones.
    E.g. we can create a table using a construct like:
    TableLayoutBean tlb = new TableLayoutBean();
    The same document demonstrates the data binding:
    BoundValue rows = new DataBoundValue(_YOUR_NAMESPACE, YOURNAME, "rows");
    tlb.setIndexedNodeList(new DataObjectListNodeList(rows));
    For "simple" attributes using DataObject DataObjectList, etc. the procedure is clear. But what about creating a data bound table or input text:
    <table model="${bindings.EmpView1}" ... >
    <messageTextInput model="${bindings.DeptCode}"/>
    It’s easy to understand that model="${bindings.EmpView1}" or model="${bindings.DeptCode}" are equivalent to multiple attribute bindings (data, validation, read-only, etc.), but it looks that the classes/methods resolving these equivalences and linking the bean to the corresponding DCControlBinding, are not public (or maybe I was not able to find them).
    How can we obtain programmatically, in Java, the same structure as described above (in XML)? The best would be to use the same classes used when the UIX XML document is parsed to create the page description.
    It would be very nice to be able to use a structure like
    tbl.setModel( new JUCtrlRangeBinding(...) );
    txt.setModel( new JUCtrlValueBinding(...) );
    or maybe
    txt.setAttribute( "model", new TextInputModelBoundValue(...) ) etc.
    In JSF we can do something like:
    ValueBinding vb = application.createValueBinding(value);
    component.setValueBinding(attributeName, vb);
    Can we do something similar in UIX?
    Any help will be appreciated,
    thanks,
    Mircea Ionita

    Since the code is already written, it's a pity that we can't use/extend it. I don't like to say it (sorry) but I find this design choice (implement the "model" only into the XML parsing layer) a little bit strange (or maybe I don't understand... ;-) ). We should (or we are supposed to) be able to do in java everything that we can do in XML.
    I would like to find more support/help for the programmatic approach. I have the feeling that you are too focalised on "use-our-state-of-the-art-tools/wizards-to-write-the-code-for-you" and you forgot that this is not suitable for all projects. E.g. our application creates the user interface according to a layout defined by each user. To generate it, we need to use at maximum the extension mechanism and we can't simply relay on "rendered" attribute etc.
    -When should we expect this new UIX release?
    -What about the UIX controller? The Struts controller will replace it?
    -What about the source code of uixexp2-demo.jar (distributed with ADF_UIX_component_guide)?
    -Why while debugging we can't set a method/class breakpoint on UIX classes (to understand the data flow) - the stack is secret?
    Thanks

  • Data Binding in ADF UIX example trouble

    Two related questions:
    From the help example 3. Data Binding in ADF UIX example trouble in JDeveloper on UIX. If this worked I was going to run a small java class that captures the login and passes it as a messagebox with a Welcome login name on the first page, but I can't get past the example and path problems.
    From the example..."
    package yourpackage;
    import java.util.Date;
    public class CurrentDateBean
    public CurrentDateBean() { }
    public String getTime()
    return (new Date()).toString();
    Now, we want to change the page so it uses getTime(). We need to do three things: Tell UIX to data bind the text attribute. Add a <dataScope> to the page to provide data to the content. Write a small "data provider" in Java that can access the bean. First, we'll data bind "text": <text xmlns="http://xmlns.oracle.com/uix/ui"
    text="${uix.data.currentDate.time}"/>The example has one small change. The value is changed to ${uix.data.currentDate.time}, which is an expression that defines the data. This is shorthand for "get the time property from currentDate." If you tried running this example, you'd see nothing. That iss because we haven't given currentDate to the page, so the databinding failed, and the "text" is left to null. We do this by adding <dataScope> to the page: <dataScope xmlns="http://xmlns.oracle.com/uix/ui">
    <provider>
    Q#1?? Trying to follow the demo. The method class and method name do not seem to match the names in the above class from the demo. Am I missing a point here, please help.
    <data name="currentDate">
    <method class="yourpackage.DataDemo" method="getCurrentDate"/>
    </data>
    </provider>
    <contents>
    <text text="${uix.data.currentDate.time}"/>
    </contents>
    </dataScope>
    Q#2?? When I try and apply the demo class to my home.uix XML file with
    "<?xml version = '1.0' encoding = 'windows-1252'?>
    <page xmlns="http://xmlns.oracle.com/uix/controller"
    xmlns:ui="http://xmlns.oracle.com/uix/ui"
    xmlns:data="http://xmlns.oracle.com/uix/ui"
    xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
    xmlns:html="http://www.w3.org/TR/REC-html40" expressionLanguage="el">
    <content>
    <dataScope xmlns="http://xmlns.oracle.com/uix/ui">
    <provider>
    <!-- start Add DataProviders (<data> elements) here -->
    <data name="currentDate">
    <method class="us.mn.state.dot.apptrack.security.CurrentDateBean" method="getTime()"/>
    </data>
    <!-- end Add DataProviders (<data> elements) here -->
    </provider>
    <contents>
    <text text="${uix.data.currentDate.time}"/>
    <document>
    <metaContainer>"
    I get the following, and I don't know how to make the UIX XML accept the correct path, please help:
    �file:/C:/JDeveloper905p/jdev/mywork/ProjTrack/AppTrack/ViewController/public_html/home.uix: Parsing error, line 12, column 97: Could not find class us.mn.state.dot.apptrack.security.CurrentDateBean

    for question 1 the name of the class CurrentDateBean
    actually has nothing to do with the el expression
    uix.data.currentDate.time. The currentDate part of the
    el expression is coming from the method data provider part
    of your page:
    <data name="currentDate">
    <method class="yourpackage.DataDemo"
    method="getCurrentDate"/>
    </data>
    so if you changed the name of the data provider to "foo":
    <data name="foo">
    <method class="yourpackage.DataDemo"
    method="getCurrentDate"/>
    </data>
    your el would look like this:
    uix.data.foo.time
    by the way the uix.data part tells UIX to look for
    a <data> element define in the <provider> section of
    your dataScope.
    For question #2, do you have the java file
    us.mn.state.dot.apptrack.security.CurrentDateBean on
    your classpath and is it compiled? You will get that
    warning if it is not on your classpath.
    Also you are incorrectly interpreting the example. What
    you are doing is trying to reference the actual bean
    object and its getTime() method. What you want to do
    is write a method data provider that returns your
    CurrentDataBean. so uix.data.currentDate would return
    a CurrentDateBean instance object. the .time part of the
    el expression would tell UIX to look for a method named
    getTime() and use that value.
    let me know if you have any more questions.

  • "Unable to generate initialization code within Repeater, due to id or data binding on a component that is not a visual child. "

    Error:
    "Unable to generate initialization code within Repeater, due to id or data binding on a component that is not a visual child. "
    Code snippet:
    <mx:Repeater  
    width="100%" height="100%" id="rpp" dataProvider="{loginDataseriesData.series}" >
    <mx:Panel width="100%" title="{rpp.currentItem.@name}">   
    <mx:DataGrid width="100%" dataProvider="{rpp.currentItem.data}" id="loginDataDG" itemClick="loginDataDGClickevent)" sortableColumns="false" draggableColumns="false">   
    <mx:columns>
    <mx:DataGridColumn headerText="Age Group" dataField="@periodValue"/>   
    <mx:DataGridColumn headerText="Year" dataField="@timePeriod"/>   
    <mx:DataGridColumn headerText="Value" dataField="@dataValue"/>   
    <mx:DataGridColumn headerText="User Name" dataField="@userName" editable="false"/>   
    <mx:DataGridColumn headerText="Notes" dataField="@notes"/> 
    </mx:columns>
    </mx:DataGrid>
    Thanks

    <mx:DataGrid
    width="100%" dataProvider="{rpp.currentItem.data}"
    DataGrid indeed not a visual child of your Repeater, since it's visual child is Panel not a Grid

  • Insert child record when user commit parent data

    Hi everybody,
    My use case is an admin users page, where users add new users to application. So they specify user_name, last_name, .....
    I'd need to insert in a child record whose FK is user_name which was introduced by user in the parent table, just in the commit stage.
    How can I achive it? I'm user Jdev 12.1.2
    Regards,
    Jose.

    well leave that example...
    How you commiting the first row.. are using commit operation.Commit in bean using java code like this.
    public static OperationBinding findOperation(String operationName) {
       OperationBinding op = getDCBindingContainer().getOperationBinding("Commit");
       if (op == null) {
          throw new RuntimeException("Operation '" + operationName +"' not found");
       return op;
    . and after this you can get instance of vo of second VO. then create row
    ViewObjectImpl demo1 = am.getEmployeesDemo1();
           Row r2 = demo1.createRow();         // Creates a row in ViewObject
           r2.setAttribute("EmployeeId", 001); // you can set all values
           demo1.insertRow(r2);                //Insert that row in ViewObject
           am.getDBTransaction().commit();     //Commit the changes
           demo1.executeQuery();

Maybe you are looking for

  • Slingbox to TV via Apple TV

    I have a slingbox in the U.S. attached to various media devices. I wanted to use my Apple TV (or another device) to get the video from my computer to my television or even straight to the TV. Sling media is about a year late on their sling catcher de

  • Setup of STS in SAP IP

    Hello Experts, We are working on SAP IP implementation project in which we are using STS (Status tracking system). STS is dependent on hierarchy and setup of STS involves manual efforts for each node. In our system there are close to 5000 cost center

  • PT killer?.....I think so

    Hi, I ordered Logic Studio upgrade from the Apple store yesterday morning, it arrived this morning. It took a couple of hours to install no hitches. Ive been using it for a few hours now, and I cant tell you how happy I am. This program is unbelievab

  • Styling text box of a combobox

    Hi -- I have a comboBox that I am styling using this code: new_style.setStyle("embedFonts",true); new_style.setStyle("fontFamily", "Gibraltar-Plain"); new_style.setStyle("color", 0x653a71); new_style.setStyle("fontSize", 12); new_style.setStyle("roll

  • MacBook Pro name in Router

    In my dLiink router , iphones ipods and 2 PC's show up in he router. My MacBook Pro doesn't. It is listed as "unknown". How can I get the macBook Pro to show up in the router?