[ http://issues.apache.org/jira/browse/COCOON-1629?page=comments#action_12363107 ]
Jean-Baptiste Quenot commented on COCOON-1629: ---------------------------------------------- To be retested with the following change: Fix COCOON-1687: When saving a cform, remove xml elements if the value of the widget is null http://svn.apache.org/viewcvs.cgi?rev=369507&view=rev > No default value in forms binding > --------------------------------- > > Key: COCOON-1629 > URL: http://issues.apache.org/jira/browse/COCOON-1629 > Project: Cocoon > Type: Improvement > Components: Blocks: Forms > Versions: 2.1.8 > Environment: Operating System: other > Platform: Other > Reporter: Jean-Baptiste Quenot > Assignee: Jean-Baptiste Quenot > Priority: Minor > > When wishing to have a default value for the binding of a form widget, it is > required to make use of a hack like this: > for (var iter = form.form.getChildren() ; > iter.hasNext() ;) { > var child = iter.next(); > if > (child.getClass().getName().equals("org.apache.cocoon.forms.formmodel.Field") > && > child.getDatatype().getTypeClass().getName().equals("java.lang.Long") && > child.getValue() == null) { > child.setValue(new java.lang.Long(-1)); > } > } > It would be great to add an attribute on <fd:datatype>, for example: > <fd:datatype base="long" default="-1"> to have a default value that could be > used in the binding. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira