Declarative Components field binding

Can we bind a View Object to declarative component? I want to have a declarative component and whenever that declarative component would be used, it would be used with the same view object so i feel it extra work to bind all the attributes to view object's attributes whenever declarative component has to use. I want t create the component (declarative) and get bind it with a view object somehow and use it without every time going through to bind to view object or bind individual fields to view object's attributes. Any suggestions??
Edited by: Mamoona on Jun 24, 2011 4:56 PM

Hi,
this is not what declarative components are for. Think of declarative components as standard JSF components, which you would not build tied to a specific model. If you need to wire a declarative component to a View Object then you expose an attribute on the declarative component that the consumer of the component the uses EL on to bind it e.g. to the ADF binding layer
Frank

Similar Messages

  • How to access/identify components in JSF Declarative Components?

    Hi,
    I am beginner on ADF. Trying to build first Declarative Components.
    Use Case is as follows -
    I have put 2 InputTexts in Declarative Component.
    Want to set some value in second InputText (txtAddressLine2) in Validator/ValueChangeListner method of first InputText(txtAddressLine2).
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <af:componentDef var="attrs" componentVar="component">
    <af:xmlContent>
    <component xmlns="http://xmlns.oracle.com/adf/faces/rich/component">
    <display-name>Test</display-name>
    <attribute>
    <attribute-name>
    AddressLine2
    </attribute-name>
    <attribute-class>
    java.lang.String
    </attribute-class>
    </attribute>
    <component-extension>
    <component-tag-namespace>Address3</component-tag-namespace>
    <component-taglib-uri>/Address3</component-taglib-uri>
    </component-extension>
    </component>
    </af:xmlContent>
    <af:inputText label="Address Line 1"
    binding="#{backing_Address3.txtAddressLine1}"
    id="txtAddressLine1"
    validator="#{backing_Address3.txtAddressLine1_validator}"
    autoSubmit="true" immediate="true" rendered="true"
    valueChangeListener="#{backing_Address3.txtAddressLine1_valueChangeListener}"/>
    <af:inputText label="Address Line 2" binding="#{backing_Address3.txtAddressLine2}"
    id="txtAddressLine2"
    validator="#{backing_Address3.txtAddressLine2_validator}"
    autoSubmit="true" immediate="true"/>
    </af:componentDef>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_Address3-->
    </jsp:root>
    This is sample I am working on.
    I am trying following approaches in bean of Component itself.
    Approach I: This does not give any error, value is not set in txtAddressLine2
    this.getTxtAddressLine2().setValue("Some Value");
    Approach II: Not able to access txtAddressLine2 using findComponent() method
    UIViewRoot uiViewRoot = facesContext.getViewRoot();
    RichInputText inputText;
    inputText = null;
    if (uiViewRoot.findComponent("txtAddressLine2") != null) {
    System.out.println("Found ");
    inputText = (RichInputText)uiViewRoot.findComponent("txtAddressLine2");
    inputText.setValue("my value");
    } else {
    System.out.println("Not Found "); //Always not found
    Can anybody tell me correct way to access components and set their values inside Declarative Components itself?

    Thanks buddies....its resolved!
    This is how I have done it -
    Components have these 2 Input Texts :
    <af:inputText label="Label 1" id="txt1" autoSubmit="true" immediate="true"
    binding="#{DC2.txt1}" validator="#{DC2.txt1_validator}"/>
    <af:inputText label="Label 2" binding="#{DC2.txt2}" id="txt2"
    immediate="true" autoSubmit="true" partialTriggers="txt1"/>
    Code in Component Bean setting value is as follows:
    RichInputText txt22;
    txt22 = getTxt2();
    txt22.setSubmittedValue("Some Value");

  • Reusable toolbar with Oracle ADF declarative components(ADf code corner)

    Hi All,
    Using Jdeveloper 11.1.1.2.0.
    Following the how to achieve "reusable toolbar with Oracle ADF declarative components" published here
    [http://www.oracle.com/technology/products/jdev/tips/fnimphius/GenericMenuBar/genericMenuBar.html]
    But I am not getting any method parameters under JSP Objects -> Components when binding the buttons toolbar menu buttons.Following is the code I have in my GeneralToolbarComponent.jspx
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <af:componentDef var="attrs" componentVar="component">
    <af:toolbar id="dc_t1">
    <af:commandToolbarButton text="commandToolbarButton 1" id="dc_ctb1"/>
    <af:commandToolbarButton text="commandToolbarButton 2" id="dc_ctb2"/>
    <af:commandToolbarButton text="commandToolbarButton 3" id="dc_ctb3"/>
    <af:commandToolbarButton text="commandToolbarButton 4" id="dc_ctb4"/>
    </af:toolbar>
    <af:xmlContent>
    <component xmlns="http://xmlns.oracle.com/adf/faces/rich/component">
    <display-name>GeneralToolbarComponent</display-name>
    <attribute>
    <attribute-name>DataSet</attribute-name>
    <attribute-class>java.lang.String</attribute-class>
    </attribute>
    <component-extension>
    <component-tag-namespace>component</component-tag-namespace>
    <component-taglib-uri>/VikramLib1</component-taglib-uri>
    <method-attribute>
    <attribute-name>handleFirstMethod</attribute-name>
    <method-signature>void
    handleFirstMethod(javax.faces.event.ActionEvent)</method-signature>
    </method-attribute>
    <method-attribute>
    <attribute-name>handleLastMethod</attribute-name>
    <method-signature>void
    handleLastMethod(javax.faces.event.ActionEvent)</method-signature>
    </method-attribute>
    <method-attribute>
    <attribute-name>handleNextMethod</attribute-name>
    <method-signature>void
    handleNextMethod(javax.faces.event.ActionEvent)</method-signature>
    </method-attribute>
    <method-attribute>
    <attribute-name>handlePreviousMethod</attribute-name>
    <method-signature>void
    handlePreviousMethod(javax.faces.event.ActionEvent)</method-signature>
    </method-attribute>
    </component-extension>
    </component>
    </af:xmlContent>
    </af:componentDef>
    </jsp:root>
    Thanks
    Vikram

    Thanks for the link. We are trying to write a template as described on this link - Help on JSF Page Template
    However we are running in to issues after defining the attribute.
    Can anyone help?
    Thanks
    Ajay

  • How to set the disable,visible property in declarative components.

    We have used one declarative component. It consists of 5 buttons (add,delete,save,delete,print). In all of our pages, this declarative component is used. We could bind methods and was able to use each pages seperately (by linking the methods in the backing bean)
    But for implementing the DISABLE,VISIBLE properties, we have added the attributes for this and refered this to the corresponding disable and visible property of the button. In the page all these properties where reflected. But at the runtime these buttons are not coming.
    Can anyone advise how can we set the disable,visible property in declarative components.

    Hi vikram ,
    i hvnt initialized the properties ,
    in my declarative component i have one button say Save button and i want to config 2 properties Disable and Visible
    i added two attributes ( java.lang.Boolean ) say disablr_btn ,*visible_btn* and mapped wth the Save button Properties Disabled and Visible using expressions
    Now the button is invisible while running the page.
    if i remove the mapping from properties Disable and visible , the button is visible
    should i init the properties in faces config , i dnt knw hw to init the properties
    pls advice

  • ADF 11g Declarative Components

    Declarative components rock! now is there a way to use them with a managed bean, for example click a button to load a table of data. After you wire this up with the managed bean, partial rendering and deploy as library it will work in a new project as a new component. However the partial submit and trigger doesn't seem to stick. It does a full page submit. Is there a solution for this???
    thanks.

    Hi,
    I have a DC, which contains a panelCollection with a toolbar and buttons in it. The panelCollection's child is a facetRef. On a consuming page I insert into the facet a table.
    How can I get the toolbar's buttons get updated, once the table's contents have changed?
    Particularly, disabled properties of the buttons are exposed as attributes of the DC. On the consuming page the attributes are bound to enabled properties of a commit and a rollback binding actions. Initially the buttons are disabled. When I change a cell's value it would be nice, if the buttons would be enabled in response without refreshing the page or invoking an execute on an undelying VO/iterator.
    Regards,
    Y.

  • Declarative component attribute binding

    Hi,
    I'm sure this is an easy one, but I can't find the answer on the forum.
    using JDev 11.1.1.3
    I have created a declarative component with text fields bound to attributes as described in the ADF Code Corner, created the ADF Component lib etc. When I use this component in a task flow in another project, I set the properties to fields in my managed bean which is declared in the task flow, however on submission I find that my text input fields (RichInputText objects) are null i.e. the binding didn't work. I'm not sure if I should be creating 'attribute bindings' in the page definition, or if teh managed bean should be declared in the ADF component library, or if this should just work and I have done something silly.
    The examples usually bind the exposed attribute properties to a data control field, I'm not sure how it works for a managed bean, can anyone point me in the right direction?
    thanks in advance
    steve

    Hi,
    it should work for managed beans as well. If your managed bean exposes a setter/getter pair, then this can be bound to the declarative component attribute binding. However, keep in mind that if the managed bean is in request scope, the bean is refreshed and this re-setted for each request. So the bean should have a scope of at least viewScope
    Frank

  • JDeveloper 11.1.2.3, ADF Faces: aberrant behavior declarative components

    Strange things have been happening with my research into declarative components.
    1. declarative component cannot be used the within the same project it is defined. only in a separate project which consumes it as an adflib
    2. periodically, in the componentdef property inspector for my declarative component would miss displaying all values I defined for "Facet Definitions, Method Signature, Methods". Closer inspection of the code reveals that somehow, the afc tags disappeared! so the code for something like a method attribute would look like:
    <method-attribute>
      <attribute-name>
       commit
      </attribute-name>
    <method-signature>
      void method(javax.faces.event.ActionEvent)
    </method-signature>
    </method-attribute>
    ...instead of:
    <afc:method-attribute>
    <afc:attribute-name>
      commit
    </afc:attribute-name>
    <afc:method-signature>
      void method(javax.faces.event.ActionEvent)
    </afc:method-signature>
    </afc:method-attribute>
    ...3. during design time, the ActionListener attribute of a button (in the declarative component definition) shows up under "warning node" and states "Reference comp.nameofactionlistener" not found.
    Code will run but there are many warnings similar to this.
    anyone else on 11.1.2.3 have similar issues working with declarative components? i'm trying to find steps to reproduce but havent stumbled upon it yet.

    Wes,
    1) is documented at http://docs.oracle.com/cd/E35521_01/web.111230/e16181/af_reuse.htm#autoId21
    2) and 3) I personally have not stumbled upon, but if you have a reproducible test case you should open an SR or make an entry in the ADFEMF issue tracker (http://java.net/jira/browse/ADFEMG side is currently down :()
    Timo

  • Lightweight alternative to Declarative Components?

    Hi,
    Is there a simpler, lighter way to extract part of an ADF page into a re-usable tag that can be used instead of the Declarative Components feature?
    In my application, I have a table which displays some data from a VO. Some columns are links, and there are also various buttons in and around the table that allow the user to perform a set of common actions on the table contents. I don't want to have to replicate this into all my various pages, I want to extract this into a reusable 'tag'.
    This is not a component that will be useful throughout the organisation, it's just a simple component that will be used a few times in this one application. My first idea was to use the ADF declarative component feature, but this requires deployment of a seperate JAR. I've followed various tutorials now on creating a jar then including it into my project, but I haven't succeeded so far (for some reason the jar I create doesn't seem to contain the Declarative Components I have defined). Can I not simply define some components in my own application and use them within that application without the JAR deployment step?
    I've also tried going the JSP tag route, but I need to pass objects such as the backing bean and the view object iterator to the tag and when I try and add a tag attribute with deferredValue="true", I get an error from the app server like:
    /WEB-INF/tags/attachments.tagx: Line # 9, <jsp:directive.attribute name="backingBean" required="true" deferredValue="true" type="java.lang.Object" xmlns:jsp="http://java.sun.com/JSP/Page"/>
    Error: Invalid attribute "deferredValue", for the  attribute directive with name " backingBean " when the tld version is not 2.1
         at oracle.jsp.parse.JspRTTag.<init>(JspRTTag.java:247)
         at oracle.jsp.parse.JspRTTag.<init>(JspRTTag.java:237)
         at oracle.jsp.parse.JspParseState.createTagParser(JspParseState.java:943)
         at oracle.jsp.parse.JspParseTag.genXMLSrcTag(JspParseTag.java:919)Even though my implicit.tld does have version="2.1".
    My third and final idea was to create a jsff and include it in the page via f:subview and jsp:include, however I can then only pass string type parameters (jsp:param) to the fragment. This isn't adequate, since I need to pass backing bean, view object iterator, etc.
    Surely I'm missing an easy way to do this. Any ideas?

    I've now succeeded in creating a Declarative Components library and importing those components into my project. It's a rather long winded process but if it works I guess it'll do.
    I've created a component called 'attachments', but I'm now getting the following exception when attempting to use the components in my page:
    java.io.FileNotFoundException: MDS-00013: no metadata found for metadata object "/components/attachments.jspx"
         at oracle.mds.jsp.MDSJSPProviderHelper.fromStream(MDSJSPProviderHelper.java:120)
         at oracle.adf.library.webapp.ADFJspResourceProvider.fromStream(ADFJspResourceProvider.java:333)
         at oracle.jsp.parse.XMLUtil.getFromStream(XMLUtil.java:280)
         at oracle.jsp.runtimev2.JspPageCompiler.compileBothModes(JspPageCompiler.java:477)
         at oracle.jsp.runtimev2.JspPageCompiler.parseAndGetTreeNode(JspPageCompiler.java:454)
         at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:653)
         at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:643)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:379)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:722)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:646)
         ...Another post on the forum says the solution is to create a pageDef file for the jspx, however I can't create a pageDef for a component as far as I can tell.
    Is there a solution here? Can MDS and Declarative Components be used together?

  • How to declare a field in a structure and table

    Hi, I have a doubt in declaring a field inside a structure.
    types: BEGIN OF mrm_rbkpv.
            INCLUDE STRUCTURE rbkp_v.
    types: h_rbws LIKE rbws OCCURS 0,
           end of mrm_rbkpv.
    data : e_rbkp_v type mrm_rbkpv.
    Now I want I to refer to field WT_WITHCD inside table H_RBWS.
    eg : if e_ebkp_v-h_rbws-wt_withcd = 'X ' is right or wrong??????
    POints will rewarded
    Thanks in advance

    hi jaysree,
    types: BEGIN OF mrm_rbkpv.
    INCLUDE STRUCTURE rbkp_v.
    types: h_rbws LIKE rbws OCCURS 0,
    end of mrm_rbkpv.
    data : e_rbkp_v type mrm_rbkpv.
    if e_ebkp_v-h_rbws-wt_withcd = 'X '  - > this will work perfectly.
    rgds
    anver
    if hlped mark points

  • How to declare the field if i want the output as 300.12,00

    How to declare the fields if i want the output as 300.12,00
    i have a quantity field so i need to place . in place of , and , inplace of .
    please help me

    hi,
    declare its as
    CURR
    field.
    Regards
    Anver

  • Declarative Components

    Can we bind a View Object to declarative component? I want to have a declarative component and whenever that declarative component would be used, it would be used with the same view object so i feel it extra work to bind all the attributes to view object's attributes whenever declarative component has to use. I want t create the component (declarative) and get bind it with a view object somehow and use it without every time going through to bind to view object. Any suggestions??

    duplicate
    Frank

  • ADF Mobile: Templates, Reusable regions, Declarative components

    Hi,
    Unfortunately the developer guide has no mention about how to create page templates, re-usable regions, and declarative components. Does ADF Mobile currently support them? Please shed some light.
    Thanks
    Srini

    Not right now.
    But you can use the deploy as feature to develop reusable features that can be shared among applications.
    http://docs.oracle.com/cd/E35521_01/doc.111230/e24475/deploying.htm#CHDCGBIE

  • Components field not appearing in subcontract PO..

    Dear All,
    I am creating subcontracting PO but in material data tab "components" field is not apperaing.
    I have created BOM for this material already.
    What could be the reason/
    Amit.

    Hi,
    Check for Item Category "L" in the Item Overview.
    Best regards,
    Amit Bakshi

  • Programmatically adding declarative components (ADF 11g 11.1.1.5.0)

    Hi All,
    We have a number of declarative components that we are utilizing within our ADF implementation, I am trying to create one of those components in a similar fashion to how I create a Rich Input Text (for example)
    RichInputText text = new RichInputText();
    panelForm.getChildren().add(text);
    This doesn't seem to work if I replace the "RichInputText" with "MyDecComp" class, where the declarative component doesn't render. Is there any way to achieve the same outcome with the declarative component as the normal JSF / ADF component.
    Looking forward to your reply.
    Regards,
    Younis
    Edited by: Younis on 7/10/2011 09:01

    Are you talking about custom components?
    This will help you:
    Documentation
    http://download.oracle.com/docs/cd/E14571_01/web.1111/b31973/ad_custom.htmA Sample
    http://andrejusb.blogspot.com/2009/10/custom-declarative-components-in-adf.html- Prasad

  • How to declare currency field?

    DATA : V1 TYPE I,
    V2 TYPE I,
    RESULT TYPE P DECIMALS 2.
    how do i declare currency field here?

    In that case,refer to any of the currency fields of any of the database tables and refer to it like this:
    Data : Curr like aufk-waers.
    or from any other database table which contains the currency field.
    In case you have any further clarifications,do let me know.
    Regards,
    Puneet Jhari.

