You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Michal Stochmialek <mi...@e-informatyka.pl> on 2004/09/22 23:03:28 UTC

grouping fb:values in fb:context tag

hello,

Two binding codes:

[1]
  <fb:value id="manager-firstname" path="manager/firstname"/>
  <fb:value id="manager-name" path="manager/name"/>
  <fb:value id="manager-title" path="manager/title/nameEn"/>

[2]
  <fb:context path="manager">
    <fb:value id="manager-firstname" path="firstname"/>
    <fb:value id="manager-name" path="name"/>
    <fb:value id="manager-title" path="title/nameEn"/>
  </fb:context>


At first sight two above codes are semanticly the same,
but they're at fact different! The problem appeared when
I was reloading form, when model externaly was changed.

0) manager and its propeties are set to not-null values
1) (first load) all three (manager-*) widgets are set to some strings
2) model is externaly changed, manager reference is set to null
3) (second load) (here above codes behave different)
  code [1]:  all value of manager-* are set to null
  code [2]:  any value of manager-* widget isn't changed


This looks like a bug... or am I missing something?

best regards,
-- 
Michal Stochmialek <mi...@e-informatyka.pl>

Re: grouping fb:values in fb:context tag

Posted by Michal Stochmialek <mi...@e-informatyka.pl>.
On Thu, Sep 23, 2004 at 08:30:33AM +0200, Sylvain Wallez wrote:

> Okay, this has to be fixed: 
> http://issues.apache.org/bugzilla/show_bug.cgi?id=31380

thank you,
-- 
Michal Stochmialek <mi...@e-informatyka.pl>

Re: grouping fb:values in fb:context tag

Posted by Sylvain Wallez <sy...@apache.org>.
Michal Stochmialek wrote:

>On Wed, Sep 22, 2004 at 11:38:21PM +0200, Sylvain Wallez wrote:
> 
>  
>
>>I don't know if that can really be considered as a bug, as a form is 
>>normally intended to be loaded only once. Why do you reload it? Can't 
>>you use a new fresh form instance?
>>    
>>
>
>I'm having load-only repeaters with output widgets (with i.e. collection
>element name) and submit buttons, which invoke collection-element-edit-form.
>In this form, user can edit rest of collection element data (name too).
>
>When user changes name of some collection element, then a name in repeater
>should also change. And this is done by the second form load.
>  
>

 I see.

>I can't use new form instance. Besides repeaters it from consists of
>number of other fields...
>
>Ah, forgot... manager-* fields was only an example.
>  
>

Yeah sure :-)

Okay, this has to be fixed: 
http://issues.apache.org/bugzilla/show_bug.cgi?id=31380

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Re: grouping fb:values in fb:context tag

Posted by Michal Stochmialek <mi...@e-informatyka.pl>.
On Wed, Sep 22, 2004 at 11:38:21PM +0200, Sylvain Wallez wrote:
 
> I don't know if that can really be considered as a bug, as a form is 
> normally intended to be loaded only once. Why do you reload it? Can't 
> you use a new fresh form instance?

I'm having load-only repeaters with output widgets (with i.e. collection
element name) and submit buttons, which invoke collection-element-edit-form.
In this form, user can edit rest of collection element data (name too).

When user changes name of some collection element, then a name in repeater
should also change. And this is done by the second form load.

I can't use new form instance. Besides repeaters it from consists of
number of other fields...

Ah, forgot... manager-* fields was only an example.

regards,
-- 
Michal Stochmialek <mi...@e-informatyka.pl>

Re: grouping fb:values in fb:context tag

Posted by Sylvain Wallez <sy...@apache.org>.
Michal Stochmialek wrote:

>hello,
>
>Two binding codes:
>
>[1]
>  <fb:value id="manager-firstname" path="manager/firstname"/>
>  <fb:value id="manager-name" path="manager/name"/>
>  <fb:value id="manager-title" path="manager/title/nameEn"/>
>
>[2]
>  <fb:context path="manager">
>    <fb:value id="manager-firstname" path="firstname"/>
>    <fb:value id="manager-name" path="name"/>
>    <fb:value id="manager-title" path="title/nameEn"/>
>  </fb:context>
>
>
>At first sight two above codes are semanticly the same,
>but they're at fact different! The problem appeared when
>I was reloading form, when model externaly was changed.
>
>0) manager and its propeties are set to not-null values
>1) (first load) all three (manager-*) widgets are set to some strings
>2) model is externaly changed, manager reference is set to null
>3) (second load) (here above codes behave different)
>  code [1]:  all value of manager-* are set to null
>  code [2]:  any value of manager-* widget isn't changed
>
>
>This looks like a bug... or am I missing something?
>  
>

Mmmh... What happens here is that in [1], the path corresponding to each 
of the widgets doesn't exist and therefore their values are set to null, 
whereas in [2] the children of <fb:context> are not executed because the 
context path does not exist.

I don't know if that can really be considered as a bug, as a form is 
normally intended to be loaded only once. Why do you reload it? Can't 
you use a new fresh form instance?

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }