ADF Faces Dependent list boxes in an editable table

Hi,
I'm working with JDeveloper 10.1.3.1.0.
I saw the topic "How to build dependent list boxes with ADF II" on F. Nimphius' Blogbuster.
There it is shown how to handle dependent list boxes in an ADF Faces form. I tried this for an editable table but it doesn't work correctly: If there is more than one row in the resultset of the table, both dependent list boxes have the same content in all the rows though the content in the database is different.
Can anyone help me?
Thanks.

Ok - I will try.
I built the listboxes like it is described in "ADF Faces: How to built dependent lists boxes with ADF and ADF Faces Part II", Frank Nimphius' Blogbuster July, 2006.
This is the full code of my ManagedBean:
package asdb.view.backing;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
import oracle.adf.model.OperationBinding;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.adf.view.faces.component.core.input.CoreInputText;
import oracle.binding.BindingContainer;
import oracle.jbo.Row;
import oracle.jbo.ViewObject;
import oracle.jbo.client.Configuration;
import oracle.jbo.uicli.binding.JUCtrlValueBindingRef;
public class AktMitFktEdit {
private BindingContainer bindings;
public AktMitFktEdit() {
public void kategorieWechsel(ValueChangeEvent valueChangeEvent) {
// Add event code here...
BindingContainer bc = this.getBindings();
DCIteratorBinding kategorienIter = (DCIteratorBinding)
bc.get("OrganKategIterator1");
Row rw =
kategorienIter.getRowAtRangeIndex(((Integer)valueChangeEvent.getNewValue()).intValue());
String kategorie = (String)rw.getAttribute("Kategorie");
OperationBinding opBindingOrganeLovIter = (OperationBinding)bc.get("ExecuteWithParams");
opBindingOrganeLovIter.getParamsMap().put("kategorieParam",kategorie);
opBindingOrganeLovIter.execute();
public void setBindings(BindingContainer bindings)
this.bindings = bindings;
public BindingContainer getBindings() {
return bindings;
It works fine, when the user only want to update existing rows. But if he had inserted a new row and afterwards want to update existing rows, the listboxes don't show the correct contents. No error messages are displayed.

Similar Messages

  • Need help with dependent lists boxes with ADF.

    Hello,
    I am doing a project that use tree dependent list boxes.
    Ex. State---->
    College---->
    List of courses of the college chosen above----->
    The way this should work is when I select the state automatically I want it to change to the correspondent list of colleges of that state and after i choose the colleges I want to be able to get all the courses that are given in that college.
    To implement the first two list boxes I create tree views on JDeveloper and and using SelectOneChoice for both State and Colleges. In the binding editor I bind the first View with the second and then the second view with the third and at this point if I execute the first SelectOneChoice would give me all the state and the second SelectOneChoice would give me the list of all the colleges that exist.
    Now on the third view that I create a binding variable and i put a Where state=:TheBindingVariable on the query.
    Also I set the first SelectOneChoice the outoSubmit property to true, id to StateId and PartialTrigger property to CollegeId.
    On pageDef.xml in the bindings I create action form where I select the third view from Date Collection and select Action as ExecuteWithParams. And I set the value under the parameters section to #{bindings.state.inputValue}.
    Under executables still in pageDef.xml I create a invokeAction and I set binds = ExecuteWithParams.
    On first SelectOneChoice on the ChangeValueListener i create a new ManageBeans which generate me a java class and I create a new method as well to use it to change the binding variable on the second SelectOneChoice.
    Here is the method:
    public void Change_StateId(ValueChangeEvent valueChangeEvent) {
    String StateId;
    valueChangeEvent.setPhaseId(PhaseId.INVOKE_APPLICATION);
    FacesContext adi = FacesContext.getCurrentInstance();
    ValueBinding vb = adi.getApplication().createValueBinding("#{bindings}");
    DCBindingContainer bc = (DCBindingContainer)vb.getValue(adi);
    if(valueChangeEvent.getNewValue().toString().equals("0")){
    StateId = "MA";
    OperationBinding opBindingCollegeLovIter = (OperationBinding) bc.get("ExecuteWithParams");
    opBindingCollegeLovIter.getParamsMap().put("TheState",StateId);
    opBindingCollegeLovIter.execute();
    }else{
    DCIteratorBinding statesLovIter = (DCIteratorBinding) bc.get("CollegeProvaView1Iterator");
    Row rw = statesLovIter.getRowAtRangeIndex(((Integer)valueChangeEvent.getNewValue()).intValue());
    StateId = (String) rw.getAttribute("State");
    OperationBinding opBindingCollegeLovIter = (OperationBinding) bc.get("ExecuteWithParams");
    opBindingCollegeLovIter.getParamsMap().put("TheState",StateId);
    opBindingCollegeLovIter.execute();
    I don't know what I have done wrong because I am new in this field and a little support would be really helpful.
    I am using JDeveloper 10.1.3.1.0 and Oracle SOA Suite 10.1.3.1.0.
    I would appreciate any help.
    Thanks a lot.

    user8116089 wrote:
    For some reason the first selectonechoice doesn't give me all the states that are in the database it gives me just the first 10.check the value of RangeSize for itarator in pageDef. in this case to show all items it must be set to -1
    Also there is a way to assign the first value of the first selectonechoice to null at the start.this is a problematic requirement since all items are bound to iterator and basically this should serve for navigation purpose so the first item is set as selected, but maybe some workaround exists...
    regards,
    Branislav

  • Dependent List Boxes

    Can't figure what is wrong with this code. Any ideas? My page
    is blank unless I remove this code. If I remove the below code the
    page shows the form and the list boxes but the last dependent list
    box is not functioning properly...
    <!-- Dynamic Dependent List box Code for *** JavaScript
    *** Server Model //-->
    <script language="JavaScript">
    <!--
    var arrDynaList2 = new Array();
    var arrDL2 = new Array();
    arrDL2[1] = "lmConsumer";
    // Name of parent list box
    arrDL2[2] = "frmAddendum";
    // Name of form containing parent list box
    arrDL2[3] = "lmICPDate";
    // Name of child list box
    arrDL2[4] = "frmAddendum";
    // Name of form containing child list box
    arrDL2[5] = arrDynaList2;
    <%
    var txtDynaListRelation2, txtDynaListLabel2,
    txtDynaListValue2, oDynaListRS2;
    txtDynaListRelation2 = "SID"
    // Name of recordset field relating to parent
    txtDynaListLabel2 = "ICPDate"
    // Name of recordset field for child Item Label
    txtDynaListValue2 = "ICPDate"
    // Name of recordset field for child Value
    oDynaListRS2 =
    rsICPDate
    // Name of child list box recordset
    var varDynaList2 = -1;
    var varMaxWidth = "1";
    var varCheckGroup =
    oDynaListRS2.Fields.Item(txtDynaListRelation2).Value;
    var varCheckLength = 0;
    var varMaxLength = 0;
    while (!oDynaListRS2.EOF){
    if (varCheckGroup !=
    oDynaListRS2.Fields.Item(txtDynaListRelation2).Value) {
    varMaxLength = Math.max(varCheckLength, varMaxLength)
    varCheckLength = 0;
    %>
    arrDynaList2[<%=(varDynaList2+1)%>] =
    "<%=(oDynaListRS2.Fields.Item(txtDynaListRelation2).Value)%>";
    arrDynaList2[<%=(varDynaList2+2)%>] =
    "<%=(oDynaListRS2.Fields.Item(txtDynaListLabel2).Value)%>";
    arrDynaList2[<%=(varDynaList2+3)%>] =
    "<%=(oDynaListRS2.Fields.Item(txtDynaListValue2).Value)%>";
    <%
    if (oDynaListRS2.Fields.Item(txtDynaListLabel2).Value.length
    > varMaxWidth.length) {
    varMaxWidth =
    oDynaListRS2.Fields.Item(txtDynaListLabel2).Value;
    varCheckLength = varCheckLength + 1;
    varDynaList2 = varDynaList2 + 3;
    oDynaListRS2.MoveNext();
    varMaxLength = Math.max(varCheckLength, varMaxLength)
    %>
    //-->
    </script>

    Try something like this:
    <span spry:region="dsStates" id="stateSelector">
    <select spry:repeatchildren="dsStates" name="stateSelect"
    onchange="document.forms[0].citySelect.disabled = true;
    dsStates.setCurrentRowNumber(this.selectedIndex);">
    <option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}"
    value="{name}" selected="selected">{name}</option>
    <option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}"
    value="{name}">{name}</option>
    </select>
    </span>
    City:
    <span spry:region="dsCities" id="citySelector">
    <select spry:repeatchildren="dsCities" id="citySelect"
    name="citySelect" onchange="document.forms[0].schoolSelect.disabled
    = true; dsCities.setCurrentRowNumber(this.selectedIndex);">
    <option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}"
    value="{name}" selected="selected">{name}</option>
    <option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}"
    value="{name}">{name}</option>
    </select>
    </span>
    <span spry:region="dsSchools" id="schoolSelector">
    <select spry:repeatchildren="dsSchools" id="schoolSelect"
    name="schoolSelect" onchange="window.location=this.value;">
    <option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}"
    value="{url}" selected="selected">{name}</option>
    <option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}"
    value="{url}">{name}</option>
    </select>
    --== Kin ==--

  • How-to create dependent list boxes in a table -Frank Sample

    hi everyone i would like to ask a suggestion about Frank's example on How-to create dependent list boxes in a table -Frank Sample ...
    i want to extend this example for 3 dependent lists... including locations, departaments and employes....
    this the ListboxBean java that Frank is using in his example.... and this is only for locations and departaments tables and it works ok... i want to add the third list for employers wich is dependent only from departaments list.... as i am not good in java i would like to ask u a suggestion on how to develop the third list in this java class ...
    public class ListboxBean {
    private SelectItem[] locationsSelectItems = null;
    private SelectItem[] departmentsSelectItems = null;
    public SelectItem[] getLocationsSelectItems() {
    if (locationsSelectItems == null){
    FacesContext fctx = FacesContext.getCurrentInstance();
    ValueBinding vbinding = fctx.getApplication().createValueBinding("#{bindings.LocationsView1Iterator}");
    DCIteratorBinding locationsIterBinding = (DCIteratorBinding) vbinding.getValue(fctx);
    locationsIterBinding.executeQuery();
    Row[] locRowsArray = locationsIterBinding.getAllRowsInRange();
    // define select items
    locationsSelectItems = new SelectItem[locRowsArray.length];
    for (int indx = 0; indx < locRowsArray.length; indx++) {
    SelectItem addItem = new SelectItem();
    addItem.setLabel((String)locRowsArray[indx].getAttribute("City"));
    addItem.setValue(locRowsArray[indx].getAttribute("LocationId"));
    locationsSelectItems[indx] = addItem;
    return locationsSelectItems;
    return locationsSelectItems;
    public SelectItem[] getDepartmentsSelectItems() {
    FacesContext fctx = FacesContext.getCurrentInstance();
    ValueBinding vbinding = fctx.getApplication().createValueBinding("#{row}");
    JUCtrlValueBindingRef rwJUCtrlValueBinding = (JUCtrlValueBindingRef) vbinding.getValue(fctx);
    Row rw = rwJUCtrlValueBinding.getRow();
    if (rw.getAttribute(6) != null){
    OperationBinding oBinding = (OperationBinding) fctx.getApplication().createValueBinding("#{bindings.ExecuteWithParams}").getValue(fctx);
    oBinding.getParamsMap().put("locId",rw.getAttribute(6).toString());
    oBinding.execute();
    ValueBinding vbinding2 = fctx.getApplication().createValueBinding("#{bindings.DepartmentsView2Iterator}");
    DCIteratorBinding departmentsIterBinding = (DCIteratorBinding) vbinding2.getValue(fctx);
    departmentsIterBinding.executeQuery();
    Row[] depRowsArray = departmentsIterBinding.getAllRowsInRange();
    // define select items
    departmentsSelectItems = new SelectItem[depRowsArray.length];
    for (int indx = 0; indx < depRowsArray.length; indx++) {
    SelectItem addItem = new SelectItem();
    addItem.setLabel((String)depRowsArray[indx].getAttribute("DepartmentName"));
    addItem.setValue(depRowsArray[indx].getAttribute("DepartmentId"));
    departmentsSelectItems[indx] = addItem;
    return departmentsSelectItems;
    public void setLocationsSelectItems(SelectItem[] locationsSelectItems) {
    this.locationsSelectItems = locationsSelectItems;
    public void setDepartmentsSelectItems(SelectItem[] departmentsSelectItems) {
    this.departmentsSelectItems = departmentsSelectItems;
    Thanks in advance :0

    Hi,
    I think that all you need to do is to look at how I implemented the dependent detail for querying the Employees select items
    Then you make sure the DepartmentsVO and the EmployeesVO have bind variable to query them according to the pre-selected value in their respective master list
    Frank

  • Reg: ADF Select One List box..

    Hi,
    I have a view object which is associated with application module.
    I am dragging onto the form as Select one List box. In the list binding Editor , I have only one data source. When I am trying to specify the Base data source attribute and list datasource attribute , it gives an error
    "Base Data Source and List Data Source Cannot Be bound to the same view"
    and am selecting the Display attribute as "multiple"
    Please Help
    Thanks.

    Hi,
    the base data source is where the selected data is written to. The display data source is from where you get the list data.
    You need to have at least two VO for this to work. Next to the display data source there is a button you press to create an iterator binding for the list VO.
    Frank

  • Multiselect dependant list box based on the database

    i have to develop the jsp page with set of 3 list box which should display a field of a table. Based on the event over the list box1 listbox2 should be updated based on the selected item. For example when u click india on the list box 1 it should display all the states of india in the listbox two. Since it is multiselect when u choose pakistan the list box2 should display the states of india and pakistan.
    This is my prob i am struggling for this for a long while please help me to solve the problem.
    Thanks in advance.
    I want to complete it before today evening i am also new to the jsp please help me...............

    double post http://forum.java.sun.com/thread.jspa?threadID=659520&tstart=0

  • Reg:- How-to build dependent lists boxes with ADF and Faces(Frank.Nimphius)

    Hi,
    by using this i try to create a parent child relationfor selectonechice box and table.
    this is woking properly but as i start selecting values in SelectOneChice Box, value in tabel are seems to be Disappears.
    even i create navigation list and map them properly..
    please suggest me about this.
    Regards:-
    Bkumar

    Thanks for reply...
    but this is not one that i wants...<< Need to create Depandent selectOnechoice and table Adf page>>
    i created one parent SelectOneChoice list having some values, and one child tabel for there values. Navigation List.even i checked Auto Submit and Id for parent, and Partial triger for Child.
    When irun this application the values are not coming properly.
    please help me about this.

  • ADF BC + ADF Faces + Intermedia + lists

    Hello,
    I reported a bug a while back on metalink concerning the rendering of Intermedia objects in lists (tables for example).
    My needs are common use cases : display thumbnails of Intermedia OrdImage objects or provide links to OrdDoc objects in tables...
    I'd like to know if some (Oracle) experts can provide a workaround for this because i can't wait any longer to have this functionnality implemented.
    Any help would be appreciated.
    Thanks
    Seb.
    Message was edited by:
    sebnoumeaDTSI

    Hello,
    I reported a bug a while back on metalink concerning the rendering of Intermedia objects in lists (tables for example).
    My needs are common use cases : display thumbnails of Intermedia OrdImage objects or provide links to OrdDoc objects in tables...
    I'd like to know if some (Oracle) experts can provide a workaround for this because i can't wait any longer to have this functionnality implemented.
    Any help would be appreciated.
    Thanks
    Seb.
    Message was edited by:
    sebnoumeaDTSI

  • JDeveloper 10g, ADF Faces & BC: List Binding Editor Bug?

    This problem comes up quite frequently, we have a form based on an entity based vo, one of the attributes is based on a read only list vo. When using the List Binding Editor to generate the jsp/pageDef code, the attributes do not show up in the "matching" pane.
    http://i108.photobucket.com/albums/n23/zeoneozero/error.gif
    We end up having to use the AM that is not nested to get the List Binding Editor to recognize the attributes, but then we need to manually go into the pageDef and add the RootAM reference. Anyone come across this?

    Hi,
    you don't mention a JDeveloper version. If you are not on a recent version, can you try one. If it reproduces, please provide steps required for a reproducible test case
    Frank

  • ADF Faces 10g: How to empty an af:table component?

    Hi,
    I am using JDeveloper/ADF 10.1.3.
    I have a page with 2 iterators on the same view (one always in search mode), a search form and a table for results. As there are a lot of rows in the view and I don't want to query it without search criteria to avoid getting all the results, I set the iterator's refresh property to ${adfFacesContext.postback==true}.
    I made a Search button binding the Execute action and a Reset button binding the Find action. Now, when I hit the Reset button, I also want to reset the table (the query results) to empty. How to do that? I could not find any method to empty the rowset, neither at table lavel, nor at iterator, nor at view.
    Thanks in advance for your replies.

    Hi,
    I don't have a declarative solution for you, but some possible solutions or ideas to do it.
    1. put a method in the application module end expose the method to the client (data control). This method can either remove all rows from the VO (call removeCurrentRowFromCollection() for each row currently in the VO but keep them in the DB).
    2. you can try to use executeEmptyRowSet() (I'm not sure it's available in 10.1.3) and hope that it removes all rows from the row set (the method is not documented, so I'm olny guessing it's function).
    3. execute your search with parameters you are sure they will not return any result. This can be done from a backing bean.
    Timo

  • Difference between dependent list of values in table and form

    Hi ,
    Is implementing dependent lov in editable table i.e. in adf table different from implementing the same in an adf form.
    In one of his posts Frank Nimohius mentioned that he can send us the implemented application for dependent list of values in editable table, if he reads this could you please send me the same.
    Has anybody ever implemented depedent list in adf table.
    Thanks and regards,
    Raksha
    Edited by: Raksha Sharma on 7 Jun, 2009 2:48 PM

    Hi,
    its already online: http://thepeninsulasedge.com/frank_nimphius/2008/04/08/adf-faces-building-adf-dependent-list-boxes-in-adf-faces-table/
    Frank

  • [adf faces] selectonechoice autosubmit problem

    hello
    i am trying to make a adf faces website, but i have 2 dropdownlists in an overview page
    the first dropdownlist (af:selectonechoice) contains the YEAR
    the second dropdownlist (af:selectonechoice) containts the WEEKS IN THAT YEAR
    the weeks have to be drawn from the database, by using the managed bean "filterBean"
    somehow at this moment i can only get the weeks inside the second dropdownlist by clickin on a commandbutton. the autosubmit from the first dropdownlist doesn't do shit...
    even with partialtriggers it won't work right
    can anybody give me a working example in which a dropdownlist updates another dropdownlist?
    thanks in advance!

    Hi,
    2-minute googling gave these examples:
    "ADF Faces: Building ADF dependent list boxes in ADF Faces table" at http://thepeninsulasedge.com/frank_nimphius/2008/04/08/adf-faces-building-adf-dependent-list-boxes-in-adf-faces-table/
    "62. Cascading Lists in JSF" at http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
    "Three Dependent List Boxes in af:table Component" at http://andrejusb.blogspot.com/2007/08/three-dependent-list-boxes-in-aftable.html
    "Implementing dependent select boxes in JSF" at http://www.it-eye.nl/weblog/2006/04/04/implementing-dependent-select-boxes-in-jsf/
    "ADF Learning 6 - Dependent List Boxes" at http://www.scribd.com/doc/2633296/ADF-Learning-6-Dependent-List-Boxes
    HTH,
    Patrik

  • Required Dependent List of Values in Reports Parameter Form

    Dear All,
    These days I am facing a problem in Oracle Reports(ver. 2.5). I have develope a report. In the parameter form of this report, I want a list of value (LOV) on the second field which should be dependent on the first field value.
    For Example, In The Employee Details report, I have a Parameter form in which there are 2 Parameter fields, 1 is Deptno and the other is Empno. I want to attach a LOV on the Empno field but in this LOV I want to display only those empno's which should be dependent on the Deptno field.
    Thanks
    Vipin

    Hi,
    its already online: http://thepeninsulasedge.com/frank_nimphius/2008/04/08/adf-faces-building-adf-dependent-list-boxes-in-adf-faces-table/
    Frank

  • Possibility & Drawback  Using JDeveloper 11g ADF Faces with Oracle 10g DB

    We are new to ADF Faces, would like to use JDeveloper 11g ADF Faces with Oracle 10g database (Enterprise Edition). As we are new to JDeveloper 11g ADF BC, so we want to know about the Possibility & the Drawback.
    Edited by: eng.shahed on Apr 5, 2010 11:21 AM

    i dont think so any drawbacks using Jdeveloper with any database.....its a open product ... You can use it with Sybase, MySQL, Oracle etc etc..

  • ADF Faces components with HTML and DIV tags

    Hello all,
    I want to know if there a way to place a <div> tag within an adf faces component tag? eg. <af:table> tag and insert the div tag between </af:column>? I tried doing this by placing the div tag between columns and also enclosing it with verbatim tags, but a parsing exception occurs during run time. The purpose of this is to create frozen columns for horizontal scrolling.
    The code looks like:
    <af:table ...>
    <af:column headerText= ...>
    <f:facet name= ...>
    <h:outputText value= .../>
    </f:facet>
    </af:column>
    <f:verbatim>
    //DIV TAG
    </f:verbatim>
    <af:column headerText= ...>
    <f:facet name= ...>
    <h:outputText value= .../>
    </f:facet>
    </af:column>
    <af:column headerText= ...>
    <f:facet name= ...>
    <h:outputText value= .../>
    </f:facet>
    </af:column>
    <f:verbatim>
    //END DIV TAG
    </f:verbatim>
    </af:table>
    Thanks in advance.
    -Wes
    Message was edited by:
    zeoneozero

    repost
    -

Maybe you are looking for

  • Full screen mode in AE

    Hello, I have a problem finding the key for fullscreen mode in After Effects. I know that "it's just to hit the telda key", but I'm not on a american keyboard. I'm on a macbook pro with a norwegian keyboard.. does anyone know the key for fullscreen m

  • Can't find Pixel Bender in CS5

    Sorry if this item has been discussed before, but After installing Pixel Bender (via the Extension Manager) I can't find it under the Filter menu. My system meets the requirements, my video card drivers are up tp date, The Photoshop CS 5 Extended ver

  • How can I delete a cost element group

    Hy, I have a new system and the cost elements groups came with the questionary. Now I want to delete them, but I have an error like : "You want to delete object (Group element cost BON_1000). This is not possible because the object is being used in a

  • Updated to ios8 and when asked to type in password to finish setting up iCloud, it resets every time

    I Updated to iOS 8. It says welcome I swipe it. It then prompts me to type in my password to finish seating up iCloud. I type in my password and it resets to the beginning. If I select skip this step it does the same thing.

  • ITunes won't let me select my Denon Receiver via Airplay

    When clicking on the airplay button on my iTunes, I can see my Denon Receiver, but when I select the receiver, iTunes tries to connect but it can't make the connection.  I have rebooted my MacBook and my receiver is successfully downloading Internet