Dynamic binding problem

I have a problem, i want to use a extend to arraylist to implement different validation to objects. So i added a method add(Person person), dynamic binding, but it has a incorrect behavior, i think
import java.util.ArrayList;
import java.util.Collection;
public class Test {
     class MyList extends ArrayList {
          public boolean add(Object arg0) {
               System.out.println("add norm");
               return super.add(arg0);
          public boolean add(Person arg0) {
               System.out.println("add person");
               return super.add(arg0);
     class Person{
     public static void main(String[] args) {
          new Test().test();
     private void test() {
          Collection col1 = new MyList();
          col1.add(new Person());
          ArrayList col2 = new MyList();
          col2.add(new Person());
          MyList col3 = new MyList();
          col3.add(new Person());
}My output=
add norm
add norm
add person
My wanted output
add person
add person
add person
Why?

in case you don't understand why you're getting "addning norm"
you are using polymorphism. You declared your objects to be of type Collection and ArrayList. This means you can only use methods of those type, eventhough the underlying object is a MyList instance. Now, Collections and ArrayList class only have the add(Object obj) method signature....so, when you say add(new Person()), it will only see add(Object obj)
When you declared your object as MyList, then it see add(Person p), so it use the add(Person p) method.

Similar Messages

  • 10g Signal Handlers and Dynamic Binding Problems on Mac OS X

    I have the following env vars set up, and it seems the client libs show a deadl\
    ock behavior post installation. SqlPlus exhibits a similar problem with 10g cli\
    ent libs on the Mac, since it simply hangs for 20 secs before returning the pro\
    mpt. I have G4 10.3.4 Mac, and 3.3 (1640) gcc, and still haunted by this probl\
    em...
    ORACLE_HOME=/Users/Oracle/10g/orahome
    ORACLE=ORACLE_HOME/bin
    ORACLE_BASE=/Users/Oracle/10g
    DYLD_LIBRARY_PATH=/Users/Oracle/10g/orahome/lib
    a) ktrace sqlplus user/pass@db
    b) kdump -R | grep sigaction gives:
    885 sqlplus 5.877734 CALL sigaction(0x2,0xbffff500,0xbffff570)
    885 sqlplus 0.001252 RET sigaction 0
    885 sqlplus 0.002032 CALL sigaction(0xd,0xbfff90f0,0xbfff9160)
    885 sqlplus 0.001831 RET sigaction 0
    885 sqlplus 0.001293 CALL sigaction(0x12,0xbfffb6e0,0xbfffb750)
    885 sqlplus 0.001234 RET sigaction 0
    885 sqlplus 0.001551 CALL sigaction(0x12,0xbfffbda0,0xbfffbe10)
    885 sqlplus 0.001401 RET sigaction 0
    885 sqlplus 0.001331 CALL sigaction(0x2,0xbfffd090,0xbfffd100)
    885 sqlplus 0.001333 RET sigaction 0
    This shows a 5.9 sec delay for the first sigaction, and a full response is received some long 20 secs later on the prompt.
    Some feedback from engineering regarding this issue since the 9i release has been:
    "This is a known problem with signal handlers and the lazy binding we have on Mac OS X. A small change to how Oracle library's signal
    handler is installed using _signal_nobind(3) and
    _dyld_lookup_and_bind_fully(3) could help to solve this problem.
    The problem that we are trying to avoid is a possible dead lock from
    code that could be called in a signal handler when the thread that
    gets the signal is in the middle of lazy binding a symbol. So when a
    signal handlers installed the default action is to cause it to be
    bound fully. This is made very expensive by the mismatch of the
    interfaces to signal(3) and segvec(2) like routines which are passed
    an address and the dynamic linker that wants a global symbol name. So the end result is to call the routine _dyld_bind_fully_image_containing_address(3) with the address of the signal handler to be bound. Which binds everything in the image (in this case the Oracle shared library).
    We have had problems like this before. For example: [This is what is
    done in usleep(3)]
    usleep()
    /* code removed for this example */
    setvec(vec, sleepx);
    #ifdef __DYNAMIC__
    _dyld_lookup_and_bind_fully("_usleep", NULL, NULL);
    (void) _sigvec_nobind(SIGALRM, &vec, &ovec);
    #else
    (void) sigvec(SIGALRM, &vec, &ovec);
    #endif
    static void sleepx(int unused)
    ringring = 1;
    The use of _sigvec_nobind(2) (or _signal_nobind(3) ) and the use of
    _dyld_lookup_and_bind_fully(3) will cause just the needed symbols used by the signal handler. "
    It seems this issue hasn't been resolved in the most recent 10g client release.Can anyone shed some light one this issue?
    For better demonstration, here is a series of steps we took here:
    sigaction.c - C file produced by "proc sigaction.pc"
    sigaction.pc - ProC source file
    gcc_sig* - Shell script to compile sigaction.c
    ktrace.sigtest - raw ktrace output from running sigtest
    ktrace.sqlplus - raw ktrace output from running sqlplus
    kdump.sqlplus - output of kdump -R on ktrace.sqlplus
    kdump.sigtest - output of kdump -R on ktrace.sigtest
    sigaction.lis - auxiliary file produced by proc
    1. sigaction.pc:
    #include <stdio.h>
    #include <stdlib.h>
    #include "/Users/oracle/10g/orahome/precomp/public/sqlca.h"
    int main(int argc, char **argv) {
    char user[30], passwd[30], db[40];
    char con_str[100], date[10], *icp;
    strcpy(user, "XXXXXXXX");
    strcpy(passwd, "XXXXXXXX");
    strcpy(db, "db_name");
    sprintf(con_str,"%s/%s@%s",user,passwd,db);
    EXEC SQL CONNECT :con_str;
    EXEC SQL SELECT SYSDATE INTO :date FROM DUAL;
    printf("SYSTEM DATE = %s\n",date);
    EXEC SQL COMMIT RELEASE;
    2. gcc_sig:
    #!/bin/sh
    CFLAGS="-I$ORACLE_HOME/precomp/public -I/usr/include"
    CFLAGS="$CFLAGS -I$ORACLE_HOME/lib -L$ORACLE_HOME/lib"
    ORALIBS="-L$ORACLE_HOME/lib -lclntsh $ORACLE_HOME/lib/nautab.o $ORACLE_HOME/lib/naeet.o"
    CC="gcc -g"
    PROG=$1
    OUTPUT=$2
    $CC $CFLAGS $PROG -o $OUTPUT $ORALIBS
    3. Generate the rest of the output files for your viewing of the results based on the commands provided above.
    Thanks!

    It's a delay, not a deadlock, that originatesfrom the way Oracle
    libraries handle dymaic bindings.to "dynamic" bindings. Maybe prebinding could help ?
    export DYLD_PREBIND_DEBUG=1ronr@[email protected]:/Users/ronr
    sqlplus "/ as sysdba"dyld: sqlplus: prebinding disabled because library: /Users/oracle/product/server/10.1/lib/libsqlplus.dylib got slid
    dyld: in map_image() determined the system shared regions ARE used
    dyld: 2 two-level prebound libraries used out of 5
    Ronald
    http://homepage.mac.com/ik_zelf/oracle/

  • Dynamic binding of items in sap.m.Table using XML views

    Dear SAPUI5 guru's,
    Let's start by saying I'm an ABAP developer who's exploring SAPUI5, so I'm still a rookie at the time of writing. I challenged myself by developing a simple UI5 app that shows information about my colleagues like name, a pic, address data and their skills. The app uses the sap.m library and most of the views are XML based which I prefer.
    The data is stored on an ABAP system and exposed via a gateway service. This service has 2 entities: Employee and Skill. Each employee can have 0..n skills and association/navigation between these 2 entities is set up correctly in the service. The data of this service is fetched from within the app using a sap.ui.model.odata.ODataModel model.
    The app uses the splitApp control which shows the list of employees on the left side (master view). If a user taps an employee, the corresponding details of the employee entity are shown on the right (detail view).
    Up till here everything is fine but I've been struggling with my latest requirement which is: show the skills of the selected employee in a separate XML view when the user performs an action (for the time being, I just created a button on the detail view to perform the action). After some hours I actually got it working but I doubt if my solution is the right way to go. And that's why I'm asking for your opinion here.
    Let's explain how I got things working. First of all I created a new XML view called 'Skills'. The content on this view is currently just a Table with 2 columns:
    <core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
      controllerName="com.pyramid.Skills" xmlns:html="http://www.w3.org/1999/xhtml">
      <Page title="Skills"
           showNavButton="true"
           navButtonPress="handleNavButtonPress">
      <content>
      <Table
       id="skillsTable">
      <columns>
      <Column>
      <Label text="Name"/>
      </Column>
      <Column>
      <Label text="Rating"/>
      </Column>
      </columns>
      </Table>
      </content>
      </Page>
    </core:View>
    The button on the Detail view calls function showSkills:
    showSkills: function(evt) {
      var context = evt.getSource().getBindingContext();
      this.nav.to("Skills", context);
      var skillsController = this.nav.getView().app.getPage("Skills").getController();
      skillsController.updateTableBinding();
    Within 'this.nav.to("Skills", context);' I add the Skills view to the splitApp and set its bindingContext to the current binding context (e.g. "EmployeeSet('000001')"). Then I call function updateTableBinding in the controller of the Skills view which dynamically binds the items in the table based on the selected employee. So, when the ID of the selected employee is '000001', the path of the table's item binding should be "/EmployeeSet('000001')/Skills"
    updateTableBinding: function(){
      var oTemplate = new sap.m.ColumnListItem(
      {cells: [
              new sap.m.Text({text : "{Name}"}),
              new sap.m.Text({text : "{Rating}"})
      var oView = this.getView();
      var oTable = oView.byId("skillsTable");
      var oContext = oView.getBindingContext();
      var path = oContext.sPath + "/Skills";
      oTable.bindItems(path, oTemplate);
    Allthough it works fine, this is where I have my first doubt. Is this the correct way to bind the items? I tried to change the context that is passed to this.nav.to and wanted it to 'drill-down' one level, from Employee to Skills, but I couldn't manage to do that.
    I also tried to bind using the items aggregation of the table within the XML declaration (<Table id="skillsTable" items="{/EmployeeSet('000001')/Skills}">). This works fine if I hard-code the employee ID but off course this ID needs to be dynamic.
    Any better suggestions?
    The second doubt is about the template parameter passed to the bindItems method. This template is declared in the controller via javascript. But I'm using XML views! So why should I declare any content in javascript?? I tried to declare the template in the XML view itself by adding an items tag with a ColumnListItem that has an ID:
                    <items>
                        <ColumnListItem
                        id="defaultItem">
                        <cells>
                            <Text text="{Name}"/>
                            </cells>
                            <cells>
                            <Text text="{Rating}"/>
                            </cells>
                        </ColumnListItem>
                    </items>
    Then, in the updateTableBinding function, I fetched this control (by ID), and passed it as the template parameter to the bindItems method. In this case the table shows a few lines but they don't contain any data and their height is only like 1 mm! Does anyone know where this strange behaviour comes from or what I'm doing wrong?
    I hope I explained my doubts clearly enough. If not, let me know which additional info is required.
    Looking forward to your opinions/suggestions,
    Rudy Clement.

    Hi everybody,
    I found this post by searching for a dynamic binding for well acutally not the same situation but it's similar to it. I'm trying to do the following. I'm having a list where you can create an order. On the bottom of the page you'll find a button with which you're able to create another order. All the fields are set to the same data binding ... so the problem is if you've filled in the values for the first order and you'll press the button you'll get the same values in the second order. Is it possible to generate a dynamic binding?
    I'm going to post you a short code of what I'm meaning:
    <Input type="Text" value="{path: 'MyModel>/Order/0/Field1'}" id="field1">
         <layoutData>
                    <l:GridData span="L11 M7 S3"></l:GridData>
               </layoutData>
    </Input>
    As you can see I need to set the point of "0" to a dynamic number. Is there any possibility to reach this???
    Hope you can help
    Greetings
    Stef

  • Dynamic binding of partner links with different payloads

    In dynamic binding of partner links, can we have different payloads for different
    webservices ?

    Hi Marc,
    I have one question regarding the use of <xsd:anyType>, Before that let me clear our requirement. We are trying to create a BPEL flow (Consumer) which has the ability to call other webservices (Producers) dynamically. There can be a number of Producer Webservices performing the same task. The end user should be able to add new Producer Webservices and remove already existing ones. We achieved this using EndPointReference (http://www.oracle.com/technology/pub/articles/bpel_cookbook/carey.html) but the problem with this approach is that all the producer webservices have to work on a common schema. We want to support webservices working on different payloads.
    My understanding is that when we map the XML document to xsd:anyType in the service's WSDL file, the producer web service need to have an implementation of this type in for of a java class. Is this correct ? Or can we provide the java implementation in our code itself? Can you please point me to some detail documentation on xsd:anyType?
    Thanks

  • Dynamically binding VO Parameter from Context Switcher

    Hi guys,
    I am using ADF JSF and BC, and I have a situation here which is:
    1) My JSF page has a panel page component, inside it is a navigable form referencing a View Object.
    2) In the contextSwitcher facet of this PanelPage, i have a SelectInputText which points to a "Globals" VO, having only one row ever (similar to SRDemo)
    3) When the LOV returns value to this field, i must re-bind the navigable form VO Query to this value, and the form must show the first record of the NEW rowset.
    The solution i am writing uses a ValueChangeListener on the SelectInputText, which runs an Application Module method that gets the value from the Globals VO and re-runs the query using "vo.setWhereClause" and "vo.executeQuery".
    However, even though i debug the application and see the query being executed, the form shows strange behavior, as the page then re-runs the query, but swaps the first row of the new rowset with the row currently displayed. For example, suppose that i am seeing row "X" on the page and select a value from the LOV. The new execution fetches rows "Y" and "Z" from DB. When i scroll the page, i see that the first record is "X" again, followed by "Z"!
    Do you have any idea of what could be the problem? Maybe a form clearance issue with ADF? Or i shouldn't be using dynamic binding with UPDATEABLE fields on the page, only when i use READ-ONLY fields?
    Thanks a lot, and regards!
    Thiago

    Thiago,
    you are not showing any of your code and I can only assume that this is a coding problem of yours.
    Frank

  • Dynamic bind parameters failure

    Hi
    Ive dynamically bind parameters in view object
    JHeadstart 10.1.2.0 (build 19). The data is getting bind. But with the following error. Kindly help me.
    regards
    Jayashri
    17:30:42 DEBUG (JhsDataAction) -ViewObject programView1: value of bind param 0 set to 04
    17:30:42 DEBUG (JhsDataAction) -ViewObject programView1: value of bind param 1 set to BORE
    17:30:42 DEBUG (JhsDataAction) -ViewObject programView1: executing query, bind parameter values have changed
    05/04/01 17:30:43 java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    05/04/01 17:30:43      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137)
    05/04/01 17:30:43      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)
    05/04/01 17:30:43      at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1552)
    05/04/01 17:30:43      at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2896)
    05/04/01 17:30:43      at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2942)
    05/04/01 17:30:43      at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:691)
    05/04/01 17:30:43      at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:547)
    05/04/01 17:30:43      at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3422)
    05/04/01 17:30:43      at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:663)
    05/04/01 17:30:43      at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:769)
    05/04/01 17:30:43      at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:706)
    05/04/01 17:30:43      at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3361)
    05/04/01 17:30:43      at oracle.adf.model.bc4j.DCJboDataControl.executeIteratorBindingIfNeeded(DCJboDataControl.java:803)
    05/04/01 17:30:43      at oracle.adf.model.binding.DCIteratorBinding.executeQueryIfNeeded(DCIteratorBinding.java:1587)
    05/04/01 17:30:43      at oracle.adf.model.binding.DCBindingContainer.refreshControl(DCBindingContainer.java:1544)
    05/04/01 17:30:43      at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.applyIterBindParams(JhsDataAction.java:2785)
    05/04/01 17:30:43      at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.prepareModel(JhsDataAction.java:3136)
    05/04/01 17:30:43      at oracle.adf.controller.struts.actions.DataAction.prepareModel(DataAction.java:486)
    05/04/01 17:30:43      at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:105)
    05/04/01 17:30:43      at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:223)
    05/04/01 17:30:43      at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.handleLifecycle(JhsDataAction.java:389)
    05/04/01 17:30:43      at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:155)
    05/04/01 17:30:43      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    05/04/01 17:30:43      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    05/04/01 17:30:43      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
    05/04/01 17:30:43      at oracle.jheadstart.controller.strutsadf.JhsActionServlet.process(JhsActionServlet.java:127)
    05/04/01 17:30:43      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:509)
    05/04/01 17:30:43      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    05/04/01 17:30:43      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    05/04/01 17:30:43      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    05/04/01 17:30:43      at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    05/04/01 17:30:43      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)
    05/04/01 17:30:43      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
    05/04/01 17:30:43      at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
    05/04/01 17:30:43      at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
    05/04/01 17:30:43      at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
    05/04/01 17:30:43      at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:582)
    05/04/01 17:30:43      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260)
    05/04/01 17:30:43      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
    05/04/01 17:30:43      at oracle.jheadstart.controller.strutsadf.JhsActionServlet.process(JhsActionServlet.java:127)
    05/04/01 17:30:43      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:509)
    05/04/01 17:30:43      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    05/04/01 17:30:43      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    05/04/01 17:30:43      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    05/04/01 17:30:43      at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    05/04/01 17:30:43      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:649)
    05/04/01 17:30:43      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
    05/04/01 17:30:43      at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
    05/04/01 17:30:43      at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
    05/04/01 17:30:43      at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
    05/04/01 17:30:43      at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:582)
    05/04/01 17:30:43      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260)
    05/04/01 17:30:43      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
    05/04/01 17:30:43      at oracle.jheadstart.controller.strutsadf.JhsActionServlet.process(JhsActionServlet.java:127)
    05/04/01 17:30:43      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:509)
    05/04/01 17:30:43      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    05/04/01 17:30:43      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    05/04/01 17:30:43      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    05/04/01 17:30:43      at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    05/04/01 17:30:43      at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
    05/04/01 17:30:43      at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
    05/04/01 17:30:43      at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
    05/04/01 17:30:43      at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
    05/04/01 17:30:43      at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
    05/04/01 17:30:44      at oracle.jheadstart.controller.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:172)
    05/04/01 17:30:44      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:645)
    05/04/01 17:30:44      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
    17:30:44 DEBUG (JhsDataAction) -ViewObject programView1: bind parameter values have not changed
    05/04/01 17:30:44      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    05/04/01 17:30:44      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
    05/04/01 17:30:44      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    05/04/01 17:30:44      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
    05/04/01 17:30:44      at java.lang.Thread.run(Thread.java:534)

    Hi Stevan
    I'm using JSP.
    Ive used request parameters for binding in the where clause {app_cycle=:1 and college_code='MICH'}in application structure i gave ${param.appcycle},${param.collegecode} , which the page is loaded successfully. Dont know how did that error got cleared. Anyway now session is the problem.
    I want to use session and not request parameters.
    How to achieve this. I dont understand the help give in the query bind parameters tab in application structure file. It says ${MyObject.MyParameter}
    in Jsp session is the object. Assuming that i gave ${session.appcyle} where appcycle is the parameter which holds the value. But it didnt work
    Kindly help on this.
    regards
    Jayashri
    regards
    Jayashri

  • Dynamically binding backing bean

    Dynamic binding of backing bean
    Here is a problem that I have been trying to solve. Maybe someone can have a go at it:
    Here is a Search form(Simplified version):
    af:selectOneChoice - to choice a 'class family' e.g., companies, NGO, charity, institution etc
    af:inputText - to enter a name
    af:commandButton – to search
    Here is a User task:
    1.     Choose a 'class family' from the selectOneChoice
    2.     Enter a name in inputText
    3.     Click commandButton to start the search
    Additional information
    1. The number of 'class family' is about 30 and requires different method of search.
    2. I want to use a uniform search user interface and so there is only one page for all.
    3. Each 'class family' has it own managed bean in face-config.xml.
    Scenario:
    Lets say the searchUI.jsp has an initial backing bean called SearchBean.java. The af:selectOneChoice in searchUI.jsp has a valueChangeListener and when the user chooses a 'class family' at step (1), the valueChangeListener in SearchBean.java is triggered.
    Problem:
    The problem is how do I dynamically switch the backing beans, say from SearchBean.java to SearchCompanyBean.java so that when the user next click the search commandButton, it is the searchAction method in the SearchCompanyBean.java and NOT the initial SearchBean.java that handles the action.
    Cheers in advance.

    Hi,
    Assuming you are using ADF BC, have a look at using view criteria. You can define, dynamically apply and remove view criteria on the view object.
    Have a look at the help on oracle.jbo.ViewCriteria and applyViewCriteria from the ViewObject implementation class. Sounds like they might meet your requirements.
    Create a client method on your VO and drag it onto your page as an ADF parameter form and go from there.
    Brenden

  • Polymorphism , Dynamic Binding, Widening and I'm totally confused

    class Fruit
         private String name;
         public String getName()
              return this.name;
    class Apple extends Fruit
         private String typeOfApple;
         public void setTypeOfApple(String type)
              this.typeOfApple=type;
         public String getTypeOfApple()
              return this.typeOfApple;
    class Banana extends Fruit
         private String typeOfBanana;
         public void setTypeOfBanana(String type)
              this.typeOfBanana=type;
         public String getTypeOfBanana()
              return this.typeOfBanana;
    public class ExceptionTesting
         public static void main(String args[])
              Fruit obj=new Apple();
              obj.setTypeOfApple();  // ??? Why can't I do this ???
    }how can I achieve something like underneath by modifying above code ???
    Fruit whateverFruit=new Apple();
    whateverFruit.setTypeOfApple();
    whateverFruit=new Banana();
    whateverFruit.setTypeOfBanana();
    whateverFruit=new Orange();
    whateverFruit.setTypeOfOrange();
    ...

    Harry_lynn_17 wrote:
    I do apologize if it's become sound like stupid or something . I know somehow it's not very suitable to think in that way but I was just thinking of the object reference variable as a pointer becauseA reference is like a "filtered" pointer to an object: it will only show that part of the object that corresponds with the type of the reference. So after "Fruit whatever = new Banana();", the "whatever" reference only shows the "Fruit" part of the "Banana" object. This means you can only call methods that are defined in Fruit, not those defined in Banana.
    Dynamic binding means the JVM will decide at runtime which method implementation to invoke based on the class of the object. So, I thought
    Fruit whateverFruit=new Banana(); and then if i tried to invoke whateverFruit.yellowBanana(); then the compiler will try to find the method out and executed automatically.That's not what it means. It means when you have "Fruit whatever = new Banana()" and you call "whatever.getName()", it will call the getName() method from Banana, if Banana overrides the implementation of Fruit. You can still only use methods that are defined in Fruit through a reference of type Fruit. In this case, it doesn't seem that the behaviour of setTypeOfApple() is different from setTypeOfBanana(), so ejp's recommendation to just create a setType() method in Fruit is correct.
    Polymorphism means a variable of a superclass type to hold a reference to an object whose class is the superclass or any of its subclasses. So, I thought Fruit whateverFruit is somehow capable to hold the reference of its subclasses and can be used to reference of its subclasses. That's basically correct. However, the variable will only expose the superclass part of the subclass object.
    I got confused with all those stuff and kinda lost. There's one more thing. What's the point of doing something like this Fruit apple=new Apple() if I can't reference to an instance of apple object ?? I mean I could just simply write like this Fruit aFruit=new Fruit(). Sorry, if i've become sound like a fool but i'm really confused. Please help me out of this and thanks in advance.The point of having any superclass/subclass combo is that your problem domain demands that you make the distinction: sometimes you need to be able to treat an object as Fruit, sometimes you need to be specific and treat it like an Apple. For example, if you sell fruit and need to calculate the total price of a fruit basket, all you need to know is that each piece of Fruit has a getPrice(), you don't need to know that one piece is an Apple and another piece is a Banana. However, if a customer demands a kilogram of apples, you need to make sure you give him only Apples and not Banana's.List<Fruit> fruitBasket = new ArrayList<Fruit>();
    fruitBasket.add(new Apple("Granny Smith"));
    fruitBasket.add(new Banana("Chiquita"));
    fruitBasket.add(new Apple("Golden Delicious"));
    int priceOfBasket = 0;
    for(Fruit pieceOfFruit:fruitBasket) {
      priceOfBasket += pieceOfFruit.getPrice();
    Set<Apple> appleScale = new HashSet<Apple>();
    appleScale.add(new Apple("Granny Smith"));
    appleScale.add(new Apple("Golden Delicious"));
    appleScale.add(new Banana("Chiquita")); // ERROR

  • Dynamic Binding on BC4J bound UIX forms

    Hi
    I'm attempting to use Dynamic Binding in my ADF UIX forms to determine whether to render certain fields on a form depending on the data in the current row.
    Now, I completely understand how to bind the rendered="" attribute with a bound value determined by a static accessor to a bean, but the problem I am having is how to access the current row from my BC4J appModule.
    The datascope beans only have access to the RenderingContext in the following manner:
    <dataScope xmlns="http://xmlns.oracle.com/uix/ui">
    <provider>
    <data name="generic">
    <method class="com.xxx.eim.tools.SetupFormDataBinder" method="getSetupState"/>
    </data>
    </provider>
    The accessor:
    public class SetupFormDataBinder {
    static public Object getSetupState ( RenderingContext context
    , String namespace
    , String name
    return new SetupFormBean(context);
    which calls my bean.
    But, the RenderingContext class does not seem to offer any accessors to the BC4J Configuration or similar.
    So, how can I get to the data in the background...
    Or, is this a poor way of doing it.... Can anyone offer any suggestions???
    Cheers
    Chris

    You should scope your application module before entering dataScope:
            <bc4j:rootAppModuleScope name="EhiskommAM">
              <contents>
                <dataScope>
                   <provider>
                      <data name="someData">
                        <method class="test.Test" method="getData"/>
                      </data>
                   </provider>
                   <contents>
                   </contents>
                </dataScope>
              </contents>
            </bc4j:rootAppModuleScope>And remember to add app. module to the page definitions:
    <page ....>
      <bc4j:registryDef>
        <bc4j:rootAppModuleDef name="AppModule" definition="test.AppModule" releaseMode="stateful">
        </bc4j:rootAppModuleDef>
      </bc4j:registryDef>
    </page>
    Alexey.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Dynamic binding doubt

    i have a a class (say class1) whi uses another class (say class 2) in class i have a public field which class 2 is accessing now i have changed class 2 such that that field is no more public & compiled , now class 1 is actually accessing a private field but it does not show any error , also i found out from some where that java -verify option will inform you that you have to compile class cos class 2 is already changed .so question is why it does not throw any run time exception why -verify option is not doccumented

    This doesn't have anything to do with dynamic binding.
    This allows you to compile one class without
    recompiling every dependent class. At runtime, when
    the other classes try to access those variables you
    should get an error.And if you're not getting the error (like your post seems to indicate), then you're probably not really using that version (with the now-private field) of the compiled class at run-time, but rather the old one because you goofed your classpath.

  • Dynamic binding for table column

    Hi,
    I am using standard application and in a table (not ALV) i want to chnage the name of a column. Already a OTR is placed in it so am planning to do a dynamic bind for the text in the header. Kindly suggest ways.
    Thanks,
    Koushik

    DATA:
            l_caption          TYPE string,
            l_title            TYPE string.
      data lr_caption type ref to cl_wd_caption.
    *---Get OTR Text for Value Description
      CALL METHOD cl_wd_utilities=>get_otr_text_by_alias
        EXPORTING
          alias      = 'ZPERF_MGMT_DEV/RATING'
      language   =
        RECEIVING
          alias_text = l_title.
    lr_caption ?= view->get_element( 'TBL_VAL_HELP_DESCRIPTION_HEADER' ).
    lr_caption->set_text( value = l_title ).

  • Dynamically Binding to Dynamically Create View

    I tried to copy the code of “Dynamically Binding to Dynamically Create View object” but something is wrong because when I am debbuging it doesn’t work after the sentence vo.executeQuery();
    I suspect that the reason could be how I created the view..
    Your code is running well but not mine.
    It shows this error
    •     JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
    •     null
    I don’t know why because the code is the same.
    How did you create the objet view ?
    Could you help me?

    I'd recommend checking out this article on Debugging ADF Applications:
    http://www.oracle.com/technology/products/jdev/tips/muench/debugger/index.html
    and then reporting here the full stack trace using the tips described in that article.

  • Dynamic binding in Webservices (UDDI)

    Hi,
    I would like to know if it's possible to create a Webservice proxy (stub) with dynamic binding: I mean, if I change details in the UDDI Registry, because binding is resolved at run-time, I don't need to change any code in proxy.
    I'm trying the web service proxy wizard and what creates is a bound proxy. Is there any restriction in the kind of services that are published in the ws registry?
    Thanks. Miquel.

    Hi,
    you could receive the attributes of the node by calling method get_attributes of the node info object.
    Afterwards you have to instantiate a RTTI object (cl_abap_structdescr) with a description of the attributes.
    Then you have to create the structure by using create data.
    Example:
      DATA  lo_struc_type TYPE REF TO cl_abap_structdescr.
      DATA: struc_comp_table TYPE cl_abap_structdescr=>component_table.
      DATA: dref TYPE REF TO data.
      FIELD-SYMBOLS: <struc> TYPE ANY.
      lo_struc_type = cl_abap_structdescr=>create( struc_comp_table ).
      CREATE DATA dref TYPE HANDLE lo_struc_type.
      ASSIGN dref->* TO <struc>.
    In my opinion it is too complicated to realize your requirement in this way...
    Kind regards

  • Dynamic Link Problem beim Batchencoden???

    Habe seit kurzem folgendes Problem: Exportiere ich mehrere Videos über den Media Encoder, habe ich bei fast der Hälfte der Filme "kaputte Videos" entweder nur an den Effekten oder beim kompletten Video. Rechne ich die Filme einzeln raus, ist alles ok. Das stinkt sehr nach Dynamic Link Problem. Ich kennen das z.T. schon in der Zusammenarbeit mit After Effects. Hier rechne ich meine Projekte erst, bevor ich sie in Premiere reinhole. Aber auf das Batchencoden kann ich nicht verzichten, da ich teilweise 30 und mehr Clips in verschiedenen Formaten rausrechnen muss und das wirklich nicht einzeln erledigen will.
    Frage: Hat jemand ne Idee (das Problem existiert erst seit kurzer Zeit), ob da irgendwelche caches vollaufen, kann man dynamic link irgendwie "resetten" oder muß ich das ganze Production Premium Paket CS5.5 neu installieren (wollte ich eigentlci vermeiden!!!!!)?
    Ach ja, System Windows 7 64Bit mit CS5.5
    Gruß
    Stefan

    Operator error. Answered my own question. I haven't used Dynamic Link much. It works fine. I was momentarily confusing the import of a PP project vs. a Dynamic Linked Sequence.  

  • CS4 Dynamic Link Problem

    Is anybody having trouble keeping the source files linked in After Effects after using dynamic link from Premiere?
    Please refer to this link:
    cwrig, "CS4 Dynamic Link Problem" #1, 26 Oct 2008 1:02 pm
    This is very frustrating.
    Thanks for your time!

    Did some more tests and here is what does and doesn't work for me.
    Losing footage -
    Yes I was having the issue (and the topic is in the premiere forum also)
    Here is what seems to solve it.
    It loses the footage if I use the original folder which has spaces in the name. Not sure if that is the culprit but both methods proved consistent in every test I did.
    it worked when I used a new folder called "Test" at the root of my editing drive.
    Crashing-
    Not sure if other have the issue but when I close AE, PPro will just sit there with an hour glass and show as not responding.
    If I close PPro first and then AE and reopen PPro then all seems to work as it is supposed to.
    This was also consistent in every test I did.

Maybe you are looking for

  • Decode help in SQL function

    Hi, I'm writing an HTMLDB application that we will be using to track the number of hours that we put into a project (all projects), and I've got a routine that returns the number of hours that are possible within a given month M-F 8 hours a day. I us

  • Replace Oracle Report Dunning Letter to BI-Publisher Dunning Letter

    HI, Are their any documents who is telling me, how I can use the output of "Dunning Letter Print from Dunning Letter Generate". I have Already tried to create an "RTF" document, and placed it in BI Publisher of Oracle EBS R11.5.10. I have Created Dat

  • [(somewhat) SOLVED] Dnsmasq simply won't work - crashed?

    Hi there, I'm having a problem with dnsmasq (v2.54 [<- how is this possible anyway? I just reinstalled it, pacman calls it "2.53-1", 'dnsmasq --version' calls it '2.54'…]). I'm just trying to use it as a DNS cache, nothing special. It seems to be sta

  • Cs6 user interface too small to use

    I have just bought a new laptop with a high resolution screen - 2560x1440 - and like many others, I'm finding that the user interface for my cs6 software is too small to use. I have just found the following advice for HiDPI devices on Adobe Illustrat

  • Stumped on WRT54G ver 5. and cablemodem

    The 54G has the latest firmware, cable modem is a 60678EU, and is somewhat generic but recommend by my internet provider. Works fine when connected to my PC directly or to any other wireless point devices.  Using IP 01, and 1.1..  Have tried allot of