cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <>
Subject question on UnionBinding
Date Thu, 01 Jul 2004 11:46:55 GMT
Starting with the question: Does it make sense to process all sub bindings of a

At the moment the UnionBinding behaves just like a ContextBinding, all sub
bindings are processed. While the processing of a UnionWidget depends on the
caseWidget the same is not true for the binding.

My use case: I have different cases that need the same widget to be displayed
and later on saved back to bean. But the value is not saved to the bean only for
the current case but for all cases and so my case5 always wins, though another
case might have been selected.

My binding:

    <fb:class id="voucher-class">
      <fb:value id="voucher" path="voucherAvailable" direction="save"/>
    <fb:union id="eventData" path=".">
      <fb:struct id="some other cases that don't need the voucher widget">
      <fb:struct id="case1" path=".">
        <fb:new id="voucher-class"/>
      <fb:struct id="case2" path=".">
        <fb:new id="voucher-class"/>
      <fb:struct id="case3" path=".">
        <fb:new id="voucher-class"/>
      <fb:struct id="case4" path=".">
        <fb:new id="voucher-class"/>
      <fb:struct id="case5" path=".">
        <fb:new id="voucher-class"/>

The usage of voucherAvailable on the bean is exclusive, so I don't want to have
5 fields were one would be sufficient.

Was the UnionBinding implemented that way because nobody thought about my use
case or was there a use case for the current behaviour?


View raw message