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

Similar Messages

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

  • My MacBook Pro recently shut down on me all of a sudden. When I restarted it, it popped up with a gray box with 'OS X Utilities,' then listed various options such as 1. restore from time machine backup, 2. reinstall OS X, etc. what do I do now?

    My MacBook Pro recently shut down on me all of a sudden. When I restarted it, it popped up with a gray box with 'OS X Utilities,' then listed various options such as 1. restore from time machine backup, 2. reinstall OS X, 3. get help online and 4. disk utility. what do I do now? I have not backed up to Time Machine in a few days, so I'm not sure I should restore from time machine backup, is there something else I can do? Help!

    Guitar21,
    your MacBook Pro has booted into its Recovery mode. From the OS X Utilities menu, select Disk Utility. On the left-hand side of the Disk Utility window, select your internal disk’s boot partition (typically called “Macintosh HD”). On the right-hand side, press the Verify Disk button if it’s not greyed out; if it is greyed out, or if it reports that errors were found, press the Repair Disk button. Once the verification/repair is completed, exit Disk Utility and select Restart from the Apple menu to restart in normal mode. Does it get to the login screen now?

  • How to add a list box with values for a ztable in SM30

    Hello Gurus,
                    I had created a table maintenance for Ztable and added many extra functionality to that. Now i would like to add a list box or check table for a field. Can i do that with out Regenerating my table maintenance. Please help me its..very urgent.

    Have referred this domain to the data element, this should be the Field type in ur table for the particular field.
    Eg: <b>SE11 > table name > fields-ZTEST > fieldtype-ZZTEST</b>
    ZZTEST in the data element > create a domain for this data element and in that specify teh value range.
    Save and activate it.
    Make sure that u regenerate teh table maintenance generator else u cant see the changes.
    Now if u press F4 u can see only thevalues specified, also u will see only the list box with values in SM30.
    Try this,please let me know if u face any difficulties.

  • Spawning pages from entries in a list box with entry text as title

    The background: I have a form with a list box which a user can populate with their own text via a text box and an 'add' button. This works fine.
    I've just added a template page with different content and 'spawn' button. This also works fine.
    The task: What I want to be able to do is use the entries in the list box from page 1 to spawn the same number of pages as entries and also populate a field in each newly spawned page with the name of the corresponding entry (to act as a title).
    How do I go about coding this?
    Current spawn code:
    var t = this.templates;
    var T = t[0];
    var XO = T.spawn(this.numPages, false, false);
    for (var i=0; i<m; i++) T.spawn(this.numPages, false, false, XO);

    This script will spawn pages depending on the number of items in myComboBox:
         var f = this.getField("myComboBox");
         var expTplt = getTemplate("tpltExpenses");
         for (var i=0; i<f.numItems; i++){
         expTplt.spawn(this.numPages,true,false);
    I'm not sure how to auto fill the text fields on the spawned pages though.

  • "Dynamic List Box with Single Selection" Survey Suite in CRM 6.0

    Hi
    I am using CRM 6.0. There in Survey Suite there are 2 answering options "Dynamic List Box with Single Selection" & "Dynamic List Box with Multiple Selection". I am able to make out, how we can assign values to this. I have seen example "Example_Dynamic_survey" also.
    I believe we have to use programming for populating this. But how do we have to carry that out.
    Thanx and Regards
    Hitesh

    Hi Hitesh,
    There is no need of programming for populating values for Answer category 'List Box with Single Selection' or 'List Box with Multiple Selection'. You have to follow the following steps to populate values for those:
    - In the Answer Category select List Box with Single Selection from drop down list
    - Then on left hand side tree, right click on Answer and select Insert Answer Option (Answer->Insert Answer Option)
    - Then on right side, provide Text for the answer (value)
    - To add more values, repeat the process Answer->Insert Answer Option and providing text for those answers in the right side.
    Similarly you can populate values for 'List Box with Multiple Selection' also.
    This has to be done in the transaction CRM_SURVEY_SUITE.
    Hope this is clear to you
    regards
    Srikantan

  • Selection screen list box with run time values

    Hi,
    I have to create a selection screen list box with with values at run time.
    This is actually for a maintanence view.
    Please help.
    Thanks
    Vimalraj

    Have a search in SDN and elsewhere for the function module 'VRM_SET_VALUES'... for example there's one at:
    Re: Listbox with Function code in Table control
    wherein the 2nd listbox contents are driven from the option selected in the first listbox.
    Jonathan

  • I need help Centering a div box to a background image using dreamweaver cs5.5.

    I need help Centering a div box to a background image using dreamweaver cs5.5. Everything shift left when viewing on different size monitors?  See what I mean at
    www.woodlandhospice.com

    Have you looked at your page with images disabled?
    I urge you to re-think this approach to web design because images of text are not indexed by search engines, screen readers or translators.  Given the demographic group your site is targeting, you really need to ensure maximum web accessibility for all users.
    Navigation, headings and descriptions all need to be in real text -- not images of text.
    Ken is right.  Absolute positioning is pure poison for such a simple layout.  My advice is to start over with one of the pre-built Starter Pages in DW.  Go to File > New > Blank page > HTML.  Select a layout from the 3rd column and hit CREATE button.
    Nancy O.

  • Need Help, retrieving a combo boxes actual/print/visible value instead of the export value.

    Hello,
    I need help, retrieving a combo boxes actual value, not the export value.
    I have a combo box with multiple options to select from.
    each of those selections has a separate export value, which is in the form of a number, which I use to calculate dates in a separate field.
    However, I have another field that i want to retrieve the, users selected value, which is text, from the combo box instead of the export value.
    Is there an easy way to do this.
    This is what I am currently using. But like I said the results are that I retrieve the export value and not the selected text value.
    event.value = this.getField("_Arugula").valueAsString;
    Thanks

    First get the currentValueIndices property of the combo box and use it with the getItemAt field method to return (what I call) the display value. Something like:
    var f = getField("combo1");
    var display_value = f.getItemAt(f.currentValueIndices, false);
    See the documentation for more information

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

  • Site Definition with Custom List Intance with Custom fields

    How to create VS 2012 > Site Definition with Custom List Instance with Custom fields?
    <site>
    <list>
    <field>

    Hi Sunil,
    it is the same way we create in VS 2010.
    Add a new empty SP project in VS2012 and then add, site, list and fields as per your requirement.
    Here are few references-
    Creating SharePoint 2010 Site Definitions in Visual Studio 2010
    http://msdn.microsoft.com/en-us/library/gg276356(v=office.14).aspx
    Creating SharePoint 2010 List Definitions in Visual Studio 2010
    http://msdn.microsoft.com/en-us/library/gg276355(v=office.14).aspx
    Walkthrough: Create a Basic Site Definition Project
    http://msdn.microsoft.com/en-us/library/ee231583.aspx
    and  I normally create a blank site with all required configuration and then create, import the template to hand craft the list and fields. this would minimize errors.
    see the below blog on this topic
    http://blogs.msdn.com/b/sambetts/archive/2013/10/17/creating-a-clean-visual-studio-solution-from-a-sharepoint-2013-site-template.aspx
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if the reply helps you

  • 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

  • My camera roll pictures are gone and I'm left with a gray box with jpg in it.

    my camera roll pictures are gone and I'm left with a gray box with jpg in it.

    Guitar21,
    your MacBook Pro has booted into its Recovery mode. From the OS X Utilities menu, select Disk Utility. On the left-hand side of the Disk Utility window, select your internal disk’s boot partition (typically called “Macintosh HD”). On the right-hand side, press the Verify Disk button if it’s not greyed out; if it is greyed out, or if it reports that errors were found, press the Repair Disk button. Once the verification/repair is completed, exit Disk Utility and select Restart from the Apple menu to restart in normal mode. Does it get to the login screen now?

  • PopUp with selectMany List Box in JSF

    Hi,
    am a newbie to JSF....
    I have a page with a hyperlink which opens a popup that has two multi select list boxes (values need to be moved to and fro within select boxes). Then i have a select button in the popup which should send the selected value from popup to main page. Can anyone please send me a clear implementation for this I don't know how to implement this with JSF. I do want to know how should i have the in my main page to populate the selected values from popup. This will be of great help if u could provide me in detail for implementing the scenario.
    Note: My popUp page Implementation is like the one below and i don't have main page implementation other than the link calling javascript to open the popup....
    <body><table>< tr></tr><tr>< td>
    <h:selectManyListbox id="masterList" size="6">
    <f:selectItems id="master" value="#{populateList.masterList}" />
    </
    h:selectManyListbox></td>< td><table><tr>
    <
    h:commandButton id="MoveRight" value="MoveRight" ></h:commandButton >
    </
    tr><tr>
    <
    h:commandButton id="MoveLeft" value="MoveLeft" ></h:commandButton >
    </
    tr></table></ td><td>
    <
    h:selectManyListbox id="selectList" value="#{populateList.selectList}" size="6" > <f:selectItems id="select" />
    </
    h:selectManyListbox>
    </
    td></tr>< tr></tr><tr></ tr><tr>
    <h:commandButton id="selectButton" value="Select"></h:commandButton >
    </tr></table></body >

    any updates or help for this....
    i have a link in my main page that pops up a window with two select many list boxes where values can be moved to and fro. popup has a select button that has to send the list values in right hand side select many list box to the main page field....
    How should i achieve this in jsf....
    Any help with codelines will be greatful and guiding....
    Thanks
    Naadiya

Maybe you are looking for