Using data controls in a Declarative Component

Hi,
I'm trying to create a Declarative Component that uploads a file and update a database table, I've created an entity and a updatable view object of the table. When I put the Declarative Component in another project it renders correctly but the af:table that shows the database records show me "Access Denied". When I try to list the datasources available programatically it does not show the DS I've created in the declarative component project. How do I access this datasource?

Hi,
you expose an attribute on the declarative component that then you pass in the binding reference to access the View Object. If you expose an attribute of type DCIteratorBinding, then this can take an iterator reference (EL) as the input. In a managed bean in the declarative component you then resolve the #{comp} EL string (its a variable defined on your declarative component to point to itself) to access the attribute and get a hold to the iterator binding you passed in.
See sample 24 for a simplified version of what I decsribe: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html
Frank

Similar Messages

  • Calling webservice in code using data control ADF Mobile

    Hi,
    I am calling webservice in code using data control. Below image is show my binding.
    https://www.dropbox.com/s/ufjnnd67mfaeucq/Snap%202013-05-13%20at%2011.49.17.png
    My code is :
    ValueExpression ve1 = AdfmfJavaUtilities.getValueExpression("#{bindings.WeatherDescriptionIterator}", AmxIteratorBinding.class); // Using IteratorBinding
    AmxIteratorBinding iter = (AmxIteratorBinding) ve1.getValue(AdfmfJavaUtilities.getAdfELContext());
    GenericType row = null;
    iter.getIterator().first();
    iter.release();
    for(int i = 0; i < iter.getIterator().getTotalRowCount(); i++)
    row = (GenericType)iter.getCurrentRow();
    Integer s = new Integer(i+100);
    row.setAttribute("deptId", s);
    This code is work fine in POJO data control. But When I used this code for calling webservice data control then i get following error.
    can not find property bindings.
    And I also use below code but same error occur.
    ValueExpression ve1l = AdfmfJavaUtilities.getValueExpression("#{bindings.WeatherDescription.collectionModel}", AmxCollectionModel.class); // Using CollectionModel
    AmxCollectionModel model = (AmxCollectionModel)ve1l.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();
    }

    !!!! IMPORTANT !!!!
    The use of +*#{data.view_FlexFieldDisplayPageDef.publicflexfieldflow1.regionModel}"*+ in your code is an *absolute no-go and serious coding issue* as there is no guarantee that this PageDef file exists in the application you use the declarative component in. Even if you don't plan to use the declarative component anywhere else, you should pass the model reference as an input attribute to the declarative component so it can be configured by each use of the component
    Frank

  • Input Number Spinbox using data control

    Hello,
    I have a simple question :)
    I have created a data control using a simple POJO class. I am trying to create an input number spinbox on the page.
    i created an int with getter/setters in my POJO and generated the DC, but when i drop it on the jsf, i do not get the option of creating an input number spinbox. I tried creating an "Integer" object and a String as well, but no luck.
    What do i have to create in my POJO so that when i drop it, i get the option of creating an input number spinbox
    Thanks

    Hi,
    not all ADF Faces components are listed in the ADF binding dialog. So in your case, you create an inputText and then change it to a spinBox. You can do so by selecting the spinbox in the component palette using the right mouse button and move it on top of the input text field you want to change to become a spinbox. Then when converting the components, then IDE tells you which attributes are changed (e.g. no longer available in the new component)
    Frank

  • Jdev 11g, Passing data between pages using data control

    Hi,
    I'm fairly new to Jdev, J2EE, and ADF. I created a project using the tutorial "Build a Web Application with JDeveloper 11g Using EJB, JPA, and JavaServer Faces" (found here: http://www.oracle.com/technology/obe/obe11jdev/11/ejb/ejb.html).
    Data model part seems to work fine. I am able to connect to the database and print out a record using the sample client.
    Now I'm trying to build the web front end for it. I started using a data control and ADF to make the components. I built a search page by dragging and dropping my method from the data control onto a form. I set the action on the form to go to a detail page which I put a database node from my table product_group. My thinking was the user would put in the id and then be taken to the next page that has the detail on it.
    When I ran the page though the search page seemed to execute fine but the detail page came up blank. There were no runtime errors. I think data is not being passed to the next page.
    This is the code for the form on the search page:
    <af:form>
    <af:panelFormLayout>
    <af:inputText value="#{bindings.p_id.inputValue}"
    label="#{bindings.p_id.hints.label}"
    required="#{bindings.p_id.hints.mandatory}"
    columns="#{bindings.p_id.hints.displayWidth}"
    maximumLength="#{bindings.p_id.hints.precision}"
    shortDesc="#{bindings.p_id.hints.tooltip}">
    <f:validator binding="#{bindings.p_id.validator}"/>
    <af:convertNumber type="number"/>
    </af:inputText>
    <af:commandButton actionListener="#{bindings.queryProdGroupFindByID.execute}"
    text="Search ID"
    disabled="#{!bindings.queryProdGrouptestFindByID.enabled}"
    action="search"/>
    </af:panelFormLayout>
    </af:form>
    This is the detail page:
    <af:form>
    <af:panelFormLayout>
    <af:panelLabelAndMessage label="#{bindings.description.hints.label}">
    <af:outputText value="#{bindings.description.inputValue}"/>
    </af:panelLabelAndMessage>
    <af:panelLabelAndMessage label="#{bindings.id.hints.label}">
    <af:outputText value="#{bindings.id.inputValue}">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.id.format}"/>
    </af:outputText>
    </af:panelLabelAndMessage>
    <af:panelLabelAndMessage label="#{bindings.status.hints.label}">
    <af:outputText value="#{bindings.status.inputValue}"/>
    </af:panelLabelAndMessage>
    <af:panelLabelAndMessage label="#{bindings.storeId.hints.label}">
    <af:outputText value="#{bindings.storeId.inputValue}"/>
    </af:panelLabelAndMessage>
    <af:panelLabelAndMessage label="#{bindings.type.hints.label}">
    <af:outputText value="#{bindings.type.inputValue}">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.type.format}"/>
    </af:outputText>
    </af:panelLabelAndMessage>
    </af:panelFormLayout>
    </af:form>
    I guess what I'm asking is how does data get passed to the detail page using a data control? Also if anyone has an online book about data controls and how they work I'd appreciate that too. Too much magic going on.
    Thanks in advance.
    Edited by: user2936931 on May 3, 2009 5:15 PM

    I went to the bindings tab for my search.jspx page and found in the 'executables' table queryProdGroupFindByIDIterator. I looked in the properties for that and 'CacheResults' is set to '<default>true'. Next page still looks blank. I changed it to straight up 'true' and that didn't work either.
    If I'm in the right place I guess it must be something else?

  • Dynamic pagination using inputs from a Web Service data control

    I am in process of creating a pagination UI component , much similiar to the one used in Oracle forums eg: Pages: 100 [1 2 3 4 5 | Next ]
    I am making use of a Web Service to get the following details for my search results :
    a) Number of search result rows (100) ,
    b) total number of rows to be shown on one page (5)
    c) Total number of pages
    I am wondering how to create the pagination UI control in my ADF Faces page and How can I bind the web service data control to the pagination component for a simple dynamic navigation
    Please advice. I am new to ADF development, so looking inputs for approach to the above elucidated problem (Code not required)

    Yes I am using <af:commandLink > component
    <af:forEach
    var="list" items="#{NavBean.list}">
    <af:spacer width="5" height="10" id="s1"/>
    <af:panelGroupLayout id="pgl2" layout="horizontal"
    halign="center"
    inlineStyle="#{list.found ? 'background-color:#aeccd8;' : 'background-color:white;'} text-align:center; width:15px; ">
    <af:commandLink text="#{list.character}" id="cl1"
    partialSubmit="true"
    disabled="#{list.found ? false : true}"
    actionListener="#{NavBean.onIndexSelected}">
    <f:attribute name="indxKey" value="#{list.character}"/>
    </af:commandLink>
    </af:panelGroupLayout>
    </af:forEach>
    I have created a NavBean managed bean with some methods and foll set of instance variable:
    List<IndexCharacterObject> list = null;
    int startRow;
    int endRow;
    int pageNumber;
    int numPages;
    int totalRows;
    I want these variables in the Managed bean class to be automatically populated from the Web Service data control .. Not sure how to go about binding these values ?

  • Scope of java class used for building data control

    Hello,
    I have tried a sample application where in we are using Datacontrols to render the UI.
    The data control is generated off a simple java class(abc.java) which is used to render a "Page called - Employee". This java class then uses a session bean which in turn talks with the database entities. The database entities(POJO's - employee.java) are then exposed in the abc.java and used to display data on the UI such as employee name, id , etc.
    My question is regarding the scope of abc.java. I presume, that the constructor of this class will be called when the page is rendered.
    Now say i am navigating from some Page-A to Page-Employee. On click of a button in Page A, i want to go to the Database, retrieve a particular employee's details and then place it in the employee entity exposed in abc.java so that it gets displayed when Page-Employee is rendered.
    If the actionlistener method of the button click in Page A has the code of - 1)create new instance of abc - new abc() 2)retrieve employee entity 3) set employee entity in the class level attribute of abc
    But on going to the next page-employee, a new instance of abc is getting created and i am losing the employee that i had retrieved in the previous screen.
    Is there a scope for abc that can be set somewhere similar to managed beans? or is there some other solution.
    -thanks

    Hi,
    Say, on an 'employee create page' we use data controls which are generated from a java class, 'EmployeeService'.
    This java class has the POJO(entity) - Employee whose attributes like name, description are used to create input text boxes on the employee page.
    Now, assume we come to the Employee create page from some other page in the application; where exactly is the best place to make an instance of the employee entity.
    Do we place- Employee emp = new Employee(); in the constructor of the EmployeeService.java class or is there some other way?
    Any pointers would help.
    Thanks
    Edited by: user9935204 on Feb 4, 2010 8:44 PM

  • EJB 3.0 / Data control binding / ADF Faces

    We have a great and very useful tool to generate rich client web application. Generate web component from a data structure is easy but manage the full life cycle is a little bit more complex. This complexity is dramatically increased when tool/platform are offering many models to solve the problem.
    In JDev we have three major choices:
    1) adf business components
    2) top link pojo
    3) ejb3.0
    From the client side and in my point of view (at my current understanding) the first and second choice are the easiest way to manage the persistence because they are what i say "bidirectional", that mean i will use the same data structure to persist and synchronize the database. I may only calll a method from the object to put my changes from the midle-tier into the database.
    EJB 3.0 seem to be more cormplex due essentially to the presence of the session bean that acts like conversational api. I like this architecture because it is the most flexible but from my client i have to manage these api's instead of one data structure. This mean for me to catch/detect every updates, new insert or deletes in my business object and to write the corresponding code to apply to correct entity bean methods from my session bean.
    Why not manage this logic in the data control framework by declaring which methods are to use as finder to get the data and which methods are to used to manage the persistence (persist, merge, remove) at object level.

    Exactly what i mean
    Actually Data Control architecture seem to be business object oriented with native method called from the same object to retrieve (the most part done)/synchronize the data with the database.
    This is fine than your architectue don't provide a service layer like session facade.
    With session facade you will access different business method to retrieve data and synchronize you data with the database not different method from the same object like application module do in adf bc.
    I see two solution, the best is that you extend the data control framework to offer standard crud operation and a tools to map these with one or many methods in the same (has to be the same?this is a question of architecture, i think it has to be the same but the framework may have to permit to use an another one for flexibility) session bean. This may be the same from adf bc or top link but the method may be selected automatically by the tool (wizard).
    The second solution is to build specialized sesssion bean with mandatory standardized methods and map this directly in the framework. The advantage i see is that the updates may be collected only once by the session bean by passing a specialized object manipulated by a specialized method.
    In fact the best solution is something that combines mapping in the data control and a specialized set of methods in the session bean to execute a transaction in a whole at the server level.
    What is to be decided if the framework (data control part) has to maintain a status for attribute (or set of attribute that correspond to a data control node) that are new inserted, updated or deleted and to synchronize only the changes.
    I'm very surprising that something like that it is not already in the framework ?
    How do I have to take care of changes made in a data control node object when i have used it to generate an adf faces by example in master / detail pages with an edit form like in otn examples. I see that the detail list in the detail table is updated so the data control is updated correctly by the edit form when i submit the changes but how to finally get this changes and synchronize with the database ?
    ps i reply previously by mistake by email sorry ... not that the email is not exactly the same as the post here
    Michel

  • Should we really go for bean data controls for a new project?

    Hi,
    I am still new data controls and trying to figure out the advantages of using bean data controls for our new project. Our UI is going to have customized UI components and our back end is going to be a tcp/ip server.
    Is it a good idea to develop java beans and then create data controls to bind to UI layer? I think it makes sense to use data controls if we want to use existing java beans. Maybe we would be separating the model layer by using data controls, but only thing it would be doing for us would be the simple object calls to my java beans. Would it be better to use data controls or use I choose to make object calls?
    Thanks,
    Manoj

    Hi,
    the POJO data control will always give you a benefit and develope productivity, unless what you have to build fits on a single page - in which case you may not mind the burdon of manual UI component binding
    Frank

  • Problems to create data control in JDeveloper 11g

    Hi everybody , I´m having problems to use Data Control in Jdev 11 , I create an jpa , and with my entities I create the data control component , but when I try to create a JSF page I can´t use data control, where is data control component palette ?

    Please post JDev 11 questions on the JDev 11 forum
    JDeveloper and OC4J 11g Technology Preview
    Follow this tutorial to see the data control palette for EJB/JPA
    http://www.oracle.com/technology/obe/obe11jdev/11/ejb/ejb.html
    Here is how it will look like:
    http://www.oracle.com/technology/obe/obe11jdev/11/ejb/images/t50105.gif

  • UCM Data Control (getItems)

    Hi All,
    I am trying to display Webcenter content data in Tree structure using Data Controls getItems function.
    I am able to display folder/subfolder and files in ADF tree.When I click on any file in Tree node , i am able to see corresponding file in same window and its Metadata info. I am able to update the corresponding selected file metadata information using RIDC library.
    Isuee i am getting, When i click on file on any sub folder in Tree , I could not see corresponding file..But I select top folder files in tree , i can cooresponding file and metadata info.
    When I drog drop the getItems function in ADF web page, i just select Tree component and custom data field in data control.
    Any idea , Why i don't see subfolder files in my page when i select in tree node. Do i need to logic on Tree to onSelection node?
    Thanks in Advance.

    Hi Daniel, Thanks for quick response.
    I am able to display Correct Tree of webcenter Content Folders and files.
    The problem is when I select any file in sub node , i don't see corresponding node data(i.e file content and metadata field) in page. But it works fine when i select top node file in Tree then it display corresponding file and metadata info. It there is no problem for refreshing file and metadata dispaly area.
    Thanks

  • Valuechangelistener - data control

    Hi,
    i have create a drop down(select one choice) using data controls.
    The data control is generated off a java file which has the list used for populating the dropdown.
    For this select one choice component: on change of value - how can i set some method inside this java file as the valueChangeListener method?
    (I know it is possible by specifying a method in a managed bean, but here i want a method to be executed which is inside the java file used to generate the datacontrol). Is there some other approach?
    thanks

    A data control is just a way to expose a class so you can bind it to a UI. When your UI is created you can also create managed bean to handle UI events.
    So in your case you dragged the Datacontrol to bind the data into a selectOneChoice, if you also want to access a method in the same POJO on the page, you need to add an action binding to that method (either in the binding tab, or by dragging the method to your page from the data control).
    Then on the selectOneChoice you can have a valueChangeListener that has some code in a managed bean that access the binding layer to invoke the method.
    A couple of videos that might be useful:
    Working with POJO including from a backing bean:
    http://blogs.oracle.com/shay/2009/07/java_class_data_control_and_ad.html
    Adding an action binding and activating it from a managed bean : http://blogs.oracle.com/shay/2010/04/doing_two_declarative_operatio.html

  • Manipule a lista in data control

    Hi everyone,
    I have a data control from a oracle component and I don't have access to this code, so I used it in my page, the data control returns a collection of items, so I can use adf tree and other thinks like that.
    The data control is a data control from a UCM component and I'm using getItems method.
    So, as I say before I don't have access to the code of data control but I need manipulate the return with java operations, I need sort this list.
    I was thinking about call this method in my java method and create my custom data control, but I don't know how "call" the data control method in my custom method.
    I would like to know if it's possible cat the result of this oracle data control in a java method and so I can manipulate this.
    Thks in advance,

    Is it possible to which type of Object, the list returned by the datacontrol contains?
    If yes, you could create a custom comparator,
    (The below sample NavigationTreeNode is the type of each item in the list)
    import java.util.Comparator;
    public class NavigationTreeNodeComparator implements Comparator<NavigationTreeNode> {
    public NavigationTreeNodeComparator() {
    super();
    @Override
    public int compare(NavigationTreeNode navigationTreeNode1,
    NavigationTreeNode navigationTreeNode2) {
    int displaySequence1 = navigationTreeNode1.getDisplaySequence();
    int displaySequence2 = navigationTreeNode2.getDisplaySequence();
    if (displaySequence1 > displaySequence2) {
    return +1;
    } else if (displaySequence1 < displaySequence2) {
    return -1;
    } else {
    return 0;
    After getting the list from method, you can use the custom comparator to sort the list as follows:
    Here, the navigationTree contains the list of navigationTreeNodes
    NavigationTreeNodeComparator navigationTreeNodeComparator =
    new NavigationTreeNodeComparator();
    Collections.sort(navigationTree, navigationTreeNodeComparator);
    Thanks,
    Navaneeth

  • Selected node in a tree table (via Data Controls and not managed bean)

    I am facing some problems in getting the selected row in a tree table.I have used data controls for creating the tree on the page.
    I have 3 POJO's,ex; Class AB which has a list of Class CD.And Class CD has a list of class EF. (Used for the tree table)
    Now i have a java class, called MyDelegate.java which has a list of AB.I generated data controls off this MyDelegate class and have dropped the ABlist as a tree table (also displaying CD and EF in the tree table).
    It displays fine with nodes of AB,CD (child of AB)and EF(child of CD)
    The tree table is not bound to any managed bean.
    For performing actions on the tree, i create a method - "doSomething() in the delegate class",generate data controls and drop it as a button.
    Inside doSomething(), i need acess to the selected node in the tree (it can be a node of type AB or CD or EF).
    The problem: I always get access to the node of type AB, and not the child nodes no matter what i click in the tree table.
    doSomething(){
    DCBindingContainer dcBindingContainer = (DCBindingContainer)ADFUtil.evaluateEL("#{bindings}");
    DCIteratorBinding dcTreeIteratorBinding = dcBindingContainer.findIteratorBinding("lstABIterator");
    RowSetIterator rowTreeSetIterator = dcTreeIteratorBinding.getRowSetIterator();
    DCDataRow rowTree = (DCDataRow)rowTreeSetIterator.getCurrentRow();
    if (rowTree.getDataProvider() instanceof AB) {
              //do something
              AB selectedAB = (AB)row.getDataProvider();
    } else if (rowTree.getDataProvider() instanceof CD){
              //do something
    } else if (rowTree.getDataProvider() instanceof EF) {
              // do something
    How do i access the "selected child node of the tree table" here in the delegate class method? Pls help.

    Hi Frank,
    Thanks for the response. In my case, i dont have a managed bean, so i am slightly unsure how to do it.
    There is a mention "Note that another way to access the treeTable component at runtime is to search for it in JavaServer Faces UIViewRoot. This latter option allows you to write more generic code and does not require to create a page dependency to a managed bean"
    How do i use this adf view root (without a managed bean) to get hold of the selected row in the tree table. Pls help.
    Thanks.

  • Problem mapping inputText field to a variable in a data control

    I have encountered the following problem. Please help. Any feedback is appreciated.
    I have a page that contains first name, last name, address, city, state zip and country input text fields and a submit button. When the submit button is clicked, user entered information will be commited to database. This is easily achieved by using a managed bean.
    Now I would like to achieve the same functionality by using data control. The reason I want to use data control is to avoid putting the controls (first name, last name, address, city, state zip and country) in the managed bean. I was hoping that they can be directly mapped to the data control variables. The data control is created from a Java object which contains attributes of first name, last name, address, city, state zip and country. The data control is dragged and dropped to a jsff page and the jsff looks like the following:
    <af:inputText label="First Name"
    value="#{bindings.firstName.inputValue}"
    required="true"
    maximumLength="25" autoSubmit="true"
    id="it10">
    </af:inputText>
    When I run the page, I can see the label First name but the input box was not shown. So I removed: value="#{bindings.firstName.inputValue}" and the input box appears.
    Why did that happen? Can I directly map a data control attribute to an input text field?
    Thank,
    Cecilia

    Thanks for the response, Shay. Really appreciate it.
    I tried your first solution - modified the property IsUpdateable to Updateable. However the input text box is still not appearing.
    My java class is just a simple Java class. In the class all I have is just a get method for a domain model object.
    In the jsff, if I assigned a value to the value attribute (value="Jane"), the input text box would appear as updateable.
    Any idea?

  • Problems with data controls from java classes in JSF pages.

    Hi! We have a problem in our Application that we are developing with JSF pages using Data Controls generated from facades java classes. When we running a page in debug mode and the page are loading, if we insert a breakpoint in the first line of method referenced in the data control, the execution enter two times in the method, and this is a problem for us. How to solve this?
    We are using JDeveloper 11.1.1.2 with ADF faces.

    You might need to play around with the refresh property of the action binding.
    http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/adf_lifecycle.htm#BJECHBHF

Maybe you are looking for

  • How to create a link to an item?

    I noticed that you can create a folder-link, but not an item-link. I cannot use the URL as an item-link "work-a-round" because when the (text)item changes (new version), the URL changes too. This would take a lot of management resources too update th

  • PC Suite can't find my Nokia 5230!!

    Well, my problem is this: I got this phone 3 months ago, and it paired with PC Suite perfectly, till few days ago, when i lost connection with it, and now PC Suite and OVI Suite can't find my phone. I checked bluetooth device that im using, and made

  • Nord electro as evb3 controller

    Hi: I'm trying to improve my EVB3 tracks and at the same time buy an organ clone to gig with. I'm attracted to the nord electro because of its size and versatility. Does anyone use one of these to trigger the evb3? How well do the drawbars (?) and ot

  • Siri and music problems when headphones attached.

    sometimes when using siri with my headphones, siri may stop completely whilst in mid sentence or the phone may just lock itself. also when using headphones to skip music tracks, the music may jump by itself or pause itself, then when I click the butt

  • Start-up drive full - when its not

    Yesterday I rebuilt my xserve, with leopard OSx server. I've just got a message saying that the start-up drive is full, and when I get info on the drive, it is showing it as full. However, I've only installed the OS, nothing else! Not only that, when