ADF - managed bean error in dynamic menu creation

scenario:
to create dynamic menu for two tabs : general..
general has a subtabmenu in form of menubar wid items: country, city,...
i created dynamic menus for my application.wen i ran my page i got this error:
SEVERE: Managedbean menuItem_General could not be created Can't get value from value binding expression:
'#{resources['erms.menu.gen']}'
(erms.menu.gen is an entry in UIResources.properties)
now, i followed the exact same process as mentioned in the SRDemo application, in adfdevguide!
double checked that
i. resource adapter is configured in faces-config.
ii.menu model and menuTreeModel are configured with thier default adapaters in faces-config.
iii.resource bundle specified in jsp page.
can sum1 plz refer
1.wat is the reason of this error? wat are the things dat shud hold true in order to run these dynamic menu? which files shud
b specified where?
2. in wat order are the managedbeans created ?
is it in order they apprear in faces-config file or in order they are used in the jsp page?
3: is it possible that u click on a menuTab item and it displays its particular menubar's items while staying on the same page? or
u click on a menubar item and it displays its particular dropdowns while staying on the same page?
is it posible wid ADF or javascript shud b used?

Hi,
looking at code it seems that you are adding textview and inputfield. please check in debugging if the correct context node/attribute  is being created and you are providing its reference while adding UI elements.
Thanks,
Chandra

