Error in accessing attributes of a declarative component in BackinBeanScope

Hello,
I'm using JDeveloper 11.1.1.4.0.
For pagination we have created a declarative component. It's bean when in request scope works fine when the dec.comp. is used in page only once.
In order to use it multiple times in the same page, I changed the scope to BackingBeanScope. It works fine the first time bean's method gets called. However on the next request, I'm getting NullPointerException when it tries to access the dec. comp's attribute.
Why am I getting this error and how to correct it?
As an alternative, we can store the attribute value received first time in a hidden form field and retrieve it every subsequent time. But this would be my last alternative.
Appreciate a reason and a better way to resolve this.
Regards,
Amar

Hi,
Yes. The bean is declared in the dec. comp.
Following is the code in my bean's c'tor:
FacesContext fc                    = FacesContext.getCurrentInstance();
ELContext elctx                    = fc.getELContext();
ExpressionFactory elFactory    = fc.getApplication().getExpressionFactory();
ValueExpression valueExpr      = elFactory.createValueExpression(elctx, "#{component}", UIXDeclarativeComponent.class);
UIXDeclarativeComponent currDeclarativeComp            = (UIXDeclarativeComponent)   valueExpr.getValue(elctx);
String currVOObjectName                                         = currDeclarativeComp.getAttributes().get("VOObject").toString();"VOObject" is the attribute name for the dec. comp. It's getting correct value the first time. Every subsequent time,the last line throws null pointer exception.
Regards,
Amar

