cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Gianni <s.gia...@thebug.it>
Subject Re: Field not binding.
Date Tue, 04 Apr 2006 14:40:28 GMT
Hi Kamal,
I can't see anything wrong with your binding, except 
"<fb:identity><fbvalue id="position" path="position"/></fb:identity>" 
where fdvalue should be fb:value, but this would prevent your repeater 
from binding correctly also all other fields in the repeater, so I think 
this is a typo in your mail rather than in your form.

Try to set it required=true, this will cut your problem : if the form 
returns a validation error, then the form is not receiving the value, so 
maybe the problem is in the HTML/XSL or somewhere else after the form 
itself, while if it does not return a validation error, then the forms 
receives the value, so the problem is in the binding/bean.

Another suggestion could be to run cocoon in debug mode, connect to it 
with your IDE, and place a breakpoint both in Information.getChannelInfo 
and Information.setChannelInfo to see if they are called and if the 
proper values are passed. This will again cut your problem, if setter is 
called correctly then the problem is not in binding, if it's not called 
then it is in binding.

Let me know.

Simone


Kamal Bhatt wrote:

>
> Hi
> I have a form binding to a java bean. I needed to add an integer value 
> to this bean and the associated template/form/bindings. The field is 
> part of a repeater and it displays on the form (It uses a selection 
> list) but when I save the form to the bean, it does not save the 
> field. All other fields on the form save correctly. The field (on the 
> form) is called channel_info, on the bean it is channelInfo.
>
> The binding structure looks something like this:
>
> <fb:context ...>
>  <fb:repeater id="information" parent-path="." row-path="information">
>    <fb:identity><fbvalue id="position" path="position"/></fb:identity>
>      <fb:on-bind>
>       ...
>       <fb:value id="channel_info" path="channelInfo"/>
>       ...
>   </fb:on-bind>
>   ....
>   <fb:on-insert-row>
>       <fb:insert-bean classname="creative.beans.Information" 
> addmethod="addInformation"/>
>   </fb:on-insert-row>
> <fb:repeater>
> ..
> </fb:context>
>
> The form definition looks like this:
>
> <fd:repeater id="information">
>  ...
>  <fd:widgets>
>    ...
>    <fd:field id="channel_info" required="false">
>       <fd:label>Channel</fd:label>
>       <fd:datatype base="integer"/>
>       <fd:selection-list src="cocoon:/channel_list"/>
>    </fd:field>
>    ...
>  </fd:widgets>
>   ...
> </fd:repeater>
>
> In the Information bean I have an attribute called mChannelInfo of 
> type Integer (I have also tried using int) and get/set routines. I am 
> using cocoon 2.1.7 . The channel_list pipeline is being used 
> elsewhere, so is probably correct (and it still doesn't work without 
> it)..
>
> Any ideas why this will not bind?
>
> Cheers.
>
-- 
Simone Gianni

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message