Hello Ugo !
Thanks, Option B) is just what I was looking for !
However - is it possible to use this declaration in the form XML ? :
<fd:field id="type">
<fd:label>Type</fd:label>
<fd:datatype base="long"/>
<fd:selection-list type="flow-jxpath" list-path="restTypeList" value-path="id" label-path="name"/>
</fd:field>
And in the flowscript - just collect the "restTypeList" list, built from my hibernate POJO's
and pass it own ? If so - don't you think it is better to define the field data in its declaration,
rather in the flow script ?
Thanks again
Elad
-----Ursprüngliche Nachricht-----
Von: Ugo Cei [mailto:ugo@apache.org]
Gesendet: Montag, 23. Mai 2005 14:01
An: users@cocoon.apache.org
Betreff: Re: Selection list populated from Hibernate POJO
Il giorno 23/mag/05, alle 13:39, Messing, Elad ha scritto:
> I have a Hibernate POJO class - for a restaurant type. It is
> actually a mapping of a look-up table from my DB. An ID, and Name
> members. That's it.
Two possibilities come to mind:
A) use the src attribute and make it point to a pipeline that would query the Hibernate datastore
and output some XML. You don't have to have Hibernate output XML, as you wrote: you can have
a flowscript function do the query and produce XML via a template page (JXTG or Velocity).
Or even an XSP page.
B) possibly simpler:
var form = new Form("formdef.xml");
var list = hibernateSession.find("from ..."); form.lookupWidget("widget-id").setSelectionList(list,
"id", "name"); form.showForm("form-template");
HTH,
Ugo
--
Ugo Cei
Tech Blog: http://agylen.com/
Source.zone: http://sourcezone.info/
Wine & Food Blog: http://www.divinocibo.it/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
|