JSF Declarative Component - Using a method?

Hello. I'm creating a declarative component that has a submit button. I want the submit button to be defined, but I want the person using the component to define the action (ex, they specify which method from an AM to execute) How can I do this? I tried defining a method and setting the buttons action to comp.whatever. However, when the person defines the button and points the method to the binding layer, it can never located the method.
Thanks, Graeme.

Hi Shay, thanks for the response. I have read the tutorial. The only difference is in the tutorial it's executing a method on the view object. I need to execute a method on my application module. I defined it on my declarative component as:
<af:commandButton text="commandButton 1" id="dc_cb1"
actionListener="#{comp.submitRegistrationForm}"/>
As this kind of method attribute
<method-attribute>
<attribute-name>
submitRegistrationForm
</attribute-name>
<method-signature>
void submitRegistrationForm(oracle.jbo.ViewObject)
</method-signature>
<required>
false
</required>
</method-attribute>
Then I dragged in my custom component and defined my submit button as #{bindings.sendRegistration.execute} The sendRegistration is a method in my AM. I created a method binding for this as
<methodAction id="sendRegistration"
InstanceName="RegistrationAMDataControl.dataProvider"
DataControl="RegistrationAMDataControl"
RequiresUpdateModel="true" Action="invokeMethod"
MethodName="sendRegistration" IsViewObjectMethod="false"
ReturnName="RegistrationAMDataControl.methodResults.sendRegistration_RegistrationAMDataControl_dataProvider_sendRegistration_result">
<NamedData NDName="vo" NDValue="#{bindings.FirstName.attributeValue}"
NDType="oracle.jbo.ViewObject"/>
</methodAction>
However, everytime I hit the button I get an error the method does not exist. Method not found: UserRegistrationFormComponent[oracle.adf.view.rich.component.fragment.UIXInclude$ContextualFacesBeanWrapper@1572ca2, id=urf1].SubmitRegistrationForm(javax.faces.event.ActionEvent)
Is it possible to call this to my AM?
Thanks.