Maybe you are looking for

  • Not working on my MacBook

    I installed the toolkit on my MacBook but it crash at the startup. I don't know what can be the problem, but this is the error mesasage: Date/Time: 2007-10-02 10:31:36.668 +0200 OS Version: 10.4.10 (Build 8R2218) Report Version: 4 Command: newIDE Pat

  • DW5.5 crashing frequently (both 10.6.8 and 10.8.5)

    Hello. I'm having problems with Dreamweaver CS5.5 crashing frequently while I'm working. Sometimes I'm saving, sometimes I'm not even working in the program, but it is open in the background and it crashes. I've tried to research causes online, but I

  • Networking Roku Box to internal Airport Extreme Card

    Anyone? The Roku box recognized my iMac's wireless network, but it won't connect to my shared internet signal being broadcast by the iMac. Roku's forums are real hard to search in regards apple issues, as they just lump all networking together. THank

  • Can not use any remote desktop like VNC after installing Oracle Linux 6.3

    Hi I just installed OL 6.3 on a HP Proliant ML380 g7. Now I want to connect to the server using any Remote Desktop tools but I can not! I've activated system>pref>Remote Desktop But I can not access any of servers from: - a Mac using, Mac server shar

  • No sound for video files

    Got a mac desktop. Video files such as Youtube have no sound. Itunes play correctly so I know the speakers work. What could be wrong?