11.1.2: Declarative-component problem!

Hi!
We're just evaluating 11.1.2. I converted some declarative components to 11.1.2/Facelets style, but I am running into problems.
As a test, I created some new components from scratch, confirming the issue.
I create a declarative component and choose "Facelets" and choose "Use custom component class".
JDeveloper then creates an entry in the jsf:
        <afc:component>
            <afc:display-name>testComponent</afc:display-name>
            <afc:component-class>component.TestComponent</afc:component-class>
            <afc:facet>
....After deployment, I just get an error. Facelets is reporting that there is no tag for "component-class", and examining component.taglib.xml in adf-richclient-impl-11.jar shows: Facelets is right! There is none!
Now, I cannot just remove the component-class entry. If I do that, then deployment works, but then JDeveloper creates during compilation a wrong "TestComponentComponent" class (which should extend TestComponent but doesn't!).
It just extends RichDeclarativeComponent, just like my original TestComponent class. All code in TestComponent is not available at runtime.
RichDeclarativeComponent
   |
   |
TestComponent    <---- This class is now for the birdsand
RichDeclarativeComponent
   |
   |
TestComponentComponent      <----- That class is used by the handlerIf I leave the component-class entry in, then - as expected - I get the correct hierarchy:
RichDeclarativeComponent
   |
   |
TestComponent
   |
   |
TestComponentComponentbut the component doesn't run.
So, now what? This cannot be the way it's supposed to work, can it. Manually edit the "component-class" stuff out of the jsf in the jar after deployment!?
Edit: Created SR 3-3856944401: Facelets-based declarative component with custom component class not working
Sascha
Edited by: Sascha Herrmann on Jun 17, 2011 6:41 PM

This is bug 12717940.
Sascha

Similar Messages

  • Creating Declarative Component problem.

    Dear all
    I use Jdeveloper 11.1.1.4.0.
    I am planing to create an ADF declarative Component.The component will be a panel collection layout which contains menu (Action>Export to excel) and command button (Add new record).
    The scenario will be like this:
    1- The developer will drag my new component (myCustomPanel) to his page and will drag the data control inside this comonent to create ADF Read only table.
    2- at runtime the table should appear surrounded by (myCustomPanel) and the user can use the "Action" menu to export the content to Excel, and can click on "Add new Record"to navigate to another page to add record.
    The solution I made is:
    in my "myCustomPanel" I created two attributes , the first one is "tableID" and the second is "targetPage" represents the outcome of the navigation to the "Add new record" page.
    The developer must provide these two attributes when using "myCustomPanel".
    The problem is:
    at runtime when the user click on "Add new record" button an error is raised .
    The error in this line:
    <af:commandToolbarButton text="Add" id="dc_ctb1" action="#{attr.targetPage}"/>
    the action property of the command button expects a managed bean. But i proved it with page attribute.
    I want to dynamicly provides the naviation outcome to the button using attribute name. Is this possible?
    regards

    Thank you so much for you replying.
    Your solution is helpful
    I tried to do the following :
    1- in my "customcomponent" project I removed the attribute "taregtPage"
    2- I added a method attribute
    name: targetPage
    method-signature: java.lang.String method()
    <af:componentDef var="attrs" componentVar="component">
        <af:panelCollection id="collection">
          <f:facet name="menus">
            <af:menu text="Action" id="dc_m1">
              <af:commandMenuItem text="Export To excel" id="dc_cmi1"/>
            </af:menu>
          </f:facet>
          <f:facet name="toolbar">
            <af:toolbar id="dc_t1">
              <af:commandToolbarButton text="Add" id="dc_add"
                                       action="#{attrs.targetPage}"/>
            </af:toolbar>
          </f:facet>
          <f:facet name="statusbar"/>
          <af:facetRef facetName="tableContent"/>
        </af:panelCollection>
        <af:xmlContent>
          <component xmlns="http://xmlns.oracle.com/adf/faces/rich/component">
            <display-name>dhamanTable</display-name>
            <facet>
              <facet-name>tableContent</facet-name>
            </facet>
            <attribute>
              <attribute-name>tableID</attribute-name>
              <attribute-class>java.lang.String</attribute-class>
              <required>true</required>
            </attribute>
            <component-extension>
              <component-tag-namespace>dhaman.custom</component-tag-namespace>
              <component-taglib-uri>/componentLib</component-taglib-uri>
              <method-attribute>
                <attribute-name>targetPage</attribute-name>
                <method-attribute>
                  <attribute-name>targetPage</attribute-name>
                  <method-signature>java.lang.String method()</method-signature>
                </method-attribute>
                <required>false</required>
              </method-attribute>
            </component-extension>
          </component>now My question is how to use it?
    I do not understand this
    action="#{component.handleTargetPage}" Do you mean that i will create amanaged bean "component" and add a methos "handleTargetPage"??
    Edited by: ta**** on Mar 9, 2011 1:58 PM
    Edited by: ta**** on Mar 9, 2011 2:00 PM
    Edited by: ta**** on Mar 9, 2011 2:01 PM

  • Problem attaching Declarative component library.

    I created a declarative component, deployed the jar file and created the FileSystem connection.
    When I try to add it to my project I don't receive any message but I don't see any result and the component is not visible in the palette.
    Why ?
    I've a jar file containing the declarative component I was able to attach to a project but not to another one.
    Could someone explain me :
    . how to attach ?
    . how to verify if it was correctly attached ?
    What's wrong ?
    Tks
    Tullio

    Hi,
    "Is this an ADF Library Jar tha tyou are creating?" ---> Yes
    "If so please make sure that the Project and package names are unique in both the project where you are creating it and in the project wher eyou are attaching it. " --> Yes
    "To see if the jar is correctly attached, go to the Project Properties -> Libraries an dClasspaths section and see if you can find a library called ADF Library." ---> I don't see any library with such name (in other "working" projects I saw a library called Library1 in Project specific libraries).
    "Also, you can find any messages in the Log in the message panel." --- > No messages at all
    "If your project is initialized for business components then go to Tools -> Preferences -> Business Components -> General
    Check the option - Show Imported ADF Library components in data control palette option and then try." ---> Done
    Tks
    Tullio

  • Component Declarative use problem

    Hi...
    I've made a declarative component with this characteristics:
    1.- An inputText for entrys of format number
    2.- With javaScript Code for formatting numbers
    3.- I've use client listeners for actions under inputext
    4.- I've define a general converter in faces-config and put that format in my inputtext
    5.- I've deploy my proyect and import in another proyect
    6.- I've drag a form and replace an input text with my component ...
    I'ts works but when I want to do commit the commit button it keeps disabled all time.
    What it's my error?
    Thanks In advance
    Edmar

    Hi,
    using ADF BC, the commit button is enabled as soon as the data has changed. If the commit button is the same button you want to use for submit, then you need to clear the disabled property field of the button
    Frank

  • 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.

  • ADF:LOV declarative component not working inside table component.

    Hi,
    I have created a custome LOV control,I am using this custom LOV control inside the table component,I am passing the below values as the parameter
    KeyValue="#{row.bindings.Value.inputValue}"
    LovModel="#{row.bindings.Value.listOfValuesModel}"
    Value- is the list of value attribute.
    When i click on the LOV search icon, the popup displays the Query model(it displays the list name at the top in the search page.so it is able to recognise the LOVmodel) but it is not able to retrive the list values.I am getting Query page with no values
    in the jspx page it is giving warning as "reference not found for row.bindings.Value.listOfValuesModel"
    Please can anyone help me on this?
    Thanks,
    Harish

    Hi Frank,
    below is my actual requirement and the solution i tried till now.
    I have a table and it has two columns let’s say “Columns” and “Values”. The first column i.e. “Columns” will be a dropdown and it will have predefined values, the other column “Values” will be a “List of value” control or similar kind of control in which the user can search and select multiple values from the popup list, and that list should dynamically bounded to the first column selected value.
    For Ex: if I select a value “Product” from the dropdown of the first column “Columns” , the control in the other column “Values” should bound to “product” list and I should be able to search and select multiple values from the pop up. And the popup should return the multiple selected values as a comma separated string to the textbox.
    In my requirement I have to use only VO’s to create the list and the control in the “Values” column should switch between these VO’s depending on the value selected in the first column.
    The solution we tried till now.
    I used a LOV switcher to achieve the above requirement. But we have a limitation in this approach as we could not do the multi select. Then we created a declarative LOV component in which we can select multiple values as a comma separated string from the popup.
    I retained the LOV switch model , instead of binding LOV switch model to the basic “Input List of Value” control in the JSPX page ,I used the LOV declarative component. Below is the code snippet which calls the declarative LOV component from JSPX page.
    <af:panelFormLayout id="pfl2">
    <af:selectOneChoice value="#{bindings.Columns.inputValue}"
    label="#{bindings.Columns.label}"
    required="#{bindings.Columns.hints.mandatory}"
    shortDesc="#{bindings.Columns.hints.tooltip}"
    id="soc3" autoSubmit="true">
    <f:selectItems value="#{bindings.Columns.items}" id="si5"/>
    </af:selectOneChoice>
    <mc:OraMultiSelect
    KeyValue="#{bindings.Value.inputValue}"
    LovModel="#{bindings.Value.listOfValuesModel}"
    id="oms2"/>
    </af:panelFormLayout>
    Where Value attribute is having LOVModel.
    The above code perfectly fine as I used it inside the “Form layout” and with the parameters passed as KeyValue="#{bindings.Value.inputValue}"
    LovModel="#{bindings.Value.listOfValuesModel}"
    The problem I am facing:
    The actual problem comes when I use this control inside the table which I required in my implementation.
    I called the declarative LOV control as shown below inside the table as I used to call the basic “Input List of value” control which works fine inside the table.
    . <af:column sortProperty="Value" sortable="false"
    headerText="#{bindings.OpPlanning1.hints.Value.label}"
    id="c1" width="133">
    <mc:OraMultiSelect KeyValue="#{row.bindings.Value.inputValue}"
    LovModel="#{row.bindings.Value.listOfValuesModel}"
    id="oms1"/>
    </af:column>
    Above code doesn’t works fine when I select value from the “Column” dropdown it displays the corresponding list model in the pop up but not able to retrieve the value of the list in the popup .
    If I pass the parameters as
    . <af:column sortProperty="Value" sortable="false"
    headerText="#{bindings.OpPlanning1.hints.Value.label}"
    id="c1" width="133">
    <mc:OraMultiSelect KeyValue="#{bindings.Value.inputValue}" --instead of ="#{row.bindings.Value.inputValue}"
    LovModel="#{bindings.Value.listOfValuesModel}"--}" --instead of ="#{row.bindings.Value.inputValue}"
    id="oms1"/>
    </af:column>
    It works fine for the first row.The subsequent rows refers the value selected in the first row dropdown.
    Thanks For the help,
    Harish
    Edited by: 886523 on Nov 3, 2011 8:04 AM

  • Declarative Component : UploadedFile Isssue for multiple file Upload case.

    Hi,
    I have made one declarative component for the multiple file upload case; where i have add button that dynamically adds af:inputFile component to the popup dialog and similarly delete button to dynamically delete the selected inputFile component. Everything work fine such as:
    1. add button adds the inputfile component properly and delete does the same.
    2. upload of Multiple files also works fine. ( I keep the uploadedFile in the java.util.Map which is the pageFlowScope and once, Dialog box ok/cancel is clicked, i clear everything back).
    IT WORKS GREAT WHEN:
    User hit 5 times add button if they want to upload 5 images. and do upload for all the 5 inputFile components . (Add or Delete button should not be clicked after any upload , but before you can.)..
    THE ONLY PROBLEM IS WHEN:
    1. user uploaded; say 2 images but not yet clicked in the ok/cancel button yet... they are still in the upload dialog ..and hit ADD button again.
    2. After that user uploads say another file/image and now UploadedFile's getInputStream() returns null, length becomes 0 for all the other uploadedFile except this newly uploaded file.
    Now, here is the thing, i wrote my own customUplodedFile class which is just a wrapper and it return getInputStream() from this class and length from this class and it is working.... But i am not sure why does the uploadedFile loses it's value...
    import org.apache.myfaces.trinidad.model.UploadedFile;
    public interface ICustomUploadedFile
      extends Serializable, UploadedFile
      public String getFilename();
      public String getContentType();
      public long getLength();
      public Object getOpaqueData();
      public InputStream getInputStream();
      public void dispose();
    ====================
    public class CustomUploadedFile
      implements ICustomUploadedFile, Serializable
      private transient UploadedFile mUploadedFile;
      private transient InputStream mInputStream;
      private long mLength;
      public CustomUploadedFile()
      public CustomUploadedFile(UploadedFile pUploadedFile)
        this.mUploadedFile = pUploadedFile;
        this.mLength = pUploadedFile.getLength();
        try
          this.mInputStream = pUploadedFile.getInputStream();
        catch (IOException e)
          e.printStackTrace();
      public String getFilename()
        return mUploadedFile.getFilename();
      public String getContentType()
        return mUploadedFile.getContentType();
      public long getLength()
        return mLength;
      public Object getOpaqueData()
        return mUploadedFile.getOpaqueData();
      public InputStream getInputStream()
        return mInputStream;
      public void dispose()
        mUploadedFile.dispose();
    } Now, my questions are:
    1. Is there a way i could follow to not to lose the UploadedFiles's inputStream and length by not using my wrapper class but in a standard way/best way.
    2. I am not happy although it works because it is not making sense to me at all.....Why does the wrapper working though when i have transient variables; like UploadedFiles... and it's transient variables are lost why not mine.
    I am totally confused at this stage.. Need your help.
    Thanks

    any one??

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

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

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

  • 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

  • Tinymce declarative component not working when added with PPR

    I have a declarative component that i exposed in a resource catalog.
    This component uses <af:resource> to inject javascript in the page.
    the problem that i have is when in editing mode, and you add the component. the components <af:resource> is not yet injected and i have to manually refresh my browser to see the effect.
    I am trying to integrate TinyMCE as a component.
    This problem occurs because when you click the add button it does a PPR.
    If i load a page where my component was already on, I don't have this problem.
    I also tried a refresh commandButton, but because forcePPR is configured in the web.xml and I may not change this, it is not executed correctly.
    Any ideas to solve this, or a workaround would be helpful?
    thanks in advance
    <af:group id="dc_g1">
          <af:commandButton text="refresh"
                            actionListener="#{backingBeanScope.tinymceBean.addScripts}"/>
          <af:resource type="javascript" source="/tiny_mce/tiny_mce.js" />
          <af:resource type="javascript" source="/tiny_mce/config.js" />
          <af:inputText simple="true" value="#{attrs.value}" styleClass="AFStretchWidth"
                        id="dc_it1" rows="2" />
          <af:resource type="javascript" text="initTiny();" />
        </af:group>

    Try collecting a Process Monitor trace https://technet.microsoft.com/en-us/sysinternals/bb896645 to check what is the Access is being Denied on.
    Windows Store Developer Solutions, follow us on Twitter:
    @WSDevSol|| Want more solutions? See our blog

  • 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

  • Render declarative component at runTime

    hi,
    i have a requirement to render several declarative component one at a time in my page from a list of defined declarative component based on tld.
    Can anyone suggest if this is possible via programatically i.e creating a new DC at run time or if some other method is there.
    Please share your valuable thoughts.

    hi,
    this not about simple rendering the point is how the declarative component generated at run-time will refer to the single declarative component from a list of declarative component already generated and placed under some other project.
    for ex-
    RichDeclarativeComponent rdc= new RichDeclarativeComponent();
    now you can render property or whatever the properties here using rdc.propertyName.
    but problem is how to refer to the declarative component defined in some .jspx for example
    custom name.jspx declarative component is defined at some other place now I need to show this declarative component " name" into my page.
    as we drag and drop declarative component from component palette I need to do this programmatically.

  • Dynamic Declarative Component managed bean returned null

    Hi,
    In a project from an application a DDC component is defined. This component uses a managed/backing bean with view scope.
    Using this component inside this project is working fine. This component should be used in other view controller projects, and here where the problems are.
    This project(let's call it Common) is deployed as ADF Library jar, and used in the other V-C projects.
    The big problem is that the managed bean defined for the logic of this component is not 'reacheable'.
    (Another problem is that the attribute value is not seen as its EL expression but as string, for this i found a workaround.)
    In project Common the adfc-config.xml file:
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <managed-bean id="__4">
        <managed-bean-name id="__2">ExtendedShuttle</managed-bean-name>
        <managed-bean-class id="__1">com.xyz.portal.taskflow.common.extendedshuttle.ExtendedShuttle</managed-bean-class>
        <managed-bean-scope id="__3">view</managed-bean-scope>
      </managed-bean>
    </adfc-config>A part from component declaration:
          <af:table var="row" rowBandingInterval="0" id="ta"
                                  rowSelection="multiple" columnStretching="last"
                                  disableColumnReordering="true" fetchSize="-1"
                                  binding="#{viewScope.ExtendedShuttle.allItemsTable}"
                                  value="#{viewScope.ExtendedShuttle.allModel}"
                                  partialTriggers="::dc_cb5 ::dc_cb3"
                                  filterVisible="true"/>The root exception is :
    javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
    This exception is throw on com.sun.faces.application.ApplicationImpl.createComponent when *#{viewScope.ExtendedShuttle.allItemsTable}* is evaluated.
    Caused By: javax.faces.FacesException: javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:262)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
         at javax.faces.webapp.UIComponentClassicTagBase.createFacet(UIComponentClassicTagBase.java:510)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:661)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1142)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:70)
         at oracle.adfinternal.view.faces.taglib.UIXTableTag.doStartTag(UIXTableTag.java:41)
         at oracle.adfinternal.view.faces.unified.taglib.data.UnifiedTableTag.doStartTag(UnifiedTableTag.java:50)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
    Caused By: javax.faces.FacesException: javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:262)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
         at javax.faces.webapp.UIComponentClassicTagBase.createFacet(UIComponentClassicTagBase.java:510)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:661)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1142)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:70)
         at oracle.adfinternal.view.faces.taglib.UIXTableTag.doStartTag(UIXTableTag.java:41)
         at oracle.adfinternal.view.faces.unified.taglib.data.UnifiedTableTag.doStartTag(UnifiedTableTag.java:50)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
    Caused by: javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
         at com.sun.el.parser.AstValue.getTarget(AstValue.java:88)
         at com.sun.el.parser.AstValue.setValue(AstValue.java:133)
         at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:255)
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:259)
    Can you help figure it out, why is not working or why the managed bean is not visible in other projects but only in the one where the component is defined?
    Thank you for your time,
    Bogdan
    ps: how can i format the source code, on this fourm?

    Hi Frank,
    Thank you for the answer.
    I must say i'm quite new with ADF technology and maybe my questions are silly.
    Here is a Quote from "Oracle Fusion Developer Guide - Building Rich Internet Application with Oracle ADF" by Frank Nimphius and Lynn Munsinger Chapter 15 page 498:
    "You build dynamic declarative components *instead* of tag library based declarative components, if component resuse is required *only within the application* that has the component defined."
    Maybe i misunderstand the meaning of application from this sentence, but i need this component in several ViewController projects from only one application (ADF application).
    Tag lib declarative component I would not like to have, since the (automtically) build process is not my responsability and it will take some time till is pinpointed, but still is a last resort.
    Anyway two things are strange:
    1. Why the component is still available in other projects(and the beans not)?
    2. Why when a binding variable (for example: of type FaceCtrlHierBinding) has the correct type in the declarative project and in the order projects is of type String and its value is the variable name?
    Example:
    <af:declarativeComponent ...
    AllItems="#{bindings.Action}"
    In project where the component is declared its value is an instance of FacesCtrlHierBinding and in the rest of the projects is of type String with value "Action".
    Once again thank you a lot,
    Bogdan

  • Dynamic declarative component won't work properly within table row

    Hi guys,
    I built a dynamic declarative component which basically consists of an af:inputText surrounded by a af:panelLabelAndMessage tag.
    The component works fine until I put it inside a table column, then none of the attribute values get set.
    The problem seems to be related to the table row binding #{row.binding.Name.inputValue} , if I use a regular binding #{binding.Name.inputValue} it works ok.
    The declarative components attribute is defined as
    <attribute>
        <attribute-name>kbez</attribute-name>
        <attribute-class>java.lang.Object</attribute-class>
    </attribute>and is used as the inputText's value attribute
    <af:componentDef var="attrs" componentVar="component">
        <af:panelLabelAndMessage label="#{attrs.label}" id="dc_plam1"
                                 for="dc_it1" labelStyle="white-space:nowrap;"
                                 showRequired="#{attrs.showRequired}"
                                 rendered="#{attrs.rendered}">
            <af:inputText id="dc_it1" value="#{attrs.kbez}"
                          autoSubmit="true" immediate="false" ...>The component inside a table column is set like this
    <af:declarativeComponent viewId="/WEB-INF/ikb.adf.kreda.basis/mitarbeitersuche/ddc/mitarbeiterLOV.jsff"
                             id="ddc1" label="Mitarbeiter"
                             kbez="#{row.bindings.Kbez.inputValue}"/>My JDeveloper version is 11.1.1.5.
    Am I doing it wrong or is this a bug?
    Any help is appreciated.
    Thank you,
    Achim
    Edited by: Achim Rosenfeld on Mar 8, 2013 8:41 AM

    Hi,
    +#{row.binding.Name.inputValue} , if I use a regular binding #{binding.Name.inputValue} it works ok.+
    Don't think that #{binding.Name.inputValue} works okay in a table because it doesn't stamp the component per row. Actually I don't know if we support dynamic declarative components in a stamped environment (table). I know though that we don't for taglib declarative components in this context.
    Reason why it doesn't work: Tables are stamped at runtime, which means that for better performance, only the generated HTML is reused for each row with different data - not the component. Your component requires itself to be re-created for each row so it can re-read the attribute again. This is not the case in a stameped environment
    Solution: For your particular use case I don't think that a dynamic declarative component is needed as you can add the construct (af:inputText surrounded by a af:panelLabelAndMessage) directly into an af:column tag. The declarative component makes more sense for reuse of layout areas (e.g. custom tabs) that are iterated within an af:forEach (in which case instances of the decalarative components would be created).
    Bottom line: tables stamp their components and as such the attribute property exposed on a DDC doesn't seem to be called for each row, which is by design. This can be considered a bug if there is a use case demanding for a DDC in a table. If this is a requirement for you (and you can't directly add the components to the af:column tag) feel free to file this as a service request with customer support (required a support contract) so development can have a look if the requirement is feasible to implement.
    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

Maybe you are looking for