[ http://issues.apache.org/jira/browse/COCOON-1609?page=all ]
Jean-Baptiste Quenot updated COCOON-1609: ----------------------------------------- Please provide a testcase demonstrating the problem. Also you may review this change: When saving a cform, remove xml elements if the value of the widget is null https://issues.apache.org/jira/browse/COCOON-1687 And if you could send a patch, this would allow to address the issue in a more timely manner. Thanks in advance. > form binding ambiguity creating new paths > ------------------------------------------ > > Key: COCOON-1609 > URL: http://issues.apache.org/jira/browse/COCOON-1609 > Project: Cocoon > Type: Bug > Components: Blocks: Forms > Versions: 2.2-dev (Current SVN) > Environment: Operating System: other > Platform: Other > Reporter: Stefan Podkowinski > Assignee: Cocoon Developers Team > > The current way cform binding is handled is a bit confusing regarding the > creation of new (jx)path elements. > While fb:value works (to me) as expected, other bindings behave quite > different. > E.g. the following binding would create the given path if non-existing. > <fb:value id="form.test" path="/test/hello" /> > Others, such as fb:set-attribute or fb:custom would not and throw an exception > given the path above. This must be due the fact that the doSave() method of > each > binding class is implemented differently. The ValueJXPathBinding class calls > createPathAndSetValue() while others expect that the given path does already > exist calling getRelativeContext() directly. This behaviour is especially > annoying for fb:custom bindings in my case. > See also: > http://issues.apache.org/bugzilla/show_bug.cgi?id=30693 > http://www.mail-archive.com/dev@cocoon.apache.org/msg20645.html > fb:custom exception: > org.apache.commons.jxpath.JXPathException: Cannot create a relative context > for > a non-existent node: /form/test > at > org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getRelativeContext(JXPathContextReferenceImpl.java:581) > at > org.apache.cocoon.forms.binding.CustomJXPathBinding.doSave(CustomJXPathBinding.java:83) > at > org.apache.cocoon.forms.binding.JXPathBindingBase.saveFormToModel(JXPathBindingBase.java:192) -- 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