Hi,

I have created some sort of tutorial on using ojb and cocoon. It's been posted on wiki, but here is the original url: http://joose.iki.fi/ojb/

OJB creates the unique id for the bean when it's inserting the bean.

like

bean.getId() <- no id yet
dao.insert(bean); <- bean is inserted to ojb repository
bean.getId() <- unique id now

HTH,

Joose

23.11.2004 kello 18:09, Jorge Davila kirjoitti:

Oops! The same answer with more elements:

Reading the samples I can't find one sample demostrating how to generate unique id using ojb... well, in the samples, employee e.g. ... the unique id are asigned using instructions like:


function form2bean(form) {
 // .................

var contact = new Packages.org.apache.cocoon.forms.samples.Contact();

    contact.setId("1");
 // .................

    bean.addContact(contact);

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

cocoon.sendPage("form2bean-success-pipeline", { "form2bean": bean });
}


and here the two questions:

1.- What line a need to autogenerate an unique id
2.- How I can do to show my final html page. When I put a field identity for the id in the html form is placed an forms_onsubmit() and the final result is not showed.


Thank for your response,

Jorge D�vila.

Jorg Heymans wrote:
I think you're suffering from a few other knock-on effects and this is making your result page rendering fail.
But to get onto your question: unique id's can be generated by the OR mapping tool itself. Hibernate can do it, i'm sure ojb can as well.
Regards
Jorg
Jorge Davila wrote:
Hello all!:

I'm trying to agregate a new record in a postgresql database ... but when i put a widget field in my definition file I obtain an:

forms_onsubmit();

in my form (in the html page).

then, my result page is not showed.

How generate the unique id using flow?

Best regards,

Jorge D�vila.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * [EMAIL PROTECTED] * +358 44 561 0270 *


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to