Similar Messages

  • JSF Declarative Component

    hi every body
    i am using Oracle Jdeveloper 11g release 2
    i wanted to create a Calendar Component
    for this i used JSF Declarative Component
    i added a RichInputText to page and a Button for opening calendar Dialog
    when for first time i open Calendar Dialog and select a day ,
    value of this day return to RichInputText truly but
    when i wanna to open it for second time that has an error
    error is:
    Error:dateValue is Read only
    i have to tell you dateValue is name of Attribute on JSF Declarative Component
    can anybody help me?

    i found a solution for this problem
    thanks

  • Declarative component are not accessable in page fragment

    Hi,
    I have created declarative component .. But it can access only in *.jsf page not in fragment page ...

    HI,
    Got it actually i have created declarative component using faclet (*.jsf) page...  If i create DC using .jspx page ...its working
    Thanks,
    Nitesh

  • Use of Methods in LSMW

    Hi Experts,
    I am trying to upload data into one of the custome table, ZTPT_DRIVER. And a method is created with ZCL_PT_Driver to upload the data using SE24.
    Can you please let me know, how can i upload data via LSMW into the custome table calling a method and also how to declare and use the method in LSMW?
    Many Thanks in Advance.
    Kris.

    in LSMW Direct input method is not possible for the zfields.
                   For this u have to choose Recording method.

  • Jsf datatable component + java.sql.SQLException

    I get the following error when implementing a JSF DataTable component using
    JDeveloper 10.1.3.1.
    javax.faces.FacesException: java.sql.SQLException: Io exception: Socket closed
    I am able to follow the article in this link:
    http://www.oracle.com/technology/oramag/oracle/06-jan/o16jsf.html
    I can get the table generated, but it occurred to me that the example in this article does not include logic to close the statement, resultset, and connection. Sure enough, I jumped out to the database and there were numerous inactive connections hanging around from my application.
    I added the following code before the return null statement from the article:
    finally {
    try {
    rs.close();
    stmt.close();
    c.close();
    catch (Exception e) {
    System.out.println("after close");
    So I need to know the proper procedure to closing the resultset, statement, and connection using a jsf datatable component.

    You need to make sure you're using the Oracle9i JDBC driver, or using the Oracle 8.1.7.2 JDBC driver as I mentioned above.
    If you are using JDeveloper9i release 9.0.2 or 9.0.3, the driver you need is in <jdevhome>\jdbc\lib
    Otherwise, you can also download the drivers from OTN.

  • Embedding a declarative component written in JSF 1.2 in a jsf page

    Hi ,
    I have a declarative component written in JSF 1.2 . I want to embed this declarative component in an ADF application which is using JSF 2.0.
    On creating a jspx page in JSF 2.0 & embedding decalrative component it just works fine but I have to embed it in a JSF page instead , which is not working.
    Any suggestions ?
    Thanks
    Vinit

    Hi,
    for JDeveloper 11g R2 you will need to know before whether the application you build uses JSPX page documents or Facelets. The technologies are different (introduced with JSF 2) and declarative components thus need to be build for the document type used by teh application
    Frank

  • How to use my Declarative Component in query component ???

    Hi everybody,
    I want to change inputDate in query component to my declarative component for Date fields. I did not find any way except implementing the Model of Query component so read "Web User Interface Developer’s Guide for Oracle Application Development Framework 11g Release 1 (11.1.1) " document and use the ADF Faces Demo Application. now I don't know can I change type of search component to my declarative component in DemoQueryBean class ??
    the code of oracle.adfdemo.view.query.rich.DemoQueryBean that I changed is :
    public static final ComponentType myDatecomponent=ComponentType.valueOf("myDate");
    private void _createPageDef()
    _pageDef = new DemoPageDef();
    _pageDef.addAttributeDef("Ename",
    "Employee Name",
    "Full name of the Employee [Last Name, First Name]",
    String.class,
    persianDate,
    false, null, true, true, true);
    As you can see I changeed type of Employee Name component to my Component but I see below exceptions :
    ]] Root cause of ServletException.
    java.lang.ExceptionInInitializerError
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         Truncated. see log file for complete stacktrace
    java.lang.IllegalArgumentException: No enum const class oracle.adf.view.rich.model.AttributeDescriptor$ComponentType.myDate
         at java.lang.Enum.valueOf(Enum.java:192)
         at oracle.adf.view.rich.model.AttributeDescriptor$ComponentType.valueOf(AttributeDescriptor.java:121)
         at oracle.adfdemo.view.query.rich.DemoQueryBean.<clinit>(DemoQueryBean.java:52)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         Truncated. see log file for complete stacktrace
    >
    I think these exceptions happend because of there is not any constant of AttributeDescriptor$ComponentType in ComponentType class for myDate component.
    I try to create a class and extends ContentType and add my component type to it but I can't. is there any way for solving this problem ?
    please help me :(
    Thanks.

    Hi,
    saying it this way: There is no native option to do this. Since I never tried hacking into the framework classes, I can't say if there is a glimpse of hope for you
    Frank

  • Persisting Declarative Component attributes using MDS

    Hi,
    I have created a Declarative Component with some custom attributes.
    Is there a way to persist the component attributes using MDS or by some other means.
    Thanks
    Prahlad

    Hi Krithika,
    Thank you for your answer. I decComp is null only if I try this code in the binding method. If I define a popupFetchListener and bind to a method in a managed bean, decComp is not nut. I don't know how to get attribute values and create my UIComponent programatically.
    Does anyone know how to achive that?
    Regards
    Joseba

  • ADF Faces Declarative Component onLoad event call Backing Bean Method

    Hello.
    We are trying to implement a declarative component, that will be used as Flex Fields for our application, ie, the components will be created dynamically through a database configuration, and who is responsible for organizing and creating the components, is the declarative components, and its own backing bean.
    The declarative component, will receive a List of custom components, and with this list it is possible to create the components dynamically. We want the components to be created as soon as the page is loaded. The developer could place this declarative component in any region of his page, and even in another tab if he wishes. The problem is, that we cannot register a load event in the declarative component, since it doesn't have a document Object, to call the declarative components backing bean method that is responsible for creating components.
    How could we simulate the onLoad (of the declarative components) so that the backing bean method (responsible for creating component, and putting it in the view tree) could be called ?
    I've tried with a RENDER_RESPONSE phaseListener, but the beforePhase has no objects in the tree, and the afterPhase has already rendered to the client.
    Any ideas on how to achieve this ?
    Thanks a lot.
    Regards,
    John

    Hi Frank, thanks for the response.
    I'm curious about the dynamic declarative component. Any place I could check it out ?
    Back to my scenario. I'll try to be more clear to what we need!
    We have to have dynamic creation of components, based on a database configuration. This will allow our customers to have custom flex fields, without the need of us developing custom pages for each customer.
    One solution we are trying out, is the declarative component. Why ? Because the developer (when developing the page), knows that this specific page, is possible of customization by the client (custom flex fields). With this, the developer would choose where on his page the custom flex fields will be placed. Note that at this point (design time), no component (input, buttrons, etc) is created. The idea of the declarative component, is just so the Developer knows where he wants the custom fields placed in his page (a tab, below the form fields, in a another panel group, and so on). The declarative component, has only a container, PanelFormLayout, and no other component.
    What we want, is a way of calling our managed bean (the managed bean of the declarative component, that now I did configure it in the adfc-config.xml file , thanks for the tip) method, that's responsible for creating the custom components. The declarative component, receives a list of all the custom fields that needs to be created, at design time, through an attribute. The developer is responsible for setting this list when he drags the declarative component on his page.
    Now that I've put the declarative components managed bean in the adfc-config.xml file, the @PostConstruct is called correctly, but I still have a problem. At this moment (postContstruct call), my component PanelFormLayout (that is binded to the managed bean), is null. So I cannot add any component to the PanelFormLayout.
    Am I way out of line here Frank ?
    Really appreciate your comments.
    Thanks a lot.
    John

  • More than one instance of same Declarative Component in a single JSF page

    Hi,
    I have problem in using more than one instance of same Declarative Component in a single JSF page.
    Only one instance is visible/rendered.
    If I drag and drop more than one instance of same Declarative Component in a single JSF page, only one is displayed.
    Not sure why is so....have I missed on some configuration?

    What version of JDeveloper are you using? What declarative component?
    In general when creating JSF UI components, care must be taken to avoid certain pitfalls that happen when one uses that component more than once in a page...so depending on which component you are using, one might surmise that more or less care was taken on that component when building it.
    If it was well tested though...like if it was an ADF Faces component, then that is probably not the problem.

  • How to use the method "getChildrenRemoved()" declared in ElementChange?

    How to use the method "getChildrenRemoved()" declared in DocumentEvent.ElementChange?

    I have tried to use it,but the code below alway say "Yes"....
    I really have no ideas about why ec is always a null.
    public void removeUpdate(DocumentEvent ee) {
           DocumentEvent.ElementChange ec = ee.getChange(doc.getDefaultRootElement());
           if(ec == null)
              System.out.println("Yes");
                     }

  • Javascript enabling and using JS methods on TextEdit component

    Hello Friends:
    I am working to display data using TableView component.
    In each row, one of the cell contains a group of radio
    buttons and an other cell contains TextEdit component.
    For an event on the group of radio buttons, the TextEdit
    should flip editable to non-editable and vice-versa.
    I am using the TextEdit attribute method,
    <b>setJsObjectNeeded(true)</b>
    to expose the JavaScript methods of the component.
    I am using the following bits of code for accessing the
    TextEdit JavaScript functionality.
    var funcName = htmlb_formid+"_getHtmlbElementId";
    func = window[funcName];
    var text_edit_comp = eval(func(id_of_textedit));
    <b>text_edit_comp.setEnabled()</b>;
    Whole thing works as planned, but it is not possible to
    disable or enable the TextEdit component using the
    JavaScript, as shown above.
    In the portal documentation, the JavaScript object
    methods were mentioned only for certain components, NOT
    including TextEdit !!
    If I replace TextEdit with InputField, it works perfectly
    as like needed.
    How to hack it to work for TextEdit ?
    Thank you very much for your kind answers.
    Prasad Nutalapati

    I did use the suggestion. No use.
    When I say,
    var textedit = eval(func("<id-of-the-textedit-from-java"));
    I am getting the object reference.
    When I say,
    <b>var id = textedit.id;
    var elem = document.getElementById(id);</b>
    I am getting the HTML name/id and object of the text edit.
    Now when I use JS methods and properties,
    alert("type="+elem.type);
    alert("name="+elem.name);
    I get them back correctly.
    Then when I say,
    <b>alert("disable ?"+ document.forms[0].elements[elem.name].disabled;</b>
    I am getting answer as 'false' which is not correct. It
    is initially disabled, when I defined with Java.
    And subsequently, when I say,
    <b>document.forms[0].elements[elem.name].disabled = false;</b>
    It didn't affect it at all.
    If I try to use the JS methods provided by Portal, like..
    <b>textedit.setEnabled();</b>
    It is giving an JS error saying that the object doesn't
    have that method.

  • 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

  • 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");

  • Dynamic Declare Component cannot find property

    We currently have one main page calls a DDC(Dynamic declarative component) page fragment to create/update a record in database. The main page pass in a key to DDC when it loads DDC. The DDC binds to a view object with bind variable (get value from the passed key and load data from table) and several LOV attributes. Once user clicks submit button in main page, we wish that all the fields displayed in DDC could be committed to a database table to save.
    I use 11.1.1.5.
    In order to assign the bind variable of VO, we wrote a method in Application Module and make it invoked as the first executable when the main page is loaded. The deployment is fine. However, the runtime always thrown some exception to complain it cannot find property definition like this:
    ####<Aug 15, 2011 6:32:24 PM CDT> <Warning> <oracle.adfinternal.view.faces.lifecycle.LifecycleImpl> <curmailts1-corp> <AdminServer> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <6b1af60b3a40d50a:-6c52e935:131cfc2d522:-8000-000000000000024c> <1313451144494> <BEA-000000> <ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6
    javax.el.PropertyNotFoundException: Target Unreachable, 'WorkDescription' returned null
         at com.sun.el.parser.AstValue.getTarget(Unknown Source)
         at com.sun.el.parser.AstValue.isReadOnly(Unknown Source)
         at com.sun.el.ValueExpressionImpl.isReadOnly(Unknown Source)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:486)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.cacheReadOnly(EditableValueRenderer.java:416)
         at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.beforeEncode(LabeledInputRenderer.java:128)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:334)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    Questions: 1) Why my method in Application Module not called?
    2) Whether DDC is a right solution for our use case? Any suggestion or sample are welcomed!
    Thanks,

    Hi,
    I appreciate if you can show your code, but before that, make sure if you're following this tip below:
    "Declarative Components are regular JSF components except that they are built as a composite out of existing ADF Faces components. Declarative components cannot have a PageDef file associated with it and instead use value or method attribute to communicate with the consuming page. When creating a declarative component, the attrs implicit object is defined that allow you to reference the component's exposed value attribute from ADF Faces components within.
    An input text field contained in an declarative component may reference a value attribute "compValue" defined on the declarative component by using the following EL
    #{attrs.compValue}
    The declarative component compValue attribute then would us an EL reference like shown next to read/write values from or to the ADF binding layer:
    #{bindings.attribute_name.inputValue}"
    (Oracle ADF Code Corner)
    Regards,

