[ 
http://issues.apache.org/jira/browse/COCOON-1609?page=comments#action_12363287 
] 

Stefan Podkowinski commented on COCOON-1609:
--------------------------------------------

If I remember this issue right (its been a few months ago..) its rather a 
design problem with the binding process and not with the actual implementation 
of any binding class. A testcase would not be helpful. 

The problem can be broken down to the following question: should a new path be 
created on the model while  saving a widgets value or not?
Please see doSave() of the CustomJXPathBinding class and be aware that 
getRelativeContext() returns an exception if the path does not already exist 
(as described above).

> 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