Similar Messages

  • Access InputText Value in Declarative Component

    Hi,
    I have created a declarative component that contains an inputText component:
    <af:inputText label="#{attrs.ucitLabelText}" id="dc_it1" contentStyle="text-transform:uppercase;" converter="StringAsUppercase"/>
    When I use the declarative component on a page, is there any way to easily access the value of its inputText through the page backing bean? The declarative component is bound to the page, but what method can I use to access the inputText value?
    Thanks,
    Brad

    Thanks.
    I also figured out that I can simply do the following:
    When creating the declarative component...
    - Add an attribute to the declarative component (let's call it "inputValue")
    - Assign the inputValue attribute to the inputText value.
    When using the declarative component on a page...
    - Create a String property in the page's backing bean
    - Assign that property to the declarative component's inputValue attribute
    Then I can access the backing bean property to get the inputText value.
    Brad

  • Error during transport: Method is not declared + Component missing

    HI
    I got 2 errors when I transport:
    Error 1:
    Program ZCL_ZGW_VH_ORDER_DETAI_DPC_EXTCP, Include ZCL_ZGW_VH_ORDER_DETAI_DPC_EXTCO: Syntax error in line 000003
    Method 'DETSET_GET_ENTITY' is not declared or inherited in class 'ZCL_ZGW_VH_ORDER_DETAI_DPC_EXT'. -
    Error 2:
    Program ZCL_ZGW_VH_ORDER_DE_01_DPC====CP, Include ZCL_ZGW_VH_ORDER_DE_01_DPC====CM006: Syntax error in line 000190
    The data object 'LS_ET_DETAILS' does not have a component called 'ZZ_MATR_LEV_DATO'.
    1)
    When I go to Class Builder (SE24), and make a syntax check for ZCL_ZGW_VH_ORDER_DETAI_DPC_EXT, I got the error:
    Class ZCL_ZGW_VH_ORDER_DETAI_DPC_EXT,Protected section
    Method "DETSET_GET_ENTITY" is not declared or inherited in class
    "ZCL_ZGW_VH_ORDER_DETAI_DPC_EXT". -
    The code looks like this
    protected section.
      methods DETSET_GET_ENTITY
        redefinition .
    2)
    If I go to include ZCL_ZGW_VH_ORDER_DE_01_DPC====CM006 (in SE38), I am navigated to method: DETSET_GET_ENTITYSET (That was the missing method in error 1). When I do a syntax check, I got the error message:
    Class ZCL_ZGW_VH_ORDER_DE_01_DPC,Method DETSET_GET_ENTITYSET
    The data object "LS_ET_DETAILS" does not have a component called
    "ZZ_MATR_LEV_DATO".
    Then I double click at ls_gw_et_details-zz_matr_lev_dato, and got the data statement: DATA ls_gw_et_details LIKE LINE OF et_entityset.
    When I double click at et_entityset, I see that the et_enityset is type ZCL_ZGW_VH_ORDER_DE_01_MPC=>TT_ORDDET. Now I double click at TT_ORDDET I got the public section, where I can see that ZZ_MATR_LEV_DATO is already specified.
         ZZ_SPORSP_DATO type D,
         ZZ_KSTROM type STRING,
         ZZ_KSTROM_DATO type D,
         ZZ_MATR_LEV_DATO type D,
      end of TS_ORDDET. .
      types:
    TT_ORDDET type standard table of TS_ORDDET. .
    Anyone who will help me?
    Thanks
    Lars

    Hi Ron Sargeant,
    I'm having a kind of similar issue. I have 3 entities, they were already mapped to theirs respective RFC. In the RFC, a couple of fields changed their name so the mapping got lost. I did again the mapping and there was no errors on 2 of the 3 entities. For other reasons, I had to delete the third entitiy, I deleted it and created it again and there was no problems, I do the mapping and everything was apparently fine, when I tried to "Generate Runtime Objects" it throws me an error with the next message: "Failed to create data provider class". If I try to Generate the service again, it throws me another error message: "The class ZCL_xxx_xx_xxxxxx_DPC is locked. Process canceled". I'm sure I've not edited or deleted the DPC class. If I try to access the DPC class from the tx SE24 it tells me that the object it's not created, and the class still appears in the list of Runtime Artifacts in tx SEGW.
    I'd like to know if you've got any idea of what may happen, or I'd also like to be sure that if I delete the DPC class and the DPC_EXT class, it will be regenerated again by the Service Builder.
    Best regards,
    Ana Velásquez

  • Error in accessing the create method declared in Home interface

    hi,
    I have create method in home interface which takes the following syntax:
    public ShipRemote create(ShipPK id,String name,int capacity,float tonnage) throws CreateException,RemoteException;
    In the client I create a remote object and try to call this create method, but I get a compilation error :
    it says unable to resolve the symbol with a cursor pointing the create method
    interface sampleEJB.ship.shipInfo.ShipHome ShipRemote remoteRef=(ShipRemote)homeRef.create(spk,sname,5000,100.7);
    how can i resolve this.
    I have implemented this create method in my bean

    hi i have compiled the client interfaces and the bean successfully.
    I have also imported the classes in the in the client code .
    I even deployed my jar successfully, but i have problem in accessing the create method specified .
    thank you

  • Declarative component stops working after taskflow-call-in-popup

    Hi!
    JDev 11.1.1.3.0
    I need a component, much like the commandToolbarButton, but I have the requirement that the user should still be able to select from the popup even if the button is disabled.
    So I created a declarative component, combining two buttons and a popup with a menu in a panelGroupLayout. The one button, the mainButton, actually executes the action, the other (with an icon only) opens a menu in a popup.
    The user selects an item from the popup, the component then PPRs the main button in code to display the user's choice in the main buttons text.
        <af:panelGroupLayout layout="horizontal" id="${component.id}_layout">
          <af:commandToolbarButton id="mainButton" text="#{component.mainButtonText}"
                                   clientComponent="true" disabled="#{!component.enabled}"
                                   partialSubmit="true"
                                   actionListener="#{component.mainButtonPressed}"/>
          <af:commandToolbarButton id="menuButton" icon="/images/arrowDownComboBox.png"
                                   partialSubmit="true" disabled="#{!component.enabled}">
            <af:showPopupBehavior alignId="mainButton" align="afterStart" popupId="commandPopup"/>
          </af:commandToolbarButton>
          <af:facetRef facetName="extensionButton"/>
          <af:popup id="commandPopup" contentDelivery="lazyUncached" childCreation="immediate"
                    clientComponent="true">
            <af:menu id="commandMenu" clientComponent="true" binding="#{component.commandMenu}"/>
          </af:popup>
        </af:panelGroupLayout>That works fine ... until the user opens a taskflow in a popup.
    I have a bounded taskflow, jspx-based, opened by a button with an action that navigates to a taskflow-call activity in a modal dialog. The user opens the taskflow, does what needs to be done, then closes the dialog.
    Still fine.
    But, after the dialog has closed, when the user selects an item from the popup menu of my declarative component, I suddenly get an NPE:
    <26.04.2011 19:07 Uhr MESZ> <Notice> <Stdout> <BEA-000000> <<RegistrationConfigurator><handleError> Server Exception during PPR, #1
    java.lang.NullPointerException: UIComponent is null
         at org.apache.myfaces.trinidad.component.UIXComponent.addPartialTarget(UIXComponent.java:498)
         at org.apache.myfaces.trinidadinternal.context.RequestContextImpl.addPartialTarget(RequestContextImpl.java:513)
         at com.ge.med.web.components.button.CommandComboButton.refreshMainButton(CommandComboButton.java:213)
         at com.ge.med.web.components.button.CommandComboButton.setSelectedCommand(CommandComboButton.java:177)
         at com.ge.med.web.components.button.CommandComboButton.commandItemPressed(CommandComboButton.java:243)
         at com.ge.med.web.components.button.CommandComboButton.processAction(CommandComboButton.java:129)
         at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)To track the problem down, I have pointed the binding attribute of the declarative component to a property in a session-scoped bean, to see what the component looks like that is set, what the children and grand children are, and who the parent is.
    This prints:
    <26.04.2011 19:07 Uhr MESZ> <Notice> <Stdout> <BEA-000000> <Setter called: DemoComboButtonComponent[oracle.adf.view.rich.component.fragment.UIXInclude$ContextualFacesBeanWrapper@1762a87, id=demoAdd]>
    <26.04.2011 19:07 Uhr MESZ> <Notice> <Stdout> <BEA-000000> <Parent: RichPanelGroupLayout[UIXFacesBeanImpl, id=cbll1]>
    <26.04.2011 19:07 Uhr MESZ> <Notice> <Stdout> <BEA-000000> <Children: [RichPanelGroupLayout[UIXFacesBeanImpl, id=demoAdd_layout]]>
    <26.04.2011 19:07 Uhr MESZ> <Notice> <Stdout> <BEA-000000> <Grand kids: [RichCommandToolbarButton[UIXFacesBeanImpl, id=mainButton], RichCommandToolbarButton[UIXFacesBeanImpl, id=menuButton], RichPopup[UIXFacesBeanImpl, id=commandPopup]]> That's fine. But when I add the same debug code to my setSelectedCommand() method (which is called when the user selects an item from the popup's menu), I get:
    <26.04.2011 19:07 Uhr MESZ> <Notice> <Stdout> <BEA-000000> <I am: DemoComboButtonComponent[oracle.adf.view.rich.component.fragment.UIXInclude$ContextualFacesBeanWrapper@ba2b1c, id=demoAdd]>
    <26.04.2011 19:07 Uhr MESZ> <Notice> <Stdout> <BEA-000000> <My Parent: null>
    <26.04.2011 19:07 Uhr MESZ> <Notice> <Stdout> <BEA-000000> <My Children: []> The empty children property explains the NPE. This NPE only happens when the user selects an item from the popup after the dialog has closed.
    Debugging showed that the new DemoComboButtonComponent is created during the restoration of (tree) state after the closing of the modal dialog. But why has it no parent? And where are the kids?
    Could the binding of the declaratice component to a session-scoped bean be the problem? Somehow prevent the state mechanism from re-building the UI component tree correctly?
    I am at the end of my wits.
    Any help is appreciated!
    Sascha

    Hi Frank,
    no, not yet. I had the feeling that it's me who is doing something wrong. Declarative components are pretty common, right? So are taskflow calls in dialogs. Someone should have noticed if there's a bug in the framework, right?!
    But I changed the scope of the bean (to backing scope and request scope) that the declarative component is bound to and I still get the error.
    I will try to create a simpler test case, and if I can reproduce with that, then I will file a bug, if there's no one that can explain the phenomenon.
    Sascha

  • 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

  • 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

  • Tag Library for Declarative Component

    Hi
    Using JDev 11gR1. I'm new to tag libraries and have the following question...
    How do I deploy a JAR file with a declaritive component as a JSP tag Library? I have created a new project, created a new tag library in the project (.tld file) and created a reusable toolbar in the project. How do I include the tags and attributes of the declarative component in the .tld file? Do I just edit the file or have I missed some steps which would have done this.
    When creating the new declarative component I did us the "Add Tag Library..." button to specify the tag library in the project.
    All declaritive component examples / tutorials / blogs / ADF dev guide, I find just tell you to deploy the jar file as a tag library and include it in the project to use it, but I can't find anything telling you how to deploy it as a tag library. Any help or references to examples will be great.
    Thanks
    Mario

    Shay, thanks for the reply.
    I started off following Grant's article which you referred me to, but ran into the problem I'm having now. Just tried it again and still no luck.
    I created a declarative component in a new project, setup the deployment profile to deploy to an ADF Library JAR and deployed it. Then I add the directory for the JAR to my Resource palette and add the JAR to the project which will be using it.
    But that's as far as I get, still nothing shows in my Component Palette.
    That's when I started on the wild goose chase of the TLD file. I looked at Andrejus' blog posting, [http://andrejusb.blogspot.com/2009/10/custom-declarative-components-in-adf.html| [http://andrejusb.blogspot.com/2009/10/custom-declarative-components-in-adf.html|http://andrejusb.blogspot.com/2009/10/custom-declarative-components-in-adf.html]] and the source and realised he has a tld file inside his generated JAR. Which lead to my question as to when this get's generated / defined?
    Any ideas what I could try to get my Components to display in the Component Palette?
    Thanks,
    Mario
    Edited by: Mario Ribeiro on Oct 28, 2009 10:10 AM

  • Navigation Name in My Declarative Component

    Dear All
    i have a Declarative component contains some buttons, one of them used for navigation between pages , and i need to send the Navigator Name as a parameter to this button.
    i can pass any parameter type ActionEvent and using ActionListener like many examples i found before , but now i need to pass String Parameter not ActionEvent Parameter.
    Please Advise.

    No, it's completely unclear to me, sorry - maybe my brain is tired - it's been a long day.
    What do you mean by a String parameter?
    If I understand you correctly, you want to specify a task flow outcome when you click a button in the declarative component? If that is the case, create an attribute on your declarative component and bind the Action property of the button to the attribute.
    If you mean something else, then give us the use case (a "for example" would make it more clear).
    John

  • Error while saving changes of declarative component to MDS

    Hi,
    Using ADF Faces 11gR1PS1.
    I am trying to create a declarative component where user can close a panel box (not just minimize) by setting rendered property to false. It works fine.
    Next I tried to save the attribute change to MDS so that user settings are preserved across sessions. However I got the following error:
    <FilteredPersistenceChangeManager><_getQualifiedTagName> WebAppDesignContext is not available at application scope. Please ensure that your application is built as a 'Fusion Web Application (ADF)', and that taglib.jar and facesconfigmodel.jar are in class path.
    <FilteredPersistenceChangeManager><_isChangeAllowedThroughPersistentChangeManager> Could not obtain tag name for the component being changed. Component ref: RichPanelBox[UIXFacesBeanImpl, id=dc_pb2]
    <FilteredPersistenceChangeManager><_addDocumentChangeImpl> The DocumentChange is not configured to be allowed for the component: RichPanelBox[UIXFacesBeanImpl, id=dc_pb2]Following is the page code:
              <af:panelBox text="#{attrs.p2Header}" id="dc_pb2"
                           rendered="#{attrs.p2Header ne null and dashboardXBean.portletRendered.dc_pb2}"
                           showDisclosure="false">
                <af:componentDragSource discriminant="portlet"/>
                <f:facet name="toolbar">
                  <af:commandImageLink id="p_cil2"
                                       icon="/images/removeselected_dwn.png"
                                       hoverIcon="/images/removeselected_ovr.png"
                                       depressedIcon="/images/removeselected_ena.png"
                                       actionListener="#{dashboardXBean.handleHideEvent}"
                                       rendered="#{attrs.sideNavRendered}">
                    <f:attribute name="portletId" value="dc_pb2"/>
                  </af:commandImageLink>
                </f:facet>
                <af:facetRef facetName="p2"/>
              </af:panelBox>Following is the code in the managed bean to persist changes:
        private void saveShowHideChange(String portletId, boolean isRendered) {
            FacesContext fc = FacesContext.getCurrentInstance();
            ChangeManager cm = RequestContext.getCurrentInstance().getChangeManager();
            //ChangeManager pcm = AdfFacesContext.getCurrentInstance().getPersistentChangeManager();
            UIComponent puc = boundedDashboard.findComponent(portletId);
            ComponentChange pcc = new AttributeComponentChange("rendered", Boolean.toString(isRendered));
            cm.addComponentChange(fc, puc, pcc);
        }I am not really sure if the above code needs to be in the component managed bean or in the bean of the page that uses this declarative component.
    Any pointers are appreciated.
    Thanks,
    Husain

    Thanks for the reply Frank.
    For declarative components do we have separate renderer?
    The [Developers Guide|http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/ad_persist.htm#BABBGCJA] didnt seem very helpful on this topic.
    Can you point me to some reference material if available.
    Thanks,
    Husain

  • 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

  • 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

  • Declarative component attribute binding

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

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

  • Today, I got a "update iTunes and tonight, I can't access my iTunes. I uninstalled and reinstalled and the error message reads: iTunesexe-unable to locate component. App has failed to start due to MSVCR80.dll was not found: Reinstall may fix" but hasn't.

    I received an iTunes update today and updates files. Tonight, I couldn't acces my iTunes. I uninstalled and reinstalled and still getting same error message: iTunes exe unable to locate component. This application has failed to start because MSVCR80.DLL was not found. Reinstalling the application may fix this problem.  I've done it several times and still get the error.  I'm fearful I have lost all my music.  What can I do?

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • JDeveloper 11.1.2.3, ADF Faces: need declarative component idea for table

    Some background:
    I'm trying to create a reusable toolbar for standard af:table behavior, see screen shot
    http://wesfang.files.wordpress.com/2013/05/dc.jpg
    I got the idea from the from using documentation Frank has published in the past
    1. http://www.oracle.com/technetwork/developer-tools/adf/learnmore/001-access-declarative-comp-attr-169113.pdf
    2. Adding a new row programatically
    The consuming subsystem's page passes in a "MyPageBean" which is a subclass of a "ArchBean" where all actionlistener operations are defined. The idea here is to minimize developer customization when using this component.
    ... <f:facet name="toolbar">             <af:toolbar id="t2">                 <mskcc:basicTransactionToolbar id="btt1" pageBean="#{MyPageBean}" tableId="t1"/>             </af:toolbar> </f:facet> ...
    The table within the consuming page is by default dropped off as a "editable" table. The developer needs to further modify the "disable" attribute to true for all the input fields and command components within the table. I would like to remove this developer step and instead have it in an architectural component. All ideas are welcome.

    Ok, finally got it working (sort of)
    Using the following method as you suggested:
    public void encodeChildren(FacesContext fc){
            try {          
                super.encodeChildren(fc);
                RichTable table =
                    (RichTable)ADFFacesUtil.findComponentInRoot((String)this.getAttributes().get("tableId"));
                lockUnlockTable(table); //method for toggling disable attribute for all command and input components
            } catch (IOException e) {
                e.printStackTrace();
    }Now the strange problem I encountered is that the encode methods are not called if the declarative component is defined within a panelCollection's f:facet-toolbar like below:
    <f:facet name="toolbar">
                        <mskcc:basicTransactionToolbar id="btt1" tableId="t1" pageBean="#{TestBean}"/>
    </f:facet>Also the above code has to be manually created because the design time editor does not allow me to drop off the dc within the toolbar facet (even though the dc is a toolbar!)
    Instead, If I move the dc outside the panelcollection, then the encode methods are invoked and the desired enable/disable behavior is correctly displayed.

Maybe you are looking for

  • Some calculation issues in Pivot table

    Hi all, I am using OBIEE 10.1.3.4.1 We have one requirment like this:      Product:1,2                               Month     Product     Region     District     Sales     Percent      201010     1     China     Shanghai     200000     25.00%       

  • Set with filter Expirationtime comparison current-datetime does not list members: regional settings?

    Hi all; I've created a criteria-based set that has to filter for users that have an "expiration Time" "prior to" "today". xpath filter: /Person[ExpirationTime < fn:current-dateTime()] I've got one user where I've set a date expired to a week ago. Whe

  • Bug in "Announce the time" on half hour

    I have the Clock configure to announce the time on the quarter hour (using Trinoids). Most of the announcements are fine however it regularly announces the half hour as "three" rather than "thirty". Curiously it happens on almost all, but not on ever

  • Having problems updating from IOS 4 to IOS 5

    I have a 3rd generation 8 gb Ipod Touch, my serial number is 8K030K575J. Im trying to update from IOS 4 to IOS 5, my current software version is 4.2.1 I click the button that says check for updates and it tells me that 4.2.1 is the most up to date ve

  • Safari quits EVERY TIME I try to download something...

    Please help -- I have no idea why this is happening. Ever since I upgraded to Tiger about 2 months ago I have had this problem. No matter what it is, as soon as I hit "Download Now," Safari crashes. It's so frustrating! What to do?