Polymorphism with data controls

Hi,
I have a requirement as below.
Interface ICommonProduct{
public void validate();
I have created an Common Application Module with name "CommonProductAM" . It's implementation class is CommonProductAMImpl and
the class is abstract and this class implements above interface and prodvides basic defination the method "validation"
public abstract Class CommonProductAMImpl implements ICommonProduct {
public void validate(){
System.out.println(" abstract class validate method of common product AM");
I have created another AM "XXXProductAM" and implemntation class is XXXProductAM and extends abstract AM class CommonProductAMImpl
public Class XXXProductAM extends CommonProductAMImpl {
public void validate(){
super.validate();
System.out.println(" XXXProductAM class validate method");
I have created another AM "YYYProductAM" and implemntation class is YYProductAM and extends abstract AM class CommonProductAMImpl
public Class YYYProductAM extends CommonProductAMImpl {
public void validate(){
super.validate();
System.out.println(" YYYProductAM class validate method");
From UI page of jspx , i want to add validate() method as a method action . I would like to add the validate method of
CommonProductAMImpl in bindings. but based on some attribute set in page scope / task flow as "XXX" or "YYY" ,
I would like to call respective AM validate method. (simply polymorphism)
(eg. if(attribute=="xxx"){
CommonProductAMImpl ob = new XXXProductAM();
ob.validate();
}else if(attribute=="YYY"){
CommonProductAMImpl ob = new YYYProductAM();
ob.validate();
How should i proceed for this?
Thanks,
Sulakshana.

Hi,
you could use a router for this..
I mean, you can expose both methods to the client interface and drop them to your task flow. Then with a router you would deside what to call.
Each method could then return to the same page for instance..
My question is: Are you sure that this approach is what you need?
You can have an hierarchy of AM ofcourse. But maybe this validation case can be achieved in the model layer with less effort..
Regards,
Dimitris.

Similar Messages

  • URGENT ! JDEV 10.1.2 Problem with data control generated from session bean

    I got a problem with data control generated from session bean which return a collection of data transfer object.
    The dto's seem to be correct. The session bean load correctly the data into and the object's are plenty of data. Using the console to display the dto content is ok.
    When generating a data control from this session bean and associate the dto included in the collection only the first object level and one-to-one dto object are correctly setted in the data control. Object that represent collection into the dto (one-to-many foreign key) are setted as collection with an iterator but the structure of the object is not setted. I don't know how to associate this second level of collection with the dto bean class to obtain the attributes definition.
    I created a case with hr schema like the hrApp demo application in the tutorial with departments and employees table. I got the same problem.
    Is it a bug ?
    It exists a workaround to force the data control to understand the collection data structure ?
    Help is welcome ! this is urgent !!!

    we found the problem by assigning the child dto bean class to the node representing the iterator in the xml file corresponding to the master dto.

  • Unexpected  behavior with data control palette after migration to 10.1.3

    I recently migrated my adf/struts app to 10.1.3 from 10.1.2.
    The app compiles and runs fine in jdev, and the migration had no errors.
    When I try to drag and drop attributes from the data control palette onto an existing (or new) page I get the “you can’t drop that here icon” circle with a line through it.
    This happens on all my pages and for every attribute in the data control including actions.
    Is this the intended behavior? In 10.1.2 there was a section that asked if it should be dropped as a label or text field etc, I don’t see that option anymore.
    I can still use the component palette  JSTL 1.0 core “out” and drag that onto the page and then bind the value to binding.attname. this works fine.
    In 10.1.3 faces I see that when I drag and drop I get a popup menu which shows the available type of component to drop the item as.
    Is this the correct behavior or am I missing something?
    I'm using jdev version 10.1.3.0.4 (SU2)
    Thanks

    So as far as I can tell the issue bioled down to having something wrong with my libraries definition. When would go to the project properties the libraries tab would not show correctly, I was able to remove some libraries and then add them back in. This made the libraries tab in the project properties work, and as a side effect fixed the data control drag and drop.
    thx

  • Problems with data controls from java classes in JSF pages.

    Hi! We have a problem in our Application that we are developing with JSF pages using Data Controls generated from facades java classes. When we running a page in debug mode and the page are loading, if we insert a breakpoint in the first line of method referenced in the data control, the execution enter two times in the method, and this is a problem for us. How to solve this?
    We are using JDeveloper 11.1.1.2 with ADF faces.

    You might need to play around with the refresh property of the action binding.
    http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/adf_lifecycle.htm#BJECHBHF

  • Keep Group headings with data - control your page breaks

    Trying to keep the group heading with the appropriate transaction information.  Currently, get a group heading at the bottom of a page and then the transactions print on the next page.   Difficult to determine what the transaction information is without the appropriate group headings displayed.   The amount of transaction data is not static, it varies from page to page.  Some of the reports can be close to 100 pages.   Please advise.

    Hi Kim,
    You can use the option u201CNew Page Afteru201D in Section Expert for Group Footer section so that the new group Header will display on the next page.
    Regards,
    Alpana

  • JDev 10.1.3 and data control

    I didn't find the data control palette in JDev 10.1.3. Does it mean data control are not yet implemented in this preview or do i something wrong ?
    Is it possible to obtain a version with data control implemented. We only use this portion of adf with ejb.

    thanks
    i'm a little bit confused by the fact that jsf in 10.1.3 preview use managed bean (instead of data control) to get/put data from the model layer.
    we are using entity bean and session facade. In 9.0.5.2 we are using dto and data control to generate our jsp.
    we are currently testing/discovering jsf and search the best way to efficiently generate our ui's
    what is right way for jsf
    a) managed bean (if it is possible with session bean)
    b) data control when/if available
    and why ?

  • Date Controls in repeating table of Infopath 2013 only showing Calendar in first row date controls

    I am using SharePoint 2013 and InfoPath 2013.
    and using form library which uploaded at server.
    I am using repeating table over section . and place Date Controls.
    At the run time it is showing first row with START and END
    date controls.
    when I click INSERT Item it is showing second row with
    Date Controls.
    It is opening and showing calendar only on first row.
    But when I click Date Control button at second row it is not showing or opening calendar.
    Yesterday it was working. but today is not working at site.
    Although it is working on InfoPath 2013 Preview.

    Hi John,
    Based on your description, my understanding is that the Date Control cannot work correctly in the InfoPath form.
    I recommend to re-publish the form to SharePoint and then compare the results.
    Please go to the Library setting page of the library where the form is published > click Advanced Settings > click Edit Template in the Document Template > now the form will be opened in InfoPath Designer and then click Quick Publish button in the
    top of the menu tab.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Refresh the object associated with a Row in a Data Control?

    I am using EclipseLink & have an issue with multiple updates of the same Row. During an update, a new instance of the entity is returned by the update method. The instance bound to the Row is not updated with this new version and subsequent updates fail with an optimistic locking exception since the entityVersion hasn't been updated.
    Question: Is it possible to refresh the instance associated with a data control Row? I can remove rows, create rows, but it is not apparent to me how to update a row. I am trying to avoid doing a full retrieve on the bound iterator.

    Hi!
    The issue here is, by my opinion, a gap between ADFm and EJB 3.0 in use-cases with large data sets. If you search this forum, you may find related thread by Pedja about problem of feasible "scrollable" af:table with large number of entities in EJB finder result list. Unfortunately, the ADFm "paged" fetching is in mismatch with EJB support for "paged" (or scrollable) results lists. The all results of EJB finder method are retrieved from data source, stored in memory (thus breaking the heap) and transferred to ADF datacontrol. Then, and only then, ADFm paged fetching and caching mechanisms are employed – but they are just cosmetics as the main data set is permanently stored in memory as List<?>. The workaround is, as Pedja discovered, to write completely proprietary TableCollectionModel which completely evades ADFm and is implemented by set of EJB Session methods for paged acces to datasource through TopLink and native database queries (enabling retrieval of particular range of rows instead a complete result set). Of course, this is very complex coding experience and I find it a not acceptable for efficient development of modern applications on ADF + EJB stack, especially as it brakes a technology independence promoted by EJB and EclipseLink and other standards-based technologies (as you have to use database-specific native query implementation for paged /scrollable access!).
    What I want to say is that I have feeling that ADF support for EJB is not complete in full extend and that ADFm is still much better suited for BCs then for EJBs. I hope that this will be solved in future as this issue may pose a significant issue on application development in enterprise-level area where it is supposed that we are dealing with BROWSING also a large data sets.
    Yes, I emphasize a BROWSING as I strongly oppose a dogmatic approach that SEARCHING is a solution for every use-case. From theory of information, the system SHOULD NOT limit the user in accessing ALL information (based on access rights, of course). So the idea that SEARCH forms should be used to bridge a architectural gap between a ADFm and EJB is not acceptable, as the search MAY limit the user in acquiring the information he (or she) is not able to describe in adequate manner based on search criteria offered by the developer. So, the developer may be responsible for misinformation of user, by limiting his access to information, jus for technology limitations of ADFm which forces a development of purely SEARCH-based functionalities.
    I hope that development team would appreciate and consider this remarks, and invest effort in closing (not bridging!) the gap between ADFm and EJB.
    Regards,
    PaKo

  • How can I create a query with web service data control?

    I need to create a query with web service data control, in WSDL, it's query operation, there is a parameter message with the possible query criteria and a return message contains the results. I googled, but cannot find anything on the query with web service. I cannot find a "Named Criteria" in web service data control like normal data control. In Shay's blog, I saw the topics on update with web service data control. How can I create a query with web service data control? Thanks.

    Hi,
    This might help
    *054.     Search form using ADF WS Data Control and Complex input types*
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html

  • Issue with webservice data control while invokin bpel process from ADF side

    Hello Experts,
    we are creating webservice data control to invoke bpel process from ADF side.
    When I run the application and inovoke the bpel every thing is working fine.
    But when we are changeing the instances from DEV to SIT the bpel url(hostname and port) will change.
    So we just edited DataControls.dcx file and we just replaced the wsdl url and trying to run the applicaiton.
    This time the applicaiton is not invoking the bpel process.
    If I remove the webservice data control and recreate it with new WSDL url then it is working fine.
    Can any one tell us what the exact issue is. Is there any other files do i need to modify or etc.
    Thanks & Regards
    Gayaz

    DataControls.dcx & connections.xml (.adf/META-INF)

  • "Source not found" Error creating URL Data control with query parameters

    Hi,
    I have a restful service for which i want to create a URL data control. I am able to create the URL data control successfully when i am not passing any parameters in the Source field. But if i am specifying the parameters in the source field like this Department=##ParamName##, something weird is happening. After giving the param string in the Source field, it asks for default param value to test the url. It tests the url successfully. After that i select XML as the data format in which i am mentioning the xsd like this . "file:///C:/..../something.xsd" . And this is when i am getting the error. "Invalid Connection. The source is not found". I am giving exactly same path for xsd which i gave while creating URL data control without query parameters. Infact i was able to create the URL data control with query parameters successfully till afternoon. after that it started giving me this error all of a sudden. Infact as soon as i was able to create a URL data contol with query parameter successfully, i took a backup of the application before moving further. But even that backup is not working now.
    As far as i understand, i dont think there will be any change in xsd if query params are passed to a web service. Please correct me if i am wrong.
    Just dont know what could be the issue. Please help
    Thanks

    Hi,
    xsd is used for the URL service to know what the returned data structure is so it can create the ADF DC metadata
    Frank

  • Using stored parameter from data control class with stacked bar-graph

    Hi folks,
    I'm relatively new to ADF & EJB so I want to apologise in advance if this question seems rudimentary to many of you.
    Edit:  I should have mentioned that I'm using JDeveloper 11.1.1.5
    I'm having a hard time determining how to retrieve the value from a variable to be assigned to a property of the bar graph I'm trying to display on my JSF page.
    I have tried to briefly summarise the logic below for reference.
    I have a data control class (ActivityChart) that includes a method "getActivityDetail" returns a List of custom Objects (ActivityDTO) that are the underlying data for my bar graph.
    public class ActivityChart {
        private Double axisScale;
        public ActivityChart() {
            super();
            axisScale = 0.0;
        public List<ActivityDTO> getActivityDetail(List<String> businessUnits) {
            List<ActivityDTO> returnNewList = new ArrayList<ActivityDTO>();
            List<TransactionDTO> dataList = new ArrayList<TransactionDTO>();
            TransactionSessionBean transBean = lookupTransactionSessionBean();
            if (businessUnits != null && !businessUnits.isEmpty()){
                dataList = transBean.getActivityData(SystemUtil.getCurrentUser(), businessUnits);           
                returnNewList = processTransactions(dataList);
                axisScale = calcAxisScale(returnNewList);
            return returnNewList;
    ...The TransactionDTO object is basically a mirror of the entity object to store the fields from the queried db transactions.
    The ActivityDTO object contains a String value (x-axis label) and 3 Double values for the values required for the bar graph.
    What I'm trying to do is dynamically set the scale for the 2 y-axes (I'm using a dual-axis stacked bar graph) because the auto calculated values are not aligned.
    Right now I've got the two relevant elements of the bar graph hard-coded with a specific axis value:
    <dvt:y1Axis axisMaxAutoScaled="false" axisMaxValue="100.0"/>
    <dvt:y2Axis axisMaxAutoScaled="false" axisMaxValue="100.0"/>.
    The value I want to use for the Y-axis is calculated and stored in the "axisScale" variable in the above class.
    Really at a loss of how to move forward from here.
    Would very much appreciate any guidance/direction offered.
    Thanks,
    Karim
    Edited by: 973742 on Nov 28, 2012 8:12 AM

    Looks like I may have found the answer!
    I had to set up the variable in the bindings for the page and then reference the variable from the binding and add the property inputValue.
    ie. value="#{bindings.axisScale.inputValue}"

  • How to make a jsf parameter form with a selectOneChoice and data control

    I want to make a parameter form with a selectOneChoice and store this value in a backing bean, so I can use as a bind variable in query. I already made it happen without data control
    Can someone show how to do it in adf data control. With the wizard it tries put the value
    in a viewobject but I don't have base or destination viewobject. I can change the pagedef
    so it works to fill the selectOneChoice but then I want to store the selected value in a session beab
    here is solution with the application module and request / session bean, I don't
    think it is the right solution
    thanks edwin
    jsf page
    <af:selectOneChoice label="Desk" value="#{selectDesk.desk}"
    id="DeskID"
    binding="#{selectDesk.deskBinding}"
    autoSubmit="true"
    valueChangeListener="#{selectDesk.deskChangeListener}">
    <f:selectItems value="#{selectDesk.deskSelectItems}"/>
    </af:selectOneChoice>
    Selektdesk backing bean
    public SelectDesk(){
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ValueBinding valueBinding = facesContext.getApplication().createValueBinding("#{userInfo}");
    userInfo = (UserInfo) valueBinding.getValue(facesContext);
    public List<SelectItem> getDeskSelectItems() {
    if ( userInfo.getSelectItems() != null ) {
    selectItems = userInfo.getSelectItems();
    return selectItems;
    if ( getBindings() != null ) {
    userInfo.setBindings( getBindings());
    else {
    setBindings(userInfo.getBindings()) ;
    if ( selectItems == null ) {
    selectItems = new ArrayList<SelectItem>();
    DCBindingContainer bc = getBindings();
    SicmaService sicma = (SicmaService)bc.findDataControl("SicmaServiceDataControl").getDataProvider();
    ViewObject desk = sicma.findViewObject("DeskSelectView1");
    desk.executeQuery();
    RowSet rows = desk.getRowSet();
    while (rows.hasNext()) {
    Row a = rows.next();
    String DskId = a.getAttribute(0).toString();
    String DskOms = a.getAttribute(1).toString();
    selectItems.add( new SelectItem(DskId ,DskOms ));
    rows.closeRowSet();
    userInfo.setSelectItems(selectItems);
    return selectItems;
    faces-config.xml
    <managed-bean>
    <managed-bean-name>selectDesk</managed-bean-name>
    <managed-bean-class>org.tennet.sicma.view.backing.SelectDesk</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>bindings</property-name>
    <property-class>oracle.adf.model.binding.DCBindingContainer</property-class>
    <value>#{bindings}</value>
    </managed-property>
    </managed-bean>

    The SRDemo has an example of a selectOneRadio bound to a parameter being used to pass to an ExecuteWithParams action (to automatically feed a view object's named bind variable. This is in the SRStaffSearch.jspx page.
    Also, if you check out example # 72 from my blog:
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html#72
    There is another example of using a selectOneListbox to do the same type of thing.
    The steps involved in creating something like this are to:
    (1) Define your named bind variables on your view object
    (2) Drop the "ExecuteWithParams" action in the operations folder of that view object from the Data Control Palette to your page as a "Parameter Form"
    (3) Drop the specific attribute (nested child of the "ExecuteWithParams" action from step (2) as whatever kind of selectOneXXXX control you want
    (4) Delete the extra field on the form you don't want.

  • Java.lang.NullPointerExecption error with ExecuteWithParam data control

    Hello,
    my application has a database connexion ; with the wizards, I made a Businness Components from Tables ; after that, I've changed the querry of my one and only View (btw, there are 4 entity objects). I put on a view criteria with a bind variable and the query in the xml file view is like this :
    SELECT CRAH.JOURINPUT,
    CRAH.CODEPROJET,
    CRAH.CODEANA,
    CRAH.DUREE,
    CRAH.DESCRIPTION,
    CRAH.IDUSER
    FROM CRAH CRAH
    WHERE Iduser=:VarIduser
    In my jsf page, I've dragged and dropped the ExecuteWithParams data control (in the same view as above) as an ADF Parameter form. I finally create an ADF table by dragging'n'dropping this very same view's datacontrol.
    The problem is when I run, it works!!! but after like 2 click on the execute with parameter button, I get a java.lang.NullPointerExecption for every attribute in the table.
    Could anybody gets me a piece of advice on this ? The thing is it works when I test with the Application Module. What's the problem here ?

    Hello.
    Well, even with a simple EO/VO for a single table, one view criteria and its bind variable, I get the same error. It still works in the AM test run. I get this error message in the embedded OC4J log :
    08/07/09 09:19:20 [757] **** refreshControl() for BindingContainer :oracle_jbo_uicli_binding_JUFormBinding_140
    08/07/09 09:19:20 [758] DCUtil, returning:oracle.adf.model.binding.DCParameter, for AMCADataControl
    08/07/09 09:19:20 [759] Reusing DC transform for AMCADataControl_sessiondef.view_pageDefs_view2PageDef_VOCA1_0_DynamicRegion
    08/07/09 09:19:20 [760] INFO: getDCKey for data.view_view2PageDef yielded view.DataBindings.cpx
    08/07/09 09:19:20 [761] variables variables passivated >>> ExecuteWithParams_CAVAR=FG
    08/07/09 09:19:20 [772] WARNING: data control: oracle_jbo_uicli_binding_JUFormBinding_140 is unknown in: view.DataBindings.cpx
    08/07/09 09:19:20 [773] INFO: getDCKey for data.view_view2PageDef yielded view.DataBindings.cpx
    So, do you think I did something wrong with the data control ? Because the problems core seems to be here. The thing is that they are automaticly created... so is there something else to do ?
    Frédéric

  • ADF Mobile: WebService data control method call with array

    JDev 11.1.2.3
    ADF Mobile deployed to Android emulator
    Hello All,
    I am trying to invoke a method in my Web Service data control and get the following exception
    Caused by: ERROR [oracle.adfmf.framework.exception.AdfInvocationRuntimeException] - Cannot serialize: [I@1dbae822
            at oracle.adfmf.dc.ws.soap.SoapTransportLayer.invokeSoapRequest(Lorg/ksoap2/SoapEnvelope;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.soap.SoapWebServiceOperation.invoke(Ljava/lang/String;Loracle/adfmf/dc/ws/soap/SoapGenericType;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.soap.SoapWebServiceOperation.invoke(Ljava/lang/String;Ljava/util/Map;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.JavaBeanOperation.execute(Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;(Unknown Source)
            at oracle.adfmf.dc.ws.WebServiceDataControlAdapter.invokeOperation(Ljava/util/Map;Loracle/adfmf/bindings/OperationBinding;)Z(Unknown Source)
            at oracle.adfmf.bindings.dbf.AmxMethodActionBinding.execute()Ljava/lang/Object;(Unknown Source) This method is an AppModule method exposed as a service interface and the parameter for this method is a List<oracle.jbo.domain.Number>. The schema definition for the input is as follows:
    <element name="acceptTask">
       <complexType>
         <sequence>
                <element maxOccurs="unbounded" minOccurs="0" name="taskID" type="decimal"/>
         </sequence>
       </complexType>
    </element>For the input to my binding, I have tried int[], Integer[] and List<Integer>. All of these result in similar errors.
    I have also tried invoking this through a regular ADF application and that works fine with an int[]. It looks like something specific to the ADF Mobile SOAP layer.
    Is this a bug or a restriction in the framework? Any workarounds that has worked for anyone?

    No luck. A WS DC method call with a simple parameter (java.lang.String or java.lang.Integer) works fine but I can't get it to work when there is an array input.
    I have tried WS methods with int arrays and simple string arrays without any luck. All of them result in a cannot serialize error.
    I can't figure out what I am doing wrong. Are there any working WS Datacontrol samples with array inputs?

Maybe you are looking for