Can't reference methods in a Bean from a Composite JSF Component.

I have the following composite component TestCC.xhtml:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
xmlns:cc="http://java.sun.com/jsf/composite" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<cc:interface>
<cc:attribute name="manager" method-signature="java.lang.String helloTest()" required="true"/>
</cc:interface>
<cc:implementation>
Hello #{cc.attrs.manager} !!!!!!!!!!!!!!!!!!!!!
</cc:implementation>
</html>
When I try to call it in a JSFF file:
<?xml version='1.0' encoding='UTF-8'?>
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:icc="http://java.sun.com/jsf/composite/IchipComponent">
<icc:TestCC manager="#{viewScope.PatientClinicalBean.helloTest}"/>
The page crashes at my composite tag with the following message in the console:
javax.el.ELException: //C:/Documents and Settings/tlam/Application Data/JDeveloper/system11.1.2.3.39.62.76.1/o.j2ee/drs/iCHIP/ViewControllerWebApp.war/WEB-INF/classes/META-INF/resources/IchipComponent/TestCC.xhtml: javax.el.PropertyNotFoundException: //C:/Documents and Settings/tlam/Application Data/JDeveloper/system11.1.2.3.39.62.76.1/o.j2ee/drs/iCHIP/ViewControllerWebApp.war/Patient/Profile/Clinical.jsff @13,86 manager="#{viewScope.PatientClinicalBean.helloTest}": The class 'patient.profile.PatientClinicalBean' does not have the property 'helloTest'.
But my managed bean does have a public String helloTest() method, as well as other methods that work fine elsewhere in my JSFF page:
public class PatientClinicalBean{
String test = "TESTING";
public String helloTest() {
return test;
I have tried this many times with different methods, all with the same result. Yet if my composite component outputs just a string and I enter the expression <icc:TestCC manager="#{viewScope.PatientClinicalBean.test}"/> to access the String test field directly it executes properly. I can't seem to reference any of the methods in PatientClinicalBean from only my composite component, when other method calls work fine in the same JSFF page. All other examples I've seen on the web have no problems doing this the same way I have, am I missing something?!
Edited by: tnology on 24-Oct-2012 14:13
Edited by: tnology on 24-Oct-2012 14:14
Edited by: tnology on 24-Oct-2012 14:16

What if you change the method in the class like this?
public String getHelloTest() {
  return test;
}If you attempt to read a property call abc from a bean, you need to have a method called getAbc(). If you attempt to set a property called abc, you need to have a method called setAbc(...). This is JavaBeans convention.

Similar Messages

  • How can I use Method in the bean

    Hi every one
    please I made a method in for example employees entity "EmployeesImpl"
    the name of method getmax() it return number
    how can I use it at the bean
    for eaxmple when I want to press button give me the value from this method
    sorry Iam still beginner
    thanks in advance

    Thanks sir for your response
    my version
    oracle jdeveloper reales 1 (11,1,1,4,0)
    I use business component
    I make method
    this metod wrote at enitity "EmployeesImpl"
    public Number getMax() throws JboException
    PreparedStatement stat=null;
    ResultSet rs=null;
    try {
    String sql="select max(EMPLOYEE_ID)+1 from EMPLOYEES";
    stat=getDBTransaction().createPreparedStatement(sql, 1);
    rs=stat.executeQuery();
    if (rs.next()) {
    return new Number (rs.getInt(1));
    } catch (Exception e) {
    // TODO: Add catch code
    //e.printStackTrace();
    throw new JboException("error");
    } finally {
    try {
    rs.close();
    stat.close();
    } catch (Exception e) {
    // TODO: Add catch code
    //e.printStackTrace();
    // oracle.jbo.domain.Number
    return new Number (1);
    I made a jsf page
    and I put button at the page
    I want when press the button give me message contain the number which come from previous metod
    thanks my dear

  • Cannot get reference to a managed bean from another

    After reading one of BlausC article:
    http://balusc.blogspot.com/2006/06/communication-in-jsf.html#AccessingAnotherManagedBean
    I always get null when I try to get a reference to a session scoped managed bean from a current bean:
    Here is part of the faces context config file:
    <faces-config>
    <managed-bean>
      <managed-bean-name>approvalManagementBean</managed-bean-name>
      <managed-bean-class>com.waseel.waseele.presentation.approval.management.ApprovalManagementBean</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      <managed-property>
      <property-name>configService</property-name>
      <property-class>com.waseel.waseele.business.config.ConfigService</property-class>
       <value>#{configService}</value>
      </managed-property>
      <managed-property>
       <property-name>approvalService</property-name>
       <property-class>com.waseel.waseele.business.approval.ApprovalService</property-class>
       <value>#{approvalService}</value>
      </managed-property>
      <managed-property>
       <property-name>claimManagementService</property-name>
       <property-class>com.waseel.waseele.business.claim.management.ClaimManagementService</property-class>
       <value>#{claimManagementService}</value>
      </managed-property>
      <managed-property>
       <property-name>codedValuesLoaderServices</property-name>
       <property-class>com.waseel.waseele.business.claim.extraction.loader.codedValuesLoader.CodedValuesLoaderServices</property-class>
       <value>#{codedValue}</value>
      </managed-property>
      <managed-property>
       <property-name>approvalSubmission</property-name>
       <property-class>com.waseel.waseele.business.approval.submission.ApprovalSubmission</property-class>
       <value>#{approvalSubmission}</value>
      </managed-property>
      <managed-property>
       <property-name>payerTpaRelationService</property-name>
       <property-class>com.waseel.waseele.business.payerTpaRelation.PayerTpaRelationService</property-class>
       <value>#{payerTpaRelationService}</value>
      </managed-property>
    <managed-property>
    <property-name>payerTpaFiller</property-name>
    <property-class>com.waseel.waseele.business.payerTpaRelation.PayerTpaFiller</property-class>
    <value>#{payerTpaFiller}</value>
    </managed-property>
    </managed-bean>and part of my code:
    public String displayApprovalInEditMode()throws Exception{          
              //This is cross-managed been access; I  need to get the current Approval in the approval management been
              ApprovalManagementBean appMangBean=(ApprovalManagementBean) FacesContext.getCurrentInstance()
                                                      .getExternalContext().getSessionMap().get("approvalManagementBean");What possible problems may be?
    Can any one tell when these session managed beans object get created? is it at start up? or when loading a JSF page that use a bean ?
    becasue this code work in places while not in another

    You must be doing something wrong. I cannot reproduce this problem with the following SSCCE on JSF 1.2_13 at Tomcat 6.0.20.
    Bean1package mypackage;
    public class Bean1 {
        private Bean2 bean2;
        public boolean isBean2Present() {
            return bean2 != null;
        public Bean2 getBean2() {
            return bean2;
        public void setBean2(Bean2 bean2) {
            this.bean2 = bean2;
    }Bean2package mypackage;
    public class Bean2 {
    }JSF<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <f:view>
        <html>
            <head>
                <title>Test</title>
            </head>
            <body>
                <h:outputText value="Is bean2 present? #{bean1.bean2Present ? 'yes' : 'no'}" />
           </body>
        </html>
    </f:view>faces-config<?xml version="1.0" encoding="UTF-8"?>
    <faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
        version="1.2">
        <managed-bean>
            <managed-bean-name>bean1</managed-bean-name>
            <managed-bean-class>mypackage.Bean1</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
            <managed-property>
                <property-name>bean2</property-name>
                <value>#{bean2}</value>
            </managed-property>
        </managed-bean>
        <managed-bean>
            <managed-bean-name>bean2</managed-bean-name>
            <managed-bean-class>mypackage.Bean2</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
    </faces-config>It prints 'yes'.

  • How can I reference value of a field from a diffrent line in formatted search

    I want to use a formatted search for this
    I want to set a field value based on a value from a previous row. ( is this possible at all ?)
    I have a udf called Test at Line Level on AR Order
    The user enters a value for test on line 1
    he will have a lot more lines then after that. all I want is to copy the value in test ( on row 1) to row2 as the user edits say the Item code on that row.

    Hi,
    Unfortunately formatted search is for current line only , you can't reference the previous or next line .
    You can do achieve this with SDK but with FMS not possible .
    Regards

  • Can I Call method on one JVM from another through a dll?

    Let me explain.
    I have this java jar file that I can only have one instance of running at any given time. I'm using a shared data segment in a dll to store a bool indicating whether the program is already running or not. If it's already running, I have to not run the second instance and give focus to the current running instance.
    The jar file calls a native method "canInstantiate()" on a dll to see if there's already an app running. If there isn't, the env and obj are stored in the shared data segment of the dll and we return true. If there is already an instance of the program running, I want canInstantiate call a function on the current instance of the jar (like a callback) to tell it to request focus. It's not working. Can someone tell me if my code is right?
    The .h file
    #include "stdafx.h"
    #include <jni.h>
    #include "CardServer.h"
    #pragma data_seg("SHARED") // Begin the shared data segment.
    static volatile bool instanceExists = false;
    static JavaVM *theJavaVM = NULL;
    static JNIEnv* theJavaEnv= NULL;
    static jobject instanceObject = NULL;
    static jmethodID mid = NULL;
    static jclass cls = NULL;
    #pragma data_seg()
    #pragma comment(linker, "/section:SHARED,RWS")
    jdouble canInstantiate(JNIEnv *env, jobject obj);
    jdouble instantiate(JNIEnv *env, jobject obj);
    jdouble uninstantiate(JNIEnv *env, jobject obj);
    void grabFocus();
    </code>
    The .cpp file:
    <code>
    #include "MyFunctions.h"
    #include <string.h>
    #include <stdlib.h>
    #include "stdafx.h"
    #include <iostream.h>
    jdouble canInstantiate(JNIEnv *env, jobject obj)
    printf("In canInstantiate!!");
    if (!instanceExists)
    printf("No instance exists!!");
    return (jdouble)0.0;
    else
    printf("An instance already exists!!");
    grabFocus();
    return (jdouble)1.0;
    jdouble instantiate(JNIEnv *env, jobject obj)
    printf("**In CPP: Instantiate!!\n");
    cout << "At start, env is: " << env << endl;
    cout << "At start, obj is: " << obj << endl;
    if (instanceExists == false)
    instanceExists = true;
    theJavaEnv = env;
    instanceObject = obj;
    theJavaEnv->GetJavaVM(&theJavaVM);
    cls = (theJavaEnv)->FindClass("TheMainClassOfTheJar");
    if (cls == 0) {
    fprintf(stderr, "Can't find Prog class\n");
    exit(1);
    mid = (theJavaEnv)->GetMethodID(cls, "grabFocusInJava", "(I)I");
    if (mid == 0) {
    fprintf(stderr, "Can't find grabFocusInJava\n");
    exit(1);
    printf("About to call grabFocusInJava\n");
    grabFocus();
    printf("CPP: After the grab focus command in instantiate!!\n");
    cout << "At end, env is: " << env << endl;
    cout << "At end, obj is: " << obj << endl;
    return 0.0;
    else
    printf("CPP: Finished Instantiate!!\n");
    return 1.0;
    jdouble uninstantiate(JNIEnv *env, jobject obj)
    printf("CPP: In uninstantiate!!\n");
    if (instanceExists == true)
    instanceExists = false;
    theJavaVM = NULL;
    instanceObject = NULL;
    printf("CPP: Finishing uninstantiate!!\n");
    return 0.0;
    else
    printf("CPP: Finishing uninstantiate!!\n");
    return 1.0;
    void grabFocus()
    printf("In CPP::GrabFocus!!\n");
    instanceObject = theJavaEnv->NewGlobalRef(instanceObject);
    cls = (theJavaEnv)->FindClass("CardFormatter");
    if (cls == 0) {
    fprintf(stderr, "Can't find Prog class\n");
    exit(1);
    printf("Got the cls id again!!\n");
    if (cls == 0)
    printf("IT'S INVALID!!\n");
    mid = (theJavaEnv)->GetMethodID(cls, "grabFocusInJava", "(I)I");
    if (mid == 0) {
    fprintf(stderr, "Can't find grabFocusInJava\n");
    exit(1);
    theJavaEnv->CallIntMethod(instanceObject, mid, 2);
    printf("Called grabFocusInJava\n");
    </code>
    thanks in advance

    Can I Call method on one JVM from another through a dll
    ...The rest of your question merely expands on your title.
    And the answer to that question is no.
    When you call a method you are executing a "thread of execution." A thread of execution exists only in a single process. It can not exist in another process.
    If the dll is doing some interesting things then you could call a method that sets a flag. Data can move between instances. But you would then have to have a thread in that different process monitoring that flag. And sharing data in a dll is not a normal process, so it would have to be coded appropriately.
    If all you want to do is set the current focus to the existing application, then that can be done with existing windows functionality. You don't need to do anything special in your dll. You can probably search these forums to find the exact code. If not there are countless examples in windows repositories (like MSDN) on how to do that.

  • Error calling Method on Managed Bean from another Managed Bean

    Hi
    (Jdev 11.1.1.2.0)
    Help please:
    I have a managed bean (page flow scope) which is used by my main page for dynamic region flow navigation:
    *public class RegionNavigationBean implements Serializable{*+
    private String dynamicTaskFlowId = "/WEB-INF/home-task-flow-definition.xml#home-task-flow-definition";+
    *public RegionNavigationBean() {*+
    *public TaskFlowId getDynamicTaskFlowId() {*+
    return TaskFlowId.parse(dynamicTaskFlowId);+
    *public void setDynamicTaskFlowId(String taskFlowId) {*+
    this.dynamicTaskFlowId = taskFlowId;+
    taskFlowId property on main page def is set to +*${pageFlowScope.regionNavigationBean.dynamicTaskFlowId}*+
    In a DB table (i.e. View Object on my model layer) I store a menu ID and a corresponding task_flow_id.
    Then I have created an action listener class (RegionNavigationListener - page flow scope) which I link to my menu items on my main page (action listener property on menu item = +*#{pageFlowScope.regionNavigationAction.processAction}*+ )
    In this action listener (processAction method), I retrieve the row set from the menu VO and find the record which matches my menu ID which caused the action event, thereby retrieving the task_flow_id which must be navigated to.
    I then try to retrieve the instance of the RegionNavigationBean with the following statement: RegionNavigationBean regNav = (RegionNavigationBean)JSFUtils.getManagedBeanValue("regionNavigationBean");+
    This seems to work fine, but as soon as I try and use this I get NullPointerException error, e.g.:
    regNav.setDynamicTaskFlowId(menusRow.gettaskFlowId());+
    or even:
    System.out.println("%%% " + regNav.toString());+
    This is all quite new to me... any help would be appreciated!
    Thanks
    Mario

    Hi Mario,
    I think JSFUtils.getManagedBeanValue(String) has difficult to evaluate the "regionNavigationBean" managed bean.
    What JSFUtils.getManagedBeanValue(String) do is important. I remember that "JSF scoped" bean can be found by JSF style find method, such as requestScope, sessionScope, applicationScope. For a managed bean put in these scope, scope prefix is not needed, for example: using #{beanName} to locate a requestScope bean. The #{requestScope} prefix is not needed.
    But pageFlowScope is different. If a bean is put in the pageFlowScope, you must use #{pageFlowScope.beanName} to locate it.
    Say, ManagedBean is the java class of your manged bean.
    FacesContext ctx = FacesContext.getCurrentInstance();
    Application app = ctx.getApplication();
    ManagedBean mb = (ManagedBean)app.evaluateExpressionGet(ctx, "#{pageFlowScope.managedBeanName}", ManagedBean.class);
    Hope it helps.
    Todd
    Edited by: Todd Bao on Nov 26, 2009 9:58 PM

  • Just changed hardrives on my computer. How can I reference my photos and backups from my old HDD?

    I just switched my HDD for a SDD on my laptop. All files on my old HDD are still intact, the backups and photos are all in the same place. I will be using the HDD as an external hardrive. What is the best way to reference my photos and backups in lightroom that I reinstalled on my SDD?

    I do apologize if I am still missing what I am supposed to follow on that
    link, but I don't think it applies to me.I may not have explained fully
    what I am trying to accomplish. I have a laptop computer, I replaced my HDD
    with an SSD then I replaced my my optical drive with my old HDD. I am
    storing all of my software and OS on the SSD, so i reinstalled creative
    cloud and lightroom on the SSD. I am storing all of my documents on my hard
    drive. So right now when I open lightroom on my new SSD there are no
    pictures, because its a fresh install of the software on my new rive. On my
    HDD i still have all of my photos, backups, and even software. I am in the
    process of deleting the OS and software off of the HDD and software files.
    Before I do that I want to make sure that I have transferred everything
    that I am going to need. How can I get my pics on my new version of
    lightroom? Thanks again for the help.

  • How can I reference an external help file from context sensitive help at the control level?

    My goal is to provide context sensitive help for each control displayed on the front panel using a help file created externally. I know that at the VI level I can specify a Help Path; I want the same behaviour for each control inside a VI. I also know about creating a custom control and specifying the Help Path in there, but it doesn't help in this situation, for I have hundreds of controls in my application and I cannot go back and replace each one with a unique .ctl. If I could override each instance of the custom control with unique path data that would do the trick, but that's not how it works.
    Is there a way to add the Help Path information to regualr controls?
    -euge
    ne

    This functionality is not yet built into LabVIEW.
    About all you can do is cut and paste the help for each control into the description for the control. It is tedius but a finite task.

  • How can I call a ABAP proxy class from BADI? PLease help

    hi Experts,
        I have a scenario where I have to call a ABAP proxy class from a BADI. How can I do this? Does anybody has sample code for the same?
    Please help.
    Thanks
    Gopal

    Hi,
       You can call a method of a class from BADI. Here are the steps.
       1) In the BADI implementation create a object for the proxy class.
       2) Call the Execute_Synchronous method.
        You can define a BADI by using SE18 and you can implement it by using SE19.
    Sample code...
    ================================================
      METHOD ZIF_EX_VBADI~CONVERTUPPER.
      DATA: OBJ TYPE REF TO ZTESTCLASS.
      DATA: IT_DATA  TYPE ZIN_MT,
                IT_RES   TYPE ZOUT_MT,
                SEXCEPTION TYPE REF TO CX_AI_SYSTEM_FAULT.
      TRY.
          CREATE OBJECT OBJ
             EXPORTING
                 LOGICAL_PORT_NAME = 'TESTPORT'.
      CATCH CX_AI_SYSTEM_FAULT INTO SEXCEPTION.
      ENDTRY.
    ENDMETHOD.
    ================================================
    Thanks,
    Vivek LR

  • Call a method in the view from Component Controller

    Hi Friends,
    I have written the code for calling the RFC in Component Controller.
    My requirement is to change the properties of UI elements in the view, if I get any exception while calling RFC.
    Can Call a method in the view from Component Controller.
    Regards,
    Lakshmi Prasad.

    HI,
    You can get the error message during the exception of calling RFC in view itself.
    Any way you may call the RFC at some action in the view only.
    Can you explain me what you are trying to do?
    Kind Regards,
    Mukesh

  • DataGrid SelectedIndices from a different MXML component

    Hello
    I am refreshing a data grid that resides in my main component, from a sub-component. This works if I invoke the web service method to rebind the dataprovider, and I do not reference the datagrid directly from the sub component.
    My trouble is that I use checkboxes in my datagrid. I need to reset the selectIndices of the datagrid, but anytime I try to reference the datagrid directly it is NULL. The datagrid loses its checkbox selections every time I call the refresh, so I must explicitly reset the selectedIndices.
    How can I reset the datagrid's selectedIndices from a different MXML component? Why is my datagrid always NULL in my web service's result event handler?
    How can I directly reference my main component's datagrid, from my sub-component?

    Hi Devtron,
    You can figure this out by using events..
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onCreationComplete();" xmlns:comp="comp.*">
    <mx:Script>
      <![CDATA[
       private function onCreationComplete():void
        comp2.addEventListener("refreshGridEvent",refreshGrid);
       private function refreshGrid(event:Event):void
        comp1.dataGrid.dataProvider = null;
      ]]>
    </mx:Script>
    <comp:Component1 id="comp1" />
    <comp:Component2 id="comp2" />
    </mx:Application>
    Now in your Component2 dispatch the refreshGridEvent event either on a button click or when your UI elements changes based on your requirement...this.dispatchEvent(new Event('refreshGridEvent')); and listen for the evet in manin mxml file and change the dataProvider of the dataGrid in Component1.
    Note: This solution is if your both components are placed in the main mxml file. Is your structure is same as I mentioned in the code above..I mean
    whether your two components are placed in the main mxml file.
    Thanks,
    Bhasker

  • How to insert and view images from oracle using jsf

    Can anyone please give me some code example or link of article explaining that how can i insert and view images to/from oracle using jsf?
    Thanks in advance.

    You mean you want to view image data stored in the database, right?
    Create a servlet that streams the image data to the response (setting the appropriate content-type), then reference this servlet in your img tag. Here is an example:
    http://balusc.blogspot.com/2007/04/imageservlet.html
    Storage is something different. What exactly don't you understand there? Perhaps you want a file upload component?

  • Is it possible to call a custom method in App Module from a backing bean?

    I would like to know if a custom method in App Module can be called from inside a backing bean.
    I am not sure if it is logically right to call, from a backing bean, a custom method in App Module. But would like to know if that makes sense or if it is possible.

    Hi..
    Yes it is possible.You have to add that method for client interface of AppModule.Now you can see that method in Data Controls(Refresh the data control). To call this method using bean it should add as method action to bindings(Click Bindings>+>methodAction>and Create action binding).
    Now you can call this method in bean class.
    Check following example use this concept to execute view criteria
    http://adf-lk.blogspot.com/2011/05/oracle-adf-create-view-criteria-and_4727.html

  • How can I set the value to a session bean from backing bean

    Hi Experts,
    How can I set the value to a session bean from backing bean where I have created getter and setter
    methods for that variable.
    Basically I am using ADFUtils class where I am able to get the value from session bean
    using following expression
    String claimType =
    (String)ADFUtil.invokeEL("#{ClaimValueObj.getClaimType}");
    Thanks
    Gayaz

    Gayaz,
    Wrong Post !!
    Post in JDeveloper and ADF
    Thanks
    --Anil                                                                                                                                                                                                                               

  • How to call a method in bean from application module Impl?

    i have to call a method which is in a bean from AppmoduleImpl class. Is it possible ?

    The model layer should never depend on a specific view layer - this breaks reusability.
    What you need to do is expose a service method on your AM. Then your view can call this method and pass a parameter into the model layer.

Maybe you are looking for