cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers" <robby.pelss...@agp.nl>
Subject RE: Cforms JavaSelectionList default entry
Date Mon, 30 Jul 2007 11:39:40 GMT
Quite easy,
 
Suppose you create a StaticSelectionList 
 
you can iterate over your resultset and call addItem(Object value)
 
Then on your Field (widget) you add the selectionlist  setSelectionList
<http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/formmodel/
Field.html#setSelectionList%28org.apache.cocoon.forms.datatype.Selection
List%29> (SelectionList
<http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/datatype/S
electionList.html>  selectionList) 
 
You can define a default value in your formdefinition or just call 
setValue(defaultvalue) of the Field(widget) after the form is loaded.
 
Hope this answers your question.
 
Cheers,
Robby


________________________________

Van: Markus Kratz [mailto:markuskratz@googlemail.com] 
Verzonden: maandag, juli 2007 13:13
Aan: users@cocoon.apache.org
Onderwerp: Cforms JavaSelectionList default entry


Hi,

I want to create a dynamic JavaSelectionList out of the database. But
how can I define a default checked button without JavaScript, which is
selected when the form is loaded the first time? 

Best regards,
Markus Kratz



Mime
View raw message