We Recommend

Java How to Program Java How to Program
Takes a new tools-based approach to Web application development that uses Netbeans 5.5 and Java Studio Creator 2 to create and consume Web Services. Features new AJAX-enabled, Web applications built with JavaServer Faces (JSF), Java Studio Creator 2 and the Java Blueprints AJAX Components. Includes new topics throughout, such as JDBC 4, SwingWorker for multithreaded GUIs, GroupLayout, Java Desktop Integration Components (JDIC), and much more.


Posted By

Dio83 on 01/30/08


Tagged

jdeveloper


Versions (?)


[FUNCIÓN] ALTA


Published in: Java 


Función modelo para dar alta.

  1. /**
  2. * NOTAS:
  3. *
  4. * STRING -> ES UN BINDING.
  5. * CORE -> es un FROM - TO.
  6. * TODOS STATIC para que al actualizar la pantalla se mantengan
  7. * los valores de los atributos del bean.
  8. * */
  9. public static String codigo;
  10. public static String descripcion;
  11.  
  12. private static CoreInputText direccion;
  13.  
  14.  
  15.  
  16.  
  17. public String alta(){
  18. ApplicationModule inspDenAMDataControl =
  19. ADFUtils.getApplicationModuleForDataControl("APPLICATION_MODULE");
  20.  
  21. DCBindingContainer bindcont = ADFUtils.getDCBindingContainer();
  22. DCIteratorBinding iterador= bindcont.findIteratorBinding("ITERADOR");
  23. ViewObject vistaAux = iterador.getViewObject();
  24.  
  25. //creamos una nueva row...
  26. Row row = vistaAux.createRow();
  27.  
  28. //llenamos cada row..
  29. row.setAttribute("Codigo", codigo);
  30. row.setAttribute("Descripcion", descripcion);.
  31. row.setAttribute("Direccion", direccion.getValue().toString());
  32.  
  33.  
  34. /** insertamos la row**/
  35. vistaAux.insertRow(row);
  36.  
  37.  
  38. /**Commit*/
  39. inspDenAMDataControl.getTransaction().commit();
  40.  
  41. return null;
  42. }

Report this snippet 

You need to login to post a comment.