cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uchenna Igwebuike" <uche...@sbcglobal.net>
Subject RE: Can a Woody selection-list relationship be not set?
Date Wed, 17 Mar 2004 14:43:10 GMT
I use the FlowJXPathSelectionList to populate my selection lists from
bean collections. You can use an extension of that model to insert a
prompt message into the selection lists. The prompt message should be
located in a message bundle that you refer to in the form definition.
You also have to insert an entry in the cocoon.xconf.


Steps 
1.	Compile the two classes attached and drop them into your cocoon
cp
2.	Insert the following entry into your cocoon.xconf - in the
<woody-selection-lists> element

        <selection-list
class="org.apache.cocoon.woody.datatype.FlowJXPathSelectionListWPromptBu
ilder" name="flow-jxpath-wprompt"/>

3.  Refer to the list in your form eg
           <wd:selection-list type="flow-jxpath-wprompt"
list-path="stockMeasure" value-path="id"
                label-path="concat(name,' - ',description)"
msg-key="selection.prompt"/>

4. Insert the msg-key in your default resource bundle for that sitemap
ie.
  <message key="selection.prompt">Please Select</message>



-----Original Message-----
From: Ulf Sahlin [mailto:ulf.sahlin@s2communications.se] 
Sent: Tuesday, March 16, 2004 6:13 PM
To: Cocoon Users
Subject: Can a Woody selection-list relationship be not set?

Hello!

Maybe this is a silly question but I couldn't find an answer in the
mail-list archives nor the Wiki.

I want to be able to have a [0..1] cardinality on the one-side of a
relationship (e.g. the relationship could either be set or not be set).

If I use a selection-list in the Woody model I get a nice <select>-style
output, however the relationship NEEDS to be set this way. Is there some
standard way I could allow the relationship to NOT be set? If I put an
empty
<wd:item/> at the beginning of the selection-list I have the option of
selecting that empty option, somehow meaning the relationship isn't set.
However this does not translate very well when the form is to be saved
to
the object. The error I get is some BindingException - which is well
what I
expected.

I would very much like to solve this somwhere in the model rather than
in
the selection-list item list, since imho it's a near-model issue. Any
ideas?


Cheers,
  Ulf Sahlin


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org

Mime
View raw message