Faces: programmatically creating and populating iterator in a backing bean?

Rather than relying on bindings in pageDefs, I'm attempting to create and populate a JUIterator binding in a backing bean. The goal is to allow the backing bean accessible to any web page as a session bean without having to hard code the iterator in every page's pageDef file.
I haven't had any success on finding a demonstration showing how to do this programmatically and have come up with the following code as a hack:
DCDataControl dataControl = bindingContainer.findDataControl("AppModuleDataControl");
ApplicationModule appModule = dataControl.getApplicationModule();
JUIteratorBinding iterator = new JUIteratorBinding(appModule, "SingleRowView1", "SingleRowView1Iterator");
bindingContainer.addIteratorBinding(iterator);
iterator.setRangeStart(0); // Exception raised here
iterator.setRangeSize(1); // Or here
iterator.executeQuery();  // Or here
Row row = iterator.getCurrentRow();Note the SingleRowView1 is a VO exposed through my ADF BC AppModule and returns a single row and column.
At the appropriate line marked "Exception raised here" an exception is thrown. On this line and the next 2 lines, it doesn't matter if I comment out one or the other, any 3 will raise an exception showing I've a problem with the iterator setup I guess?
Anybody any hints on how we would construct the iterator dynamically? Do I have to create the individual attributes for the iterator? Have I not done something in correctly creating the iterator?
Any help appreciated.
Regards,
CM.

Chris,
I don't have an answer for you but in JDeveloper 11 templating allows you to create a pagedef file that then is inherited by all pages. So chances are that what you build today is no longer needed tomorrow
Frank

