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

Max Pfingsthorn commented on COCOON-1794:
-----------------------------------------

Hmm.. not so sure. What I did now was to implement an 
InsertAfterNodeJXPathBinding which is used instead of InsertNodeJXPathBinding 
in <fb:on-insert-row>. The next thing is a bit hacky: The RepeaterJXPathBinding 
knows about the InsertAfterNodeJXPathBinding and uses the path of the 
previously inserted or last accessed row so that the new node is created right 
after that one.

It does work, but it's not as clean as I'd like. The tricky thing is, you need 
to supply another context to the binding for relative positioning. This sort of 
positioning functionality is just not implemented and it is really hard and 
awkward to force it into the doSave(Widget, Context) method.

Why do you need an absolute positioning though? They only thing you do now in 
your MoveNodeJXPathBinding is move all rows up to the top of their enclosing 
element. They will still be in order they were in the form. Before, they were 
as well, just as many rows as were newly created were on the bottom of the 
enclosing element. This does not hurt at all if you have an enclosing element 
only for the rows. Your addition would not reorder them, as far as I can see.

Can you show your usecase to make this clearer?

> [PATCH] Propagation of namespaces to a repeaters child bindings and 
> implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child 
> widgets.
> - Nodes bound to row widgets not being reordered according to row position on 
> save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative 
> contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
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

Reply via email to