Similar Messages

  • Management Bean Error

    Dear All
    I create 2 page
    1- login and login display
    2 - in adfc-config i change scope from BackingBean to session
    i got this error
    javax.el.PropertyNotFoundException: //C:/Users/Waleed/AppData/Roaming/JDeveloper/system11.1.2.1.38.60.81/o.j2ee/drs/Application2/ViewControllerWebApp.war/Loginx.jsf @4,85 binding="#{backingBeanScope.Loginx.d1}": Target Unreachable, 'Loginx' returned null
    my jdeveloper is
    11.1.2.1

    thx very much for your qucik replay
    can you tell me where i can change {Loginx.d1}
    my adfc-config
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <view id="Loginx">
        <page>/Loginx.jsf</page>
      </view>
      <view id="LoginDisplay">
        <page>/LoginDisplay.jsf</page>
      </view>
      <control-flow-rule id="__4">
        <from-activity-id>Loginx</from-activity-id>
        <control-flow-case id="__5">
          <from-outcome>m1</from-outcome>
          <to-activity-id>LoginDisplay</to-activity-id>
        </control-flow-case>
      </control-flow-rule>
      <managed-bean id="__2">
        <managed-bean-name>Loginx</managed-bean-name>
        <managed-bean-class>view.backing.Loginx</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        <!--oracle-jdev-comment:managed-bean-jsp-link:1Loginx.jsf-->
      </managed-bean>
      <managed-bean id="__3">
        <managed-bean-name>LoginDisplay</managed-bean-name>
        <managed-bean-class>view.backing.LoginDisplay</managed-bean-class>
        <managed-bean-scope>backingBean</managed-bean-scope>
        <!--oracle-jdev-comment:managed-bean-jsp-link:1LoginDisplay.jsf-->
      </managed-bean>
    </adfc-config>and my loginx.jsf is
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
        <af:document title="Loginx.jsf" id="d1" binding="#{backingBeanScope.Loginx.d1}">
            <af:form id="f1" binding="#{backingBeanScope.Loginx.f1}">
                <af:commandButton text="commandButton 1" id="cb1" binding="#{backingBeanScope.Loginx.cb1}" action="m1"/>
            </af:form>
        </af:document>
        <!--oracle-jdev-comment:auto-binding-backing-bean-name:Loginx-->
    </f:view>and mu loginx.java is
    package view.backing;
    import java.util.HashMap;
    import java.util.Map;
    import oracle.adf.view.rich.component.rich.RichDocument;
    import oracle.adf.view.rich.component.rich.RichForm;
    import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
    import oracle.binding.AttributeContext;
    import oracle.binding.DataControl;
    import oracle.binding.ManagedDataControl;
    import oracle.binding.OperationBinding;
    import oracle.binding.RowContext;
    import oracle.binding.TransactionalDataControl;
    import oracle.binding.UpdateableDataControl;
    public class Loginx implements TransactionalDataControl, UpdateableDataControl, ManagedDataControl {
        private RichForm f1;
        private RichDocument d1;
        private RichCommandButton cb1;
        public void setF1(RichForm f1) {
            this.f1 = f1;
        public RichForm getF1() {
            return f1;
        public void setD1(RichDocument d1) {
            this.d1 = d1;
        public RichDocument getD1() {
            return d1;
        public void setCb1(RichCommandButton cb1) {
            this.cb1 = cb1;
        public RichCommandButton getCb1() {
            return cb1;
        public String getName() {
            return null;
        public void release() {
        public Object getDataProvider() {
            return null;
        public boolean invokeOperation(Map p0, OperationBinding p1) {
            return false;
        public boolean isTransactionDirty() {
            return false;
        public void rollbackTransaction() {
        public void commitTransaction() {
        public boolean setAttributeValue(AttributeContext p0, Object p1) {
            return false;
        public Object createRowData(RowContext p0) {
            return null;
        public Object registerDataProvider(RowContext p0) {
            return null;
        public boolean removeRowData(RowContext p0) {
            return false;
        public void validate() {
        public void beginRequest(HashMap p0) {
        public void endRequest(HashMap p0) {
        public boolean resetState() {
            return false;
    }

  • Use ADF Managed Bean to get the username in BPM Workspace

    Hi all,
    I used JSF and ADF to build the UI of human task. And I want to get the username of the user who is manipulate on BPM Workspace. For example, an ADF form can display the username of current user in BPM Workspace. I also try this approach: use Manage Bean, and bind this bean to a output text in ADF form. The code fragment I use to get the current username is:
    ADFContext.getCurrent().getSecurityContext().getUserPrincipal().getName();
    But it does not work. The value I get is Anonymous.
    So, plz help me solve this problem

    Hi, please try this function as below:
    public String getUserLogin() throws WorkflowException,
    BPMIdentityException,
    BPMUnsupportedAttributeException {
    String userId = "";
    IWorkflowServiceClient wfSvcClient;
    ITaskQueryService queryService;
    IWorkflowContext wfContext;
    // Get username of User Login
    String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
    wfSvcClient = WorkflowService.getWorkflowServiceClient();
    queryService = wfSvcClient.getTaskQueryService();
    wfContext = queryService.getWorkflowContext(contextStr);
    userId = wfContext.getUser();
    return userId;
    Regards.

  • JSF Beta - faces-config.xml - Managed Bean Errors.

    I recently switched from EA4 to Realse Beta.
    When I start my web server, my app throws the following:
    Exception sending context initialized event to listener instance of class
    com.sun.faces.config.ConfigListener -- java.lang.NullPointerException
    I started removed stuff from my faces config and the application started up fine when I removed the managed beans that do not reference other managed beans(see below)?
    TIA,
    Juby
    Example
    <!-- =================== Managed Bean Facility ============== -->
    <managed-bean>
    <description>
    User Bean. This will hold the user info from ldap.
    </description>
    <managed-bean-name>levitonUserLdap</managed-bean-name>
    <managed-bean-class>leviton.ldap.Names</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
    <description>
    User Bean. This will hold the user info for the application.
    </description>
    <managed-bean-name>levitonUser</managed-bean-name>
    <managed-bean-class>leviton.FEOP.beans.User</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>firstName</property-name>
    <value-ref>levitonUserLdap.firstName</value-ref>
    </managed-property>
    <managed-property>
    <property-name>lastName</property-name>
    <value-ref>levitonUserLdap.lastName</value-ref>
    </managed-property>
    <managed-property>
    <property-name>domainUserId</property-name>
    <value-ref>levitonUserLdap.userId</value-ref>
    </managed-property>
    </managed-bean>

    I beileve this is the cuase of my error.
    Why did the <value-ref> tag get removed from the web-facesconfig_1_0.dtd?
    How can I reference another managed bean now?
    OLD web-facesconfig_1_0.dtd
    <!--
    The "managed-property" element represents an individual property of a
    managed bean that will be configured to the specified value (or value set)
    if the corresponding managed bean is automatically created.
    -->
    <!ELEMENT managed-property (description*, display-name*, icon*, property-name, property-class?, (map-entries|null-value|value|value-ref|values))>
    NEW web-facesconfig_1_0.dtd
    <!--
    The "managed-property" element represents an individual property of a
    managed bean that will be configured to the specified value (or value set)
    if the corresponding managed bean is automatically created.
    -->
    <!ELEMENT managed-property (description*, display-name*, icon*, property-name, property-class?, (map-entries|null-value|value|list-entries))>

  • Please help with dynamic menu creation needs to have 5 levels

    Hi,
    I have run into a Coldfusion problem that I was hoping you
    could help me with.
    What I am trying to solve is the dynamic creation of at least
    5 levels of categories for a menu built with Coldfusion, and if
    possible an infinite amount of levels.
    Each of these also if it is at the end of the tree will have
    to have products under it aswell the category will only show up if
    there is products under it.
    To acomplish this I have created a database table called
    "Categories" which contains the fields shown in the linked
    spreadsheet. I am using the "cat_parent" to hold the value of the
    parent of the current record. When the parent is a top level menu
    item I have assigned this a cat_parent id of "0". Using this method
    I am able to do a self join on the table (where "cat_parent" =
    "cat_id") to extract the relationship between parent and child
    records throughout the table. This works fine. And I have created
    output for 5 levels of display.
    There are 3 issues left that I could not work out.
    - Firstly my coding method loops through each node of the
    tree with one query to create each category of the menu. This means
    one query per menu category and as the client could have up to 200
    categories in the menu and I am concerned that the solution that I
    have come up with is too processor intensive.
    - Secondly the way that I have created the category menu is
    hard coding in the levels needed so there is only 5 not an infinite
    amount which would be preferable but is not essential.
    - Finally I could not work out how to not create "parents" in
    the tree if there is no products for the end child category.
    Meaning that if there is for example a category > subcategory
    > subsubcategory but there is no products associated with the
    end category - "subsubsubcategory" then it's parent and so on will
    not display until one of them has products.
    Here
    is a link to a zip file that includes: the cfc that contains
    the query function (categories.cfc), the page that is creating the
    categories menu (lefnav.cfm), a simple cfc that contains a products
    query just for testing (products.cfc) along with a spreadsheet of
    the Categories table's fields.
    I would greatly appreciate any suggestions.
    Thanks for any time and help you can give me on this

    This should at least get you started in the right direction.
    http://www.sitepoint.com/article/dynamic-menu-coldfusion
    Bryan Ashcraft (remove brain to reply)
    Web Application Developer
    Wright Medical Technologies, Inc.
    =============================
    Macromedia Certified Dreamweaver Developer
    Adobe Community Expert (DW) ::
    http://www.macromedia.com/go/team
    "shunnyboy" <[email protected]> wrote in
    message
    news:e2h9hs$kp5$[email protected]..
    > Hi,
    >
    > I have run into a Coldfusion problem that I was hoping
    you could help me
    > with.
    >
    > What I am trying to solve is the dynamic creation of at
    least 5 levels of
    > categories for a menu built with Coldfusion, and if
    possible an infinite
    > amount
    > of levels.

  • Dynamic menu creation in JSP treating source as dynamic xml

    Hi Everyone,
    I have a XML file which is a dynamic one..It is generated from a tool..I need to parse that xml and generate a menu accordingly in a jsp.In menu the data to be displayed comes from thie hierarchical xml file which is a dynamic one..Siblings and child notes are not fixed..it all generates at rum by some other tool.
    Please help me to tell any logic to create such a dynamic menu ...i am using Dom parser to parse that..
    Regards
    Sajal

    Hi
    This is the xml...I want to display the values in a JSP menu..These values comes from this XML...Like for this XML the struscture will be like
    --Category
    |
    | IT Services
    |
    |ABC Softwares
    |
    |Application Developement
    |
    |Java
    |Mainframes
    |Production Support
    <DIMENSIONS>
    <DIMENSION NAME="CATEGORY">
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="1"/>
    <VALUE>IT Services</VALUE>
    </DVAL>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="2"/>
    <VALUE>ABC Softwares</VALUE>
    </DVAL>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="3"/>
    <VALUE>Application Development</VALUE>
    </DVAL>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="4"/>
    <VALUE>Java</VALUE>
    </DVAL>
    </DIMENSION_NODE>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="5"/>
    <VALUE>Mainframes</VALUE>
    </DVAL>
    </DIMENSION_NODE>
    </DIMENSION_NODE>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="6"/>
    <VALUE>Production SUpport</VALUE>
    </DVAL>
    </DIMENSION_NODE>
    </DIMENSION_NODE>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="7"/>
    <VALUE>DEF Softwares</VALUE>
    </DVAL>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="8"/>
    <VALUE>Application Development</VALUE>
    </DVAL>
    </DIMENSION_NODE>
    <DIMENSION_NODE>
    <DVAL>
    <DVAL_ID ID="9"/>
    <VALUE>Production SUpport</VALUE>
    </DVAL>
    </DIMENSION_NODE>
    </DIMENSION_NODE>
    </DIMENSION_NODE>
    </DIMENSION>
    </DIMENSIONS>
    So in this way i need to populate the data from XML.. there can be n number of nodes child nodes and Siblings..and siblings can also have further Child nodes...So need to populate the JSP Menu from this xml..
    Please suggest some logic or if somebody has some sample code..

  • Dynamic Menu Creation Problem

    Hi,
    I am trying to implement a dynamic JSF menu, by coding for it in a request bean, and have hit a stumbling block with regards to adding a panelMenu to another panelMenu. I understand how to add outputLink and outputText to the menu and even how to add another panelMenu to the menu.
    Here is the code:
    HtmlPanelMenu panelMenu = new HtmlPanelMenu();
    panelMenu.setId("menuMain");
    panelMenu.setStyleClass("panelMenu");
    HtmlPanelMenu subMenu = new HtmlPanelMenu();
    subMenu.setId("subMenu");
    HtmlOutputText text1 = new HtmlOutputText();
    text1.setValue("Enquiry Menu");
    text1.setId("text1");
    subMenu.getChildren().add(text1);
    HtmlOutputLinkEx outputLink1 = new HtmlOutputLinkEx();
    outputLink1.setId("link1");
    outputLink1.setValue("enquiry.faces");
    HtmlOutputText text2 = new HtmlOutputText();
    text2.setId("authoritiesLinkText");
    text2.setValue("Branch Enquiry");
    outputLink1.getChildren().add(text2);
    subMenu.getChildren().add(outputLink1);
    panelMenu.getChildren().add(subMenu);When I try to run the page I get the following error:
    javax.servlet.ServletException: nested menu's require a menu owner - some item that is contained in a f:facet with name = "header"
    This is running on Websphere v7. I can see from the specification that the outputText for the submenu (text1) should have a surrounding facet, but I cannot find such an object anywhere. I have tried using FacetTag but this doesn't work as it hasn't got a children property to attach the outputText to it.
    Am I missing something or is it that this is the wrong way?
    Any help would be appreciated!
    Steve
    Edited by: Steve-Waterfall on Oct 22, 2009 1:37 PM
    Edited by: Steve-Waterfall on Oct 22, 2009 1:38 PM

    Ahhh you were nearly there
    try
    HtmlPanelMenu panelMenu = new HtmlPanelMenu();
    panelMenu.setId("menuMain");
    panelMenu.setStyleClass("panelMenu");
    HtmlPanelMenu subMenu = new HtmlPanelMenu();
    subMenu.setId("subMenu");
    HtmlOutputText text1 = new HtmlOutputText();
    text1.setValue("Enquiry Menu");
    text1.setId("text1");
    here is the key
    subMenu.getFacets().put("header",text1);
    HtmlOutputLinkEx outputLink1 = new HtmlOutputLinkEx();
    outputLink1.setId("link1");
    outputLink1.setValue("enquiry.faces");
    HtmlOutputText text2 = new HtmlOutputText();
    text2.setId("authoritiesLinkText");
    text2.setValue("Branch Enquiry");
    outputLink1.getChildren().add(text2);
    subMenu.getChildren().add(outputLink1);
    panelMenu.getChildren().add(subMenu);

  • Error in dynamic node creation ..........

    Hi experts,
    I am creating a node dynamically in WDDOINT  and creating an input field in WDDOMODIFYVIEW , but am getting an error "attribute not found". Am pasting below my code...
    Code in WDDOINT of a view :
    data lr_par_node       type ref to IF_WD_CONTEXT_NODE_INFO.
        data lr_node       type ref to IF_WD_CONTEXT_NODE_info.
         data lr_node_info1       type ref to IF_WD_CONTEXT_NODE_INFO.
        data lr_node1       type ref to IF_WD_CONTEXT_NODE.
        data lr_attribute  type        WDR_CONTEXT_ATTRIBUTE_INFO.
        data lt_child_node_map                  type wdr_context_child_info_map.
    *****to get context parent node information
        lr_par_node = wd_context->get_node_info( ).
    *****to get child node of the parent
        lt_child_node_map = lr_par_node->get_child_nodes( ).
    *****check for the existence of node
        read table lt_child_node_map transporting no fields with table key name = `RESULT`.
        if sy-subrc = 0.
          " REMOVE_CHILD_NODE
          lr_par_node->remove_child_node( `RESULT` ).
        endif.
    *****inserting new node in context
        CALL METHOD lr_par_node->ADD_NEW_CHILD_NODE
          EXPORTING
            NAME                         = 'RESULT'
    *       IS_MANDATORY                 = ABAP_FALSE
    *       IS_MANDATORY_SELECTION       = ABAP_FALSE
            IS_MULTIPLE                  = ABAP_TRUE
           IS_MULTIPLE_SELECTION        = ABAP_TRUE
    *       IS_SINGLETON                 = ABAP_FALSE
           IS_INITIALIZE_LEAD_SELECTION = ABAP_false
    *       STATIC_ELEMENT_RTTI          =
            IS_STATIC                    = ABAP_TRUE
    *       ATTRIBUTES                   =
    *       IS_RANGE_NODE                =
          RECEIVING
            CHILD_NODE_INFO              = lr_node.
        lr_node1 = wd_context->get_child_node( name = 'RESULT' ).
        lr_node_info1 = lr_node1->GET_NODE_INFO( ).
    *********Adding attribute
        lr_attribute-NAME = 'TEST_GROUP'.
        lr_attribute-TYPE_NAME = 'PLNNR'.
        lr_attribute-NODE_INFO = lr_node_info1.
        CALL METHOD lr_node_info1->ADD_ATTRIBUTE
          EXPORTING
            ATTRIBUTE_INFO = lr_attribute.
        clear lr_attribute.
    Code in the WDDOMODIFYVIEW :
    method WDDOMODIFYVIEW .
      if first_time = abap_true.
        data : lt_header_block type zcdp_tt_mfte_header.
        lt_header_block = WD_COMP_CONTROLLER->MT_HEADER_BLOCK.
        DATA :lr_container  TYPE REF TO cl_wd_uielement_container,
         lr_input      TYPE REF TO cl_wd_input_field,
         lr_caption    type ref to CL_WD_CAPTION,
         lr_column type ref to CL_WD_TABLE_COLUMN,
         lr_trans_cont TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
        data lr_lbl type ref to CL_WD_TEXT_VIEW.
    ******to get root element container
        lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
        lr_trans_cont ?= VIEW->GET_ELEMENT('TRANS_CONT_HEADER_BLOCK').
    * Created one transparent container in the view.......
    CALL METHOD CL_WD_TEXT_VIEW=>NEW_TEXT_VIEW
      EXPORTING
    *    CONTEXT_MENU_BEHAVIOUR = E_CONTEXT_MENU_BEHAVIOUR-INHERIT
    *    CONTEXT_MENU_ID        =
    *    DESIGN                 = E_DESIGN-STANDARD
    *    ENABLED                = 'X'
    *    H_ALIGN                = E_H_ALIGN-AUTO
    *    ID                     =
    *    LAYOUT                 = E_LAYOUT-NATIVE
    *    SEMANTIC_COLOR         = E_SEMANTIC_COLOR-STANDARD
        TEXT                   = 'TEST'
    *    TEXT_DIRECTION         = E_TEXT_DIRECTION-INHERIT
    *    TOOLTIP                =
    *    VIEW                   =
    *    VISIBLE                = E_VISIBLE-VISIBLE
    *    WIDTH                  =
    *    WRAPPING               =
      RECEIVING
        CONTROL                = lr_lbl
    cl_wd_matrix_head_data=>new_matrix_head_data(
                element = lr_lbl ).
    lr_trans_cont->ADD_CHILD( lr_lbl ).
       CALL METHOD CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD
          EXPORTING
            BIND_VALUE             = 'RESULT.TEST_GROUP'
            ENABLED                = 'X'
    *       EXPLANATION            =
           ID                     = 'ABCD'
          RECEIVING
            CONTROL                = lr_input.
      cl_wd_matrix_data=>new_matrix_data(
                element = lr_input ).
    lr_trans_cont->ADD_CHILD( lr_input ).
      endif.
    endmethod.
    Pls help  me in this.....
    Thanks
    Aisurya.

    Hi,
    looking at code it seems that you are adding textview and inputfield. please check in debugging if the correct context node/attribute  is being created and you are providing its reference while adding UI elements.
    Thanks,
    Chandra

  • Accessing facade bean in ADF Faces managed bean

    Hello
    I am trying to display data from a database on a page using ADF Faces. I am using a Web Application [JSF, EJB] template in JDeveloper with the model project using JPA entities with a session facade bean to manage the entities (as described here: http://www.oracle.com/technology/obe/obe1013jdev/10131/ejb_and_jpa/master-detail_pagewith_ejb.htm ).
    What I have tried to do is to set up a managed session bean in the ViewController project that is referenced by a faces page. The managed bean is supposed to, on creation, load data from the database into managed properties which are then displayed on the faces page using EL references. I want all JPA management to go through the facade, and thus I want to inject the facade bean into the managed bean using @EJB notation. However, the injection does not work, and all I get is a NullPointerException when trying to access the injected facade in the managed bean.
    I have also tried instantiating the facade bean in the managed bean's constructor manually, but when I try to call a method on the facade, I get another NullPointerException, this time from the entity manager which obviously is not injected into the facade bean.
    What is strange is that the facade bean works perfectly when I use the datacontrols generated from the facade bean, as described in the tutorial (no exception from the entity manager).
    I have searched high and low for a solution to this, and from what I can read, it should be possible to do what I want (see for example https://blueprints.dev.java.net/bpcatalog/ee5/persistence/ejbfacade.html and http://luxlog.wordpress.com/2007/12/15/basic-example-web-app-with-glassfish-netbeans-60-jsf-and-ejb3/ ). I found someone mentioning that dependency injection in the web container OC4J was added after a given version, and that web.xml needs to be upgraded to version 2.5, which I have done but did not solve anything.
    Is this not possible in JDeveloper/OC4J at all? Is there any other way to access the facade session bean in managed beans?

    Hi,
    for resource injection you need JDeveloper 11. Here the EJB annotation works to inject the resource. If you want to do similar in 10.1.3 then you need to do a JNI lookup in the managed bean (under the shelves ADF does the same)
    Frank

  • How to access backing bean of a xml component , in a managed bean of ADF

    Hi,
    We wrote a xml component in JSF and this component is used in ADF project by including the component as jar .
    In a master detail page , we need to update the value of the xml component, when the master row is changed. How to do this.
    We are trying to do this by accessing the backing bean of the xml component in ADF project's managed bean. So when ever the row changes, we can access the managed bean in ADF and then can set the value of the xml component by accessing it's backing bean
    But i can't access the backing bean instance of the xml component in the ADF managed bean. Could you let me know how to do this. Thanks .

    Thanks for the response Shay. The xml component is added as a custom component , with a separate faces-config.xml file . This component is added to ADF project as a jar with a custom tag.
    In the ADF project , i'm having different managed beans and i can access them from a different managed bean.
    The issue is, i can't access the added custom component's backing bean which is available from a different jar , defined in a separate faces-config.xml file . This backing bean is defined with request scope.

  • JavaBeans Data Control / Managed beans interaction

    Working in JDev/ADF 11g
    I have an Application Scoped ADF managed bean that initializes some services for my ADF application. (These are non-database backed business services and so they do not integrate as tightly with Jdev as data controls). They require some constructor arguments and other initialization parameters and so they cannot be written as pure beans.
    I wrote Java Beans to use as data controls that wrap these services. What I would like to do is to keep the creation of these services in the application scoped bean, so they can be used programmatically in other areas. When the data controls beans are initialized, I want to grab their underlying services from the application scoped bean via the ADFContext.
    My issue is that at the time the data control beans are instantiated, the ADFContext returns null when accessing the application scoped bean - ie it has not been created yet.
    What is the proper way to pass initialization data to JavaBean data controls? Ideally I could simply pass the data control a reference to its underlying service.
    If Im going about this all the wrong way, with the application scoped bean holding the application wide business services, please feel free to advise me otherwise.
    Thanks!

    Okay - so I figured out one way to do this (detailed below), but my question still stands as to if there is a proper way to get information to a JavaBean data control when it is instantiated.
    What I just learned is that although my application scoped bean does not exist when the data control is created, it can exist when the the data control is called by the .jspx. I say 'can' because it will only exist if the .jspx backing bean references the application scoped bean as a managed property. i.e. ADF will create the data control, create the page bean, create the application bean (b/c the page needs it), and then call the data control, at which point the data control will find the application scoped bean. This is sort of a hack, since it requires an unintuitive setting for it work. so I think my question still stands, how to pass data from the application scoped bean to the data control.

  • Properties - automatic menu creation

    Hi there,
    I'm currently working on a project that is frequently being changed and therefore I require a method to facilitate the creation of its menu.
    I am hoping to use a properties file to describe the contents of the menu and also which Actions each menu item will use.
    Does anyone out there have any code that exhibits this sort of behaviour, since I am having a bit of trouble in creating a robust system to do this; currently I have:
    a Properties file such as:
    # start of properties file
    menus = file edit # all of the menus
    menuitems = open open_recent save new global_options # the menu items
    file.children = open open_recent save new # the menu items of the file menu
    edit.children = global_options # the menu items of the edit menu
    open.text = Open # the text to appear on the menu item
    open.action = OpenAction # there is a class called OpenAction which provides the behaviour of this menu item
    open.gif = open.gif # the icon gif file for this menu item
    # .. now do the same for each other menu item
    # end of properties file
    Now in the source code I iterate through this file and store all of the menus and menu items in a hash table. Using the menu.children bit above I add the relationships of menu items (or other menus) to the menus. Then I add the text, action, and gif to the menu items.
    However, this way kind of works but is quite long winded; also it bumps into problems whenever I add menus to menus.
    If some one out there has previously done this before and are willing to share their code with me I would be ever so grateful. Else any suggestions would be extremely well received.
    thanks in advance
    - Edd.

    What we are using for dynamic menu creation is XML.
    Something Like:
    <Menu name="Setup">
      <MenuItem name="Security" class="com.epservices.apps.security.Security" args="" />
      <MenuItem name="Parent Company" class="com.epservices.apps.parentco.ParentCompany" args="" />
      <MenuItem name="Company" class="com.epservices.apps.company.Company" args="" />
    </Menu>
    <Menu name="Tax Set up">
      <MenuItem name="Tax Authority" class="com.epservices.apps.taxauthority.TaxAuthority" args="" />
      <MenuItem name="Tax Form" class="com.epservices.apps.taxform.TaxForm" args="" />
      <MenuItem name="Tax Code" class="com.epservices.apps.taxcode.TaxCode" args="" />
    </Menu>Then we simply parse it using SAX and build the structure.
    Here's a great article on mapping XML to Java objects:
    http://developer.java.sun.com/developer/technicalArticles/xml/mapping/

  • Managed bean can not be created. - dynamic menubar using ADF

    hi All,
    had to post the thread again to make sure it dint go un noticed!
    scenario:
    making dynamic menu navigation using ADFFaces, all steps followed as mentioned in SRDemo Sample. but still i get this error:
    error encountered:
    SEVERE:Managedbean menuItem_General could not be created.
    javax.faces.FacesException:Can't get value from value binding expression: '#{resources['erms.menu.gen']}'.
    more details here on last thread posted:
    ADF- managedbean creation error while making dynamic menus.
    plz help!

    We found the solution how it works... But its a little bit strange.
    Before we had the following on the sending part:
    connectionFactory = (ConnectionFactory) ctx.lookup("jmsfactory/default/FactoryName");
    destination = (Queue) ctx.lookup("jmsqueues/default/QueueName");
    We could not use EJB injection here as the place were it was used is a POJO.
    Now in our Job-Bean we do the following:
         @Resource(name="FactoryName")
         private ConnectionFactory connectionFactory;
         @Resource(name="QueueName")
         private Queue destination;
    and then we transfer the connection factory and queue to our POJO... and it works... From our understanding both should be the same???
    Frank

  • 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

  • How to access all rows one by one of a ADF table through managed bean

    Hi Experts,
    Hi i am new in ADF.
    Could someone help me for solving the below case?
    Scenario - I have table called Test_T1 which have 4 columns C1,C2,C3,C4. Have created EO,VO and AM for test_t1.
    At the time of ADF page creation i selected the option 'Automatically Exposed UI components in New managed bean' (mynewmanagedbean.java).
    From Data control drag and drop Test_T1 table in the page as a ADF table.
    Set the properties for C1,C2,C3 is read only and C4 is an input text.
    Have add after the table and attathed button action on the managed bean mynewmanagedbean.java.
    At the time of running the page Test_T1 populated with some no. of rows (like 9).
    How can i access all the above rows through pressing the button without selection of any of them.
    Actually i want to print all the table rows in log file at the time of pressing the button.
    Thanks in advance.

    Hi Timo,
    Thanks a lot for your reply.
    I am using the JDeveloper 11.1.2.1.0.
    As previously said I am totally new in this framework. So if you explain the solution given by you then it will be help full for me.
    Don't know r you agree or not for this ?
    When i put your resolution in the command button bean JDeveloper said TestDataRow type not found.
    What will be the type and TestDataRow and what is missing in below code or how i will declare that in below code?
    Also Could please mentioned the missing thing ?
    package createrow.view.pagecreation.bean;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import org.apache.myfaces.trinidad.model.RowKeySet;
    import oracle.adf.model.BindingContext;
    import java.util.Iterator;
    import java.util.List;
    import oracle.adf.model.bean.DCDataRow;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.RowSet;
    import oracle.jbo.RowSetIterator;
    import oracle.jbo.ViewObject;
    public class OrdCreationWithManagedBean {
    public String cb1_action() {
    // Add event code here...
    DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcIteratorBindings =
    bindings.findIteratorBinding("TestOrderItemAllocationVO1Iterator");
    // Get all the rows of a iterator
    Row[] rows = dcIteratorBindings.getAllRowsInRange();
    TestDataRow dataRow = null;
    for (Row row : rows) {
    dataRow = (TestDataRow)((DCDataRow)row).getDataProvider();
    // work with the row...
    return null;
    My page bindings like below
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="11.1.2.60.81"
    id="OrdCreationWithManagedBeanPageDef" Package="createrow.view.pageDefs">
    <parameters/>
    <executables>
    <variableIterator id="variables"/>
    <iterator Binds="TestOrderItemAllocationVO1" RangeSize="25" DataControl="MainAppModuleDataControl"
    id="TestOrderItemAllocationVO1Iterator"/>
    <iterator Binds="TestOrderItemsEOView1" RangeSize="25" DataControl="MainAppModuleDataControl"
    id="TestOrderItemsEOView1Iterator"/>
    </executables>
    <bindings>
    <tree IterBinding="TestOrderItemAllocationVO1Iterator" id="TestOrderItemAllocationVO1">
    <nodeDefinition DefName="createrow.view.TestOrderItemAllocationVO" Name="TestOrderItemAllocationVO10">
    <AttrNames>
    <Item Value="AllocationId"/>
    <Item Value="AlocationSequence"/>
    <Item Value="ProductName"/>
    <Item Value="AllocationPercentage"/>
    </AttrNames>
    </nodeDefinition>
    </tree>
    <tree IterBinding="TestOrderItemsEOView1Iterator" id="TestOrderItemsEOView1">
    <nodeDefinition DefName="createrow.view.TestOrderItemsEOView" Name="TestOrderItemsEOView10">
    <AttrNames>
    <Item Value="OrderId"/>
    <Item Value="AllocationId"/>
    <Item Value="ProductName"/>
    <Item Value="OrderItemsQty"/>
    </AttrNames>
    </nodeDefinition>
    </tree>
    </bindings>
    </pageDefinition>
    Thanks In Advance

Maybe you are looking for

  • Credit Note Creation for Invoice of previous sytem

    Hi to everyone, An invoice was created on the previous system (Pastel) and now the client is returning the goods. How would I account for this return? A service credit Note? How to re integrate the stock (goods are coming back in stock) Thanks Kentis

  • Design View Problems

    Hello, I have downloaded the Dreamweaver 8 and I'm in the process of taking some online tutorials to improve my almost non-existent skills. I must have changed something during my careless exploration on the application. The problems I am having all

  • Leopard 10.5.4 not open mov files on disc

    Since 10.5.4 files on disc with.mov extension will not open. Default application (Quicktime) is correct. Clicking on file in finder (once) launches app instead of showing info as it should. Player then gets spin ball & quits. Right clicking allows ch

  • Nano goes black screen

    My Ipod Nano screen goes black.. but it can still be detected by iTUNEs and can still listen to music ,, my problem is, i couldn't see anything.. what do i have to do?

  • Error while settling costs to AUC (T.CODE CJ88)

    The following error is encountered while settling costs to AUC using t.code CJ88 with WBS element, with parameters with orders Selection  processing type 3 (partial settlement), period 4, FY 2008, selection - with hierarchy, with orders. Error messag