Similar Messages

  • Query on Creating and Populating I$ table on different condition

    Hi,
    I have a query on creating and populating I$ table on different condition.In which condition the I$ table is created??And These condition are mentioned below:
    1)*source and staging area* are on same server(i.e target is on another server)
    2)*staging area and Target* are on same server(i.e source is on another server)
    3)*source,staging area and Target* are on *3 different* server
    4)source,staging area and Target are on same server
    Thanks

    I am not very much clear about your question. Still trying my best to clear it out.
    In your all above requirement I$ table will be created.
    If staging same as target ( One database,one user) then all temp tables will be created under this user
    If staging is different than target ( One database,two user (A,B)) then all temp tables will be created under this user A (lets consider) and data will be inserted to the target table that is present in user B
    If staging is different than target ( Two database,two user (A1,A2), not recommended architecture) then all temp tables will be created under this user A1 (database A1) and data will be inserted to the target table that is present in user A2 (database A2)
    If source,staging,target will under one database then No LKM is required,IKM is sufficient to load the data into target. Specifically for this you can see one example given by Craig.
    http://s3.amazonaws.com/Ora/ODI-Simple_SELECT_and_INSERT-interface.swf
    Thanks.

  • How to Programmatically Create and Activate an ABAP Class

    Hi,
    I have a requirement to programmatically create and activate an ABAP class that implements a 'pre-defined' interface.
    Do you have any ideas how this can be done?
    Thanks,
    Shreevathsa S

    Hi,
       Try if GENRATE SUBROUTINE POOL keyword can be of your help.
    See the below example,
    DATA itab  TYPE TABLE OF string.
    DATA prog  TYPE string.
    DATA class TYPE string.
    APPEND `program.`                     TO itab.
    APPEND `class main definition.`       TO itab.
    APPEND `  public section.`            TO itab.
    APPEND `    class-methods meth.`      TO itab.
    APPEND `endclass.`                    TO itab.
    APPEND `class main implementation.`   TO itab.
    APPEND `  method meth.`               TO itab.
    APPEND `    message 'Test' type 'I'.` TO itab.
    APPEND `  endmethod.`                 TO itab.
    APPEND `endclass.`                    TO itab.
    GENERATE SUBROUTINE POOL itab NAME prog.
    CONCATENATE `\PROGRAM=` prog `\CLASS=MAIN` INTO class.
    CALL METHOD (class)=>meth.
    Regards,
    Sesh

  • Programmatically create and deploy process definition

    1. It seems that PAPI does not support process definition creation and deployment. We need to programmatically create and deploy process definitions, what should we use?
    2. Is it possible to programmatically add variable definitions to a process instance? We have an external program that creates the process instance but sometimes the process instance may need to add some additional variables.
    Thank you for your help,
    shirley

    Hi Shirley,
    You're right PAPI wasn't intended to deploy processes, however, you can deploy processes automatically using ANT.
    You'd need to republish and redeploy (again using ANT) to add additional variables to a deployed process. Simplest thing to do would be to add attributes to an existing BPM Object. If you just added a new variable, you'd need to change argument mapping troughout the project.
    hth,
    Dan

  • How to get specific rows from the vo or Iterator in the backing bean?

    Hi,
    I have to get the specific number of rows from iterator in the backing bean. means i want to get the records from the VO or Iterator only from 5 th record to 10th record its like rownum in SQL.
    We can use rownum in VO sql query. but there would be a performance issue with that ...
    SO i am trying to get the rows from ADF Iterator once we fetch from DB.
    Is it possible to do that ?
    Do we have any way to set the pointer to the VO/Iterator like setFirst() and after that setMaxResult to retrun the rows between first and maxresult..
    Thanks

    If this is for pagination, then af:table offers pagination by design when you set accessmode=RangePaging or RangePagingIncremental in VO. Paginated queries are fired when scroll down in the table. Explore this option before you try out any custom solution
    To answer the question,
    Note: same logic i have implpemented ADF with EJB ..In EJB Query class we have setFirst(int) and setMaxResult(int) methods...simply i did setFirst(30) and setMaxResult(10)..It worked fine...Theoretically speaking the same can be achieved by setting setRangeStart() on the viewobject(which in turn sets to the default rowset) and by setting max fetch size on VO + accessmode=RangePaging. However when you use table with ADF binding, these will be overridden by the binding layer. If you are not using ADF binding, then the above is same as what you did for JPA entity. Other option is, you build expert mode VO with rownum for this special case, which will work if you dont need to set accessmode=RangePaging for VO.

  • How do I programmatically create and save an empty project?

    I can programmatically create an empty project, but when I drop an
    invoke node on the project, select "Save", and wire in the desired
    path, it results in an "Error 1".  I am getting the error on the "Save"
    invoke node (An input parameter is invalid.)  The only input is the
    path, which is correct.  What am I doing wrong?  Also, how can I
    specify a name for the project?
    Greg

    I think the problem is that you use the current path and strip off the path the current VI's name.  This leaves you with a path that has no filename to save it to.  Put in a build path after it where you build in a project name with a .lvproj extension.  When I did that, the error went away.
    Message Edited by Ravens Fan on 08-08-2007 11:36 PM
    Attachments:
    Create%20and%20Save%20New%20Project[1].png ‏4 KB

  • How can I programmatically create and use a global variable?

    I have an app where the number of AI DAQmx tasks I create are specified in a config file.  I have a monitor task that periodically looks at the latest values from all DAQ tasks.  I've been doing this with a set of global variables because it was the simplest way to do it.  But to do this, I have to explicitly create a separate AI task that uses the hard-coded global variable name for the DAQmx samples.  I would prefer to only write one VI for the DAQ loop that writes to a global variable that I programmatically create based on the config file.  The only solution I can think of is to use a global variable "pool" that is sized bigger than I expect to need, and then have a big switch case to select which one I want based on the task index.  But this sounds pretty silly.

    I tend to agree with Ben. I don't buy the concept of taking the asy way out (globals) because it very rarely will things remain static. You almost always have to extend the features and functionality of an application and then you will run into issues with sloppy and lazy implementations. The solutions offered may require a little time to learn but once you do it doesn't really require any extra effort.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Creating and deploying ejb 3.0 session bean with annotated pojo

    I try to create and deploy a EJB 3.0 stateless session bean (and associated webservice) with the following steps:
    1) Create Interface "Repository"
    package de.xxx.config;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    @WebService
    public interface Repository extends Remote {
         @WebMethod(operationName = "findCampaignByChannel")
         public String findCampaignByChannel(String channelName) throws RemoteException;
    2) create dummy "RepositoryImpl"
    package de.xxx.config;
    import java.rmi.RemoteException;
    import javax.ejb.Stateless;
    import javax.jws.WebService;
    @WebService(endpointInterface="de.xxx.config.Repository")
    @Stateless
    public class RepositoryImpl implements Repository {
         public String findCampaignByChannel(String channelName) throws RemoteException {
              return null;
    3) The two class files are packaged into a jar without any further descriptors
    4) The jar is deployed with admin_client into the oc4j instance using the commands:
    -deploy -file <jarfile> -deploymentName <name>
    Result:
    An ear was constructed and started but no session bean or webservice is found (using the console). But according to to the docs a jar file without a ejb-jar.xml should be recognized as a EJB 3.0 ejb-jar file and the necessary steps to create session bean and expose webservice should be done automatically.
    My question:
    Which step do i miss here ?
    Tools used:
    Eclipse 3.2 for the jar file
    SoaSuite 10.1.3.1 for oc4j

    another strange problem.
    i have an APplication server added ( JBOSS ).
    when i create deployment profile (EAR ) application server is showed in the ComboBox .
    But when i create Java Test Client for some EJB and when i check " Connect Remote Application server" there is 2 comboboxes
    J2EE Application
    App Server Connection.
    first combo is ok there is EJB applicaiton
    Secound is empty .. but i Have App Server.
    Another think is that when i create EJB 3.0 its BAD to see J2EE app it must be J EE 5 app or just Java EE app

  • How to create bar and pie graph from a backing bean in ADF

    HI,
    my requirement is to populate a line and pie graph based on a collection in a backing bean.
    I got the solution for the bar graph with setTabularData(list data) method in one of the thread.
    For bar graph,
    i constructed the list for the setTabularData(list) method but it is not working with the line and pie graph.Coul'd you explain why?..
    Is it different for the line and pie graph.I don't want to use adf bindings.
    thanks in advance.
    Anil.G

    HI,
    my requirement is to populate a line and pie graph based on a collection in a backing bean.
    I got the solution for the bar graph with setTabularData(list data) method in one of the thread.
    For bar graph,
    i constructed the list for the setTabularData(list) method but it is not working with the line and pie graph.Coul'd you explain why?..
    Is it different for the line and pie graph.I don't want to use adf bindings.
    thanks in advance.
    Anil.G

  • ADF BC + ADF Faces: How can consult a ViewObject in a backing bean.

    Hello comunity i'm new in ADF tecnology, need to consult a VO in a backing bean code, but these are not instances in page definition.
    Thanks Comunity.

    Hi Peter you can consult your aplication module and all VO including inside using these code:
    String amDef = "model.AppModuleImpl";
    String config = "AppModuleLocal";
    String retorno = "";
    ApplicationModule am = Configuration.createRootApplicationModule(amDef,config);
    ViewObject myVO = am.findViewObject("YourVO");
    Then you can filter your VO if you need
    myVO.setWhereClause("id = : 0");
    myVO.setWhereClauseParam(0, var);
    myVO.executeQuery();
    And iterate by the results
    while (myVO.hasNext()) {
    myVO.next();
    Row myRow = myVO.getCurrentRow();
    Number id= (Number)myRow .getAttribute("Id");
    Good Luck

  • Refresh iterator after invoking backing bean method

    Hi guys,
    I 'm using jdev 11.1.1.1.0.
    I have a jspx page which displays a table with data. I've succeedeed on not displaying data of the table on initial rendering with this code (it's my will) :
    <iterator Binds="ProjetsActifsLectureSeule_extend1" RangeSize="25"
    DataControl="AppModuleCodesProjetsDataControl"
    id="ProjetsLectureSeule1Iterator" RefreshCondition="#{!adfFacesContext.postback}"/>
    When i click a button on the page i want the table to display all datas. I've coded a backingbean method for that (named displayall) :
    public void displayAll(ActionEvent actionEvent) {
    ((DCIteratorBinding)getBindings().get("ProjetsLectureSeule1Iterator")).executeQuery();
    AdfFacesContext.getCurrentInstance().addPartialTarget(table3); // table3 contains the datas i want to be refreshed
    The method is executed but no datas are displayed like in the initial rendering of the page.
    What is wrong with my code?
    Thanks

    Yes Amseth,
    i want that datas of a query aren't displayed (it's a table component) on the initial rendering of the page.
    But i want there are displayed when i reexecute the query from a backing bean method.

  • Trouble creating and populating an array of objects.

    I'm trying to create/populate an array of objects with consisting of a {string, double, integer}, and am having trouble getting this theory to work in Java. Any assistance provided would be greatly appreciated. Following are the two small progs:
    public class HairSalon
    { private String svcDesc; private double price; private int minutes;
    //Create a constructor to initialize data members
    HairSalon( )
    svcDesc = " "; price = 0.00; minutes = 0;
    //Create a constructor to receive data
         HairSalon(String s, double p, int m)
         svcDesc = s; price = p; minutes = m;
    //Create methods to get the data members
    public String getSvcDesc( )
         return svcDesc;
    public double getPrice( )
         return price;
    public int getMinutes( )
         return minutes;
    public class SortSalon
         public static void main(String[ ] args)
         SortSalon [] sal = new SortSalon[6];
    //Construct 6 SortSalon objects
              for (int i = 0; i < sal.length; i++)
              sal[i] = new SortSalon();
    //Add data to the 6 SortSalon objects
         sal[0] = new SortSalon("Cut"; 10.00, 10);
         sal[1] = new SortSalon("Shampoo", 5.00, 5);           sal[2] = new SortSalon("Sytle", 20.00, 20);
         sal[3] = new SortSalon("Manicure", 15.00, 15);
         sal[4] = new SortSalon("Works", 30.00, 30);
         sal[5] = new SortSalon("Blow Dry", 3.00, 3);
    //Display data for the 6 SortSalon Objects
         for (int i = 0; i < 6 ; i++ )
         { System.out.println(sal[i].getSvcDesc( ) + " " + sal.getPrice( ) + " " + sal[i].getMinutes( ));
         System.out.println("End of Report");

    Hey JavaMan5,
    That did do the trick! Thanks for the assistance. I was able to compile and run the program after adding my sorting routine. Do you happen to see anything I can do to clean it up further, or does it look ok? Thanks again,
    Ironjay69
    public class SortSalon
         public static void main(String[ ] args) throws Exception
         HairSalon [] sal = new HairSalon[6];      
         char selection;
    //Add data to the 6 HairSalon objects
         sal[0] = new HairSalon("Cut", 10.00, 10);
         sal[1] = new HairSalon("Shampoo", 5.00, 11);      
         sal[2] = new HairSalon("Sytle", 20.00, 20);
         sal[3] = new HairSalon("Manicure", 15.00, 25);
         sal[4] = new HairSalon("Works", 30.00, 30);
         sal[5] = new HairSalon("Blow Dry", 3.00, 3);
    System.out.println("How would you like to sort the list?");
         System.out.println("A by Price,");
         System.out.println("B by Time,");
         System.out.println("C by Description.");
         System.out.println("Please enter a code A, B or C, and then hit <enter>");
              selection = (char)System.in.read();
    //Bubble Sort the Array by user selection
              switch(selection)
              case 'A':
              BubbleSortPrice(sal, sal.length);
                   break;
                   case 'a':
              BubbleSortPrice(sal, sal.length);
                   break;
                   case 'B':
              BubbleSortTime(sal, sal.length);                    break;
                   case 'b':
              BubbleSortTime(sal, sal.length);
                   break;
                   case 'C':
              BubbleSortService(sal, sal.length);
                   break;
                   case 'c':
              BubbleSortService(sal, sal.length);
                   break;
                   default:
              System.out.println("Invalid Selection, Randomly Sorted List!");
    //Display data for the 6 HairSalon Objects
              for (int i = 0; i < sal.length ; i++ )
         System.out.println(sal.getSvcDesc( ) + " " + sal[i].getPrice( ) + " " + sal[i].getMinutes( ));
              System.out.println("___________");
              System.out.println("End of Report");
    public static void BubbleSortPrice(HairSalon[] array, int len)
    // Sorts the items in an array into ascending order by price
    int a, b;
    HairSalon temp;
    int highSubscript = len - 1;
    for(a = 0; a < highSubscript; ++a)
         for(b= 0; b < highSubscript; ++b)
         if(array.getPrice() > array[b + 1].getPrice())
              temp = array[b];
              array[b] = array [b + 1];
              array[b + 1] = temp;
    public static void BubbleSortTime(HairSalon[] array, int len)
    // Sorts the items in an array into ascending order by time
         int a, b;
         HairSalon temp;
         int highSubscript = len - 1;
         for(a = 0; a < highSubscript; ++a)
              for(b= 0; b < highSubscript; ++b)
         if(array[b].getMinutes() > array[b + 1].getMinutes())
         temp = array[b];
         array[b] = array [b + 1];
         array[b + 1] = temp;
    public static void BubbleSortService(HairSalon[] array, int len)
    // Sorts the items in an array into ascending order by time
         int a, b;
         HairSalon temp;
         int highSubscript = len - 1;
         for(a = 0; a < highSubscript; ++a)
         for(b= 0; b < highSubscript; ++b)
         if(array[b].getSvcDesc().compareTo( array[b + 1].getSvcDesc()) > 0)
                   temp = array[b];
                   array[b] = array [b + 1];
                   array[b + 1] = temp;

  • Creating and populating portal domain

    I have created a portal domain on 8.1 platform using configuration wizard the problem
    is that I the domain is empty and I need thelibraries available on the sample
    portal how I am supposed to get to the my portal domain since I thought they would
    be provided automaticall once creating portal domain ,in other words what would
    be the standard way doing this .

    The admin portal exists as part of a portal application; it modifies the
    state of the portal resources in the application it's part of. If
    there's no app (such as with a new portal domain), there's no admin portal.
    You should use Workshop to create a new portal application on your new
    portal domain. In Workshop, use the menus: File|New|Application...,
    choose Portal Application, choose the name of application, choose the
    directory to put the application, then browse the Server field to the
    config.xml of the portal domain you created.
    If the server isn't already running, you can use Tools|WebLogic
    Server|Start Server to start it, at which point Workshop will deploy the
    new portal application to you domain, and you will be able to access the
    admin portal (including on the menu from Portal|Portal Administration...
    Greg
    Lara Man wrote:
    Hi Folks,
    I wanted to create my own portal domain in WebLogic 8.1 portal and I used the
    Weblogic domain wizard(config.cmd) and created a portal based domain.When I try
    to access the potal admin console (http://localhost:7001/PortalAppAdmin/portal.portal),
    it shows 404 error.
    How do I access the portal admin console in my own domain? Do I need to tweak
    anything in configuration?
    Thanks
    -Lara

  • Hierarchical Trees: Creating and populating

    How would I go about it if was to have hierarchical trees and populate them with dynamic data that changes at runtime with the occurence of an event such as clicking of a button?
    I use Forms version 6.0.8.8.0.

    Did you read the documentation? It explains how to use hierarchical trees.
    Regards,
    Robin Zimmermann
    Forms Product Management

  • Programmatically creating a navigation bar

    I am attempting to programmatically create and drive an OAF Navigation Bar bean. I can successfully instantiate the OANavigationBarBean and get it to appear on the page. However, I am unable to programmatically add any links to the navigation bar. I have attempted to do this programmatically in the processRequest method of the Controller of page1, using the following code:
    OAPageLayoutBean oapagelayoutbean = (OAPageLayoutBean)oawebbean;
    OANavigationBarBean oanavigationbarbean = (OANavigationBarBean)createWebBean(oapagecontext, "NAVIGATION_BAR", null, "TheNavigationBar");
    oanavigationbarbean.setValue(1);
    oanavigationbarbean.setMinValue(1);
    oanavigationbarbean.setMaxValue(5);
    OALinkBean oalinkbean1 = (OALinkBean)createWebBean(oapagecontext, “LINK_BEAN”, null, "Step1");
    oalinkbean1.setRendered(true);
    oalinkbean1.setID("Step1");
    oalinkbean1.setLabel("Step1Label");
    oalinkbean1.setText("Step 1");
    oalinkbean1.setUINodeName("StepOneNodeName");
    oalinkbean1.setDestination("/oracle/apps/ak/myapp/server/page2");
    oanavigationbarbean.addIndexedChild(oalinkbean1);
    oapagelayoutbean.addIndexedChild(oanavigationbarbean);
    This code compiles but doesn’t do anything when the next button is clicked.
    Has anyone else encountered this problem?

    As you can see, you are in for a lot of work with this popup
    menus...
    read these 2 articles before going any further:
    http://www.apptools.com/rants/jsmenu.php
    http://www.apptools.com/rants/menus.php
    The best way to use a navigation menu across all your pages
    is to either use
    DW templates or Server Side Includes. (SSI). However, the DW
    popup
    navigation system doesn't play nice with Templates.
    There are better ways to build these menus, mention of this
    is in the
    articles above. The will be much easier to maintain across
    your whole site.
    Nadia
    Adobe� Community Expert : Dreamweaver
    http://www.csstemplates.com.au
    - CSS Templates | Free Templates
    http://www.perrelink.com.au
    - Web Dev
    http://www.DreamweaverResources.com
    - Dropdown Menu Templates|Tutorials
    http://www.adobe.com/devnet/dreamweaver/css.html
    > Alright guys, I built a navigation bar in fireworks that
    has all the
    > pop-up
    > menus for my schools website but I don't know if this is
    the easiest way
    > to do
    > it. I need this navigation bar to be on every single
    page of the site
    > except
    > the banner above the buttons will change. I thought the
    easiest way to do
    > this
    > would be putting the fireworks HTML on each page and
    then when I get ready
    > to
    > add links to the navigation bar I can just update that
    HTML since its the
    > same
    > for all pages. But, I tried that and I still have to
    update each page
    > manually.
    > Right now there are no links associated with the pop-up
    menus and I need
    > to
    > start linking them to pages. The down side, I don't know
    how to get the
    > pop-up
    > menus linked! HELP!
    >
    > Please let me know if there is an easier way to build a
    navigation bar in
    > Dreamweaver. Thanks!
    >

Maybe you are looking for

  • External display's fonts are awful

    Fonts look awful (blurry, hazy and jagged) on my external Dell U2412M monitor ever since I upgraded to Yosemite. Everything was dandy in Mavericks but now it's just awful. Is anyone currently facing similar issues? I have tried mirroring the display,

  • 6.1 SP2 Caching realm not caching group members

    Hello: We have caching realm set over LDAP security realm. We see caching realm never caching group members. Any help is appreciated. Thanks Gennadiy Here is the sequence we see: 1) Search for user name - OK 2) Search for group name - OK 3) - ALWAYS

  • Lightroom 5.2 crashing, fix doesn't seem to work

    Hi Community, I have a really frustrating issue with my lightroom 5.2, and it is the same problem which I have had with my previous version where it would keeping crashing at random times as I'm working through my images. It generally says along the

  • HTTP/SPNEGO Authentication

    Hi, Having read in posting [http://forums.sun.com/thread.jspa?threadID=5362388&tstart=15|http://forums.sun.com/thread.jspa?threadID=5362388&tstart=15] that "Sun's GSSAPI implementation (a.k.a. JGSS) can only generate and consume raw Kerberos tokens a

  • Remote debugging hang

    Have anyone enconter the remote debugging hang when debug using Jdeveloper with UCM? I got this happen sometimes in some enviroment. any solutions? Thanks