Dynamic binding of a DataGridTemplateColumn with a ComboBox inside

Hi all and thank you in advance.
I wish you could help me 'cause I'm quite a newbye in this world (C# and WPF).
I need to bind a ComboBox field inside a DataGrid with some data.
The DataGrid is filled with a collection.
I need that one or more data from one field (or more) of this collection is bound with data from another DataSet (and collection).
I need this binding as DYNAMIC and not STATIC:
if I add a record in the second collection I need this record is avaible in the other collection (DataGrid "collection" before)
Any suggestion?
Edit:
obviously with "if I add" I mean:
if I add one record in the table I need this record in the ComboBox content of the ComboBox field inside the DataGrid filled with the other collection...

Ummm... obviously is not a word I would use there mate.
It's Friday evening and been a tiring week but I'm a bit confused by your explanation.
I'm guessing you're kind of OK with an observablecollection bound to itemssource of your datagrid.
If not bind a.... ditto.
Observablecollection tells you + and - to that collection but not properties.
You have to implement inotifypropertychanged to do that.
Then add some notification from your setters on each property.
kinda like
using GalaSoft.MvvmLight;
namespace wpf1
public class Class1 : ViewModelBase
private int myVar;
public int MyProperty
get
return myVar;
set
myVar = value;
RaisePropertyChanged();
Binding comboboxes in datagrids is tricky.
You have several options.
You mention datasets and collections.
I'm going with collection here.
The thing to realise about the wpf datagrid is datacontext.
The datacontext of the row is an item in the collection the itemscollection is bound to.
If you bind a collection of customer then it's in customer it looks for any binding.
It has to use a bit of weird notation to get to the datacontext of the window.
That's one route to your data.
Another is to have an observable collection as a resource.
http://social.technet.microsoft.com/wiki/contents/articles/26347.wpf-combobox-binding-in-datagrid.aspx
http://social.technet.microsoft.com/wiki/contents/articles/26200.wpf-dynamicresource-observablecollection.aspx
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML

Similar Messages

  • 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

  • Dynamic table with dynamic binding

    Hello,
    I'm really not sure if I can realize that kind of feature using a table :
    I've created a dynamic table that have a dynimac number of columns except two.
    I've setted the value of the table to a certain list to fill out the two static field I need now to fill the data for each row for the dynamic columns but that kind of datas are inside another list
    Is it possible to manually create Row for Table and set the columns values ?

    Hi,
    I could not use both solution because I've two list (two data model) from different source, when the jsf page is generated it generated the correct number of column and output text but when I try to retrieve the component output text for example the 1 row and the second output text I got a null pointer exception because the column only have 1 child and not the full elements that we can see at html rendering.
    There is no solution for getting the full list of components before the page is generated ? because findComponent recursivly called doesn't found what I want.

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

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

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

  • Can't dynamically bind Request var to ViewObjectLink SQL (for BIBean Graph)

    Can anybody pleaaaase help? I'm trying to get a graph done with JSP and a BI Bean. I have got the graph working just fine, based on an unfiltered query of the ViewObjectLink. However, have not been able to figure out how to dynamically add and alter the criteria of the underlying ViewObjectLink query.
    My research has found numerous references to the setWhereClause() and setWhereClauseParam() functions. I've placed setWhereClause() and setWhereClauseParam() calls in the constructor of the ViewObjectLink. But I always get exceptions :
    JBO-30003: The application pool (test_16.AppModuleLocal) failed to checkout an application module due to the following exception:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=
    JBO-29000: Unexpected exception caught:
    oracle.jbo.InvalidObjAccessException, msg=
    JBO-25036: An invalid object operation was invoked on type View Object with name FaVGetDueDatePcCtab2ViewImpl_120
    Any and all help appreciated.
    Thanks in advance,
    John.

    Thanks Keith.
    It's a question of how one sets and accesses the query datasource of the ViewObject which underlies and populates a BIBeans graph.
    I don't see how one binds criteria value(s) to the parameter placeholder(s) in the ViewObject object.
    For example, the Query property of my ViewObject is:
    SELECT FaVGetDueDatePcCtab2.PC0,
    FaVGetDueDatePcCtab2.PC1,
    FaVGetDueDatePcCtab2.PC2
    FROM FA$V$GET$DUE$DATE$PC$CTAB2 FaVGetDueDatePcCtab2
    The Where Clause propery is:
    WHERE FaVGetDueDatePcCtab2.PC2 IN (?, ?, ?)
    What wizard or method or means is used to bind the '?' placeholders with actual values?
    Or do you think this is more a question for the Forms/Reports forum?

  • Howto dynamicly bind XML element to a TextInput using BindingUtils?

    The question is: Howto dynamicly bind XML element to a
    TextInput component using BindingUtils?
    Now I use following codes:
    <!--
    [Bindable] private var xml: XML =
    <item><label>list1</label></item>;
    // initialize code for application's initialize event
    private function init(): void {
    BindingUtils.bindProperty(txtDemo, "text", xml, "label");
    //click event
    private function test(): void {
    xml.label = "something";
    // txtDemo.executeBindings(); //---- no use anymore
    -->
    <mx:TextInput id="txtDemo"/>
    <mx:Button label="Test" click="test()"/>
    My really idea is when bindable xml property is changed, then
    the textinput will be updated as hoped. However, no update happens
    to me when I click the Test button.
    But, if I make codes like that:
    <mx: TextInput id="txtDemo" text="{xml.label}"/>
    the text will updated when xml changs.
    So, what happened, I indeed need the dynamicly bind to the
    textinput compont.
    Help me. thanks.

    You could use an ObjectProxy since all subproperties will
    then be bindable:
    private var _xml:XML =
    <item><label>list1</label></item>;
    private var _opXML:ObjectProxy = new ObjectProxy(_xml);
    then in your init() function you declare _opXML as the host
    object with the bindable property "label"...
    // initialize code for application's initialize event
    public function init(): void {
    BindingUtils.bindProperty(txtDemo, "text", _opXML, "label");
    //click event
    private function test(): void {
    _opXML.label = "something";
    You'll notice that if you check your original _xml.label
    property with ChangeWatcher.canWatch(), it returns false. But if
    you create a dedicated object with a property that can be declared
    as bindable, canWatch() returns true. You'd probably be best off to
    write a lightweight class that can act as your model if you want to
    work with dynamic XML binding using Actionscript. This will allow
    you to use a bindable getter and setter that will give you the
    dynamic functionality you're looking for.
    Hope that helps.

  • What is Dynamic Binding ??

    Can anyone help me in telling what is DYNAMIC BINDING with an exmple!!!!
    Thanks
    Pinto

    dynamic binding means binding at run time.it is used in java for achieving runtime polymorphism.
    e.g
    class A
    int i=15;
    void abc()
    System.out.println("in A");
    class B extends A
    int i=20;
    void abc()
    System.out.println("in B");
    class C
    public static void main(String o[])
    A a=new B();
    System.out.println(a.i);
    System.out.println(a.abc);
    this program outputs as
    15
    in B
    this is because the instance methods are bind dynamically at runtime depending upon the object
    not the reference.instance variables and static methods are bind early at compile time so these depends upon the reference not the object.

  • Dynamic Binding and Interactions

    Hi,
    When we invoke a BPEL say "MyBPEL2" from another BPEL say "MYBPEL1" we can see the instance id of "MyBPEL2" in "Interactions" tab of "MyBPEL1" from the BPEL console GUI, seems there is some kind of parent-child relationship maintained in dehydration database. But i dont see the same relation if MyBPEL2 is dynamically binded and invoked?
    any ideas please?
    thanks,
    -Ng.

    Are you saying the classes have package access, or their methods (e.g. toString)?
    If the latter (methods) it won't compile.
    If the former (classes) then polymorphism works as usual--whatever you have an instance of at runtime, that's whose method is called.
    You can't refer to one of those package-protected classes by name, but if you get your hands on one (say from a public factory) with a reference of some public superclass or interface, then you can call any public methods specified by that public superclass/interface, and the appropriate method wil get called on the concrete object.
    If you look at the source code for the Collections classes, you'll find that the Iterator implementations are either package scoped or private, I think.

  • How dynamic binding implemented?

    for exmaple
    abstract class SuperClass{
          abstract void do() {}
          class SubClass1 extends SuperClass{
          void do(){//do method implemented}
          class SubClass2 extends SuperClass{
          void do(){//do method another implemented}
          SuperClass[] array = new SuperClass[2];
               array[0] = new SubClass1();
               array[1] = new SubClass2();
               array[0].do();
               array[1].do();
    I want to know how the compiler deal with "array" during compiling time,
    and how the dynamic "do()" method was found during runing time?

    You can get some hints by studying the bytecodeof
    your example.
    Generally dynamic binding is implemented using
    indirect calls via "jump tables". Binding means
    filling in the jump tables with the startaddresses
    of
    the methods as soon as they're available.~~~~~~~~~ this mean when instantiated?
    Actually I took it to mean when the class is loaded.
    Actually as soon as they are needed which isslightly
    different. ~~~~~~~ this mean when the method invoked?Basically yes.

Maybe you are looking for

  • People Picker Restriction

    Hello, Please help me. This is urgent for me. Can you please answer 2 questions below accurately? If you have reference links, please also provide it. Can you force SP2013 to allow only a given group (SharePoint or AD) to access/launch PeoplePicker?

  • Button Action Procedure

    I'm missing something basic. I have a button. It's action event handler (button_action() ) sets a SessionBean1.property to a value. But it seems that the handler is called each time I update a textfield on the page. I thought the event handler is onl

  • Promise 20376 SATA Raid Controller Drivers?

       Hi I'm trying to install WinXP with an K7N2GM2 - ILSR board and I'm having problems with the SATA drivers I've downloaded (from http://www.msi.com.tw/program/support/driver/dvr/spt_dvr_list.php?part=1&kind=4&CHIP=4&COM=19). The 'make disk' instruc

  • Case creation with "Parties Involved" using WST

    Dear All, We are creating a case in CRM system 7.0 using the webservice created by WST tool. The case number is generated successfully, however, u2018Parties Involvedu2019 is not created in the case. Error obtained: TypeID = 300(CRMOST), SeverityCode

  • Photos not on my computer are still on iPod and new ones aren't syncing.

    I deleted some photos from my computer and now new photos aren't syncing to my ipod and the ones that I deleted from my computer are still on my iPod- even if I change what folder the photos sync from to a completely different folder.