5 Replies Latest reply: Oct 16, 2013 1:10 PM by Shay Shmeltzer-Oracle RSS

    Getting Extra classes while creating Data Control in ADF

    RajeshBiswas

      I am using Jdeveloper 11.1.1.6.0.

      I was trying to create a Data Control from a Java class (containing event handling code) right click on the java class -> Create data Control.

       

      I can see many data controls were created in my work space when the operation was completed

      Example: java.io.InputStream.xml, java.net.URI.xml and many more.

       

      Anybody please suggest is it a problem in Jdeveloper tool or I need to perform any additional step to remove all these files.

       

      Regards,

      Rajesh

        • 1. Re: Getting Extra classes while creating Data Control in ADF
          Timo Hahn

          Please clarify, do you see classes generated or data controls?

           

          classes are normal, data controls are not. However without knowing your Java class it's hard to tell.

           

          Timo

          • 2. Re: Getting Extra classes while creating Data Control in ADF
            RajeshBiswas

            Hello TimoHahn,

             

            I can see only the Data controls are getting generated (not the class files).

             

            Please find the code snippet for my class for which I generated data controls:

             

            public class ContexEvent {

                public ContexEvent() {

                    super();

                }

               

                public void handleEvent(ActionEvent payload){

                    UIComponent component = payload.getComponent();

                    Map<String, Object> attrMap = component.getAttributes();

                    FacesContext context = FacesContext.getCurrentInstance();

                    ELContext elContext = context.getELContext();

                    Application application = context.getApplication();

                    ExpressionFactory factory = application.getExpressionFactory();

                    ValueExpression valueExpr = factory.createValueExpression(elContext, "#{backingBeanScope.NameBean}", Object.class);

                    NameBean nb=(NameBean)valueExpr.getValue(elContext);

                    //String newVal = (String)payload.getNewValue();

                    nb.setFirstName("Rajesh");

                   

                    AdfFacesContext adfContext= AdfFacesContext.getCurrentInstance();

                    adfContext.addPartialTarget(nb.getNameLabel());

                   

                }

            }

            • 3. Re: Getting Extra classes while creating Data Control in ADF
              Shay Shmeltzer-Oracle

              It seems you are doing something wrong architecturally  - why are you trying to expose a Java class that deals with JSF components as a data control?

              This should be a managed bean. Data controls are for business services that are independent of UI layer.

              • 4. Re: Getting Extra classes while creating Data Control in ADF
                RajeshBiswas

                Hello

                DCBindingContainerValueChangeEvent type no extra Data Sources are created.

                 

                Thank you very much.

                 

                Rajesh

                • 5. Re: Getting Extra classes while creating Data Control in ADF
                  Shay Shmeltzer-Oracle

                  Again - it doesn't make sense to expose a bean that deal with contextual events as a data control - it is a view layer only bean and shouldn't be accessed through the binding layer!

                   

                  The additional datacntrols that are generated are in order to provide types for non-trivial attribute types.