Maybe you are looking for

  • Mini Displayport to DVI Adapter not sending signal to DVI Monitor

    I have a dell monitor connected to my Thunderbolt Display that will not get a signal.  The component string looks like this MBP - Thunderbolt Display- Mini Displayport to DVI adapter- Dell 22" DVI monitor. I would like to use this monitor as a third

  • PI 7.1 in a cluster environment (multiple ip-adresses): P4 port

    We want to  install PI 7.1 on unix in a cluster environment.Therefore we  installed also DEV+QA with virtual hostnames like the prodsystem, which will be later installed. At all sapinst installation screens we have used only the virtual hostname <vir

  • Powerpoint 2013 causes IExplore to crash when previewing an embedded youtube video

    Powerpoint 2013 causes IExplore to crash when previewing an embedded youtube video As a user with "local administrator" or "Power User"privileges the video previews the video plays, but as a normal user the following error occurs. Internet Explorer h

  • Adding a Terminal Variable

    Hello, I want to count the number of times an event occurs, and using that count I will derive the data I need. That is, the counter serves as an 'intermediary' variable. How do I add and intialize a variable without having to add a front-panel item?

  • HD problem after connecting to new Mac Pro

    Went to our first MUG meeting of the years tonight. And took along my Lacie 500gig firewire external H/D. This was going to be used to demo the new iTunes 7 app. The computer being used was a new Mac Pro duo core intel etc. When I plugged the H/d in