Hi Jeremy:

I use other approach in Flow. Example:

function listform(form) {
  var factory = cocoon.getComponent(Packages.o.a.c....JdoPMF.ROLE);
  var bean = new Packages.test.forms.AreasList();
  var handler = new Packages.test.forms.AreaHandler();
  var criteria = new String (cocoon.request.criteria);

  handler.getList(bean, criteria, factory);  // Read from DB

  form.load(bean);
  form.showForm("list-form-display");
  form.save(bean);

  handler.setList(bean, criteria, factory); // Store in DB
  cocoon.releaseComponent(factory);
  // Show a succes page (end page).
  success("Administraci�n de Areas",
          "Actualizaci�n de �reas",
          "Todos los cambios se procesaron existosamente." +
          "�Desea volver a procesar la lista de �reas?",
          "search");
}

Instead of open a OJB session inside the flow I call an FormHandler (in
Java) with the factory as a parameter. Inside the handle I open the OJB
transaction and close it after it fill the bean with a query.

I don't know if this is the better approach, but it works :-D

We are looking for a more generic solution to almost all the cases.

I hope it would give you more ideas. I will be glad if you share it with
us. :-D

Best Regards,

Antonio Gallardo


Reply via email to