You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Kamal Bhatt <kb...@tt.com.au> on 2006/09/21 08:56:28 UTC

Cforms do not save after binding.

Hi
I have a CForm that binds to a java object. If there are no validation 
errors (ie the continuation is not called) then the form saves 
correctly. However, if there was a validation error, you fix the error 
and you try and save again, the form does not bind correctly (form.save 
fails). Instead, it returns null.

What is the likely cause of this?

Due to the sheer amount of source code associated with this stuff, I 
will provide source on request. No point in adding a truck load of code 
for no reason.

Cheers.

-- 
Kamal Bhatt


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


Re: Cforms do not save after binding.

Posted by Kamal Bhatt <kb...@tt.com.au>.
Jason Johnston wrote:
> Kamal Bhatt wrote:
>> Kamal Bhatt wrote:
>>> Hi
>>> I have a CForm that binds to a java object. If there are no 
>>> validation errors (ie the continuation is not called) then the form 
>>> saves correctly. However, if there was a validation error, you fix 
>>> the error and you try and save again, the form does not bind 
>>> correctly (form.save fails). Instead, it returns null.
>
> When you say "it returns null", what exactly is null?  The new values 
> in the object you're saving to?  The return value of the Form.save() 
> method call?
The values in the fields of the object being bound. Eg., I have a get 
function called "getBrandField". When I run this before the save, it 
returns a value, after the value, it returns nulll.
>
>>>
>>> What is the likely cause of this?
>>>
>>> Due to the sheer amount of source code associated with this stuff, I 
>>> will provide source on request. No point in adding a truck load of 
>>> code for no reason.
>>>
>>> Cheers.
>>>
>> OK, worked out what was failing, now, I need to understand why.
>>
>> On my form.showForm, I would pass in some work data. When I removed 
>> this data, it stopped being a problem. It was being spit out on the 
>> form as a hidden input, but it wasn't really being used. I thought 
>> you could pass variables into showForm. If that is the case, what is 
>> wrong with what I did?
>
> Yes you can pass view data as the second argument to Form.showForm; 
> this is a very common use case so I'm surprised you're seeing issues.
So am I.


-- 
Kamal Bhatt


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


Re: Cforms do not save after binding.

Posted by Jason Johnston <co...@lojjic.net>.
Kamal Bhatt wrote:
> Kamal Bhatt wrote:
>> Hi
>> I have a CForm that binds to a java object. If there are no validation 
>> errors (ie the continuation is not called) then the form saves 
>> correctly. However, if there was a validation error, you fix the error 
>> and you try and save again, the form does not bind correctly 
>> (form.save fails). Instead, it returns null.

When you say "it returns null", what exactly is null?  The new values in 
the object you're saving to?  The return value of the Form.save() method 
call?

>>
>> What is the likely cause of this?
>>
>> Due to the sheer amount of source code associated with this stuff, I 
>> will provide source on request. No point in adding a truck load of 
>> code for no reason.
>>
>> Cheers.
>>
> OK, worked out what was failing, now, I need to understand why.
> 
> On my form.showForm, I would pass in some work data. When I removed this 
> data, it stopped being a problem. It was being spit out on the form as a 
> hidden input, but it wasn't really being used. I thought you could pass 
> variables into showForm. If that is the case, what is wrong with what I 
> did?

Yes you can pass view data as the second argument to Form.showForm; this 
is a very common use case so I'm surprised you're seeing issues.

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


Re: Cforms do not save after binding.

Posted by Kamal Bhatt <kb...@tt.com.au>.
Kamal Bhatt wrote:
> Hi
> I have a CForm that binds to a java object. If there are no validation 
> errors (ie the continuation is not called) then the form saves 
> correctly. However, if there was a validation error, you fix the error 
> and you try and save again, the form does not bind correctly 
> (form.save fails). Instead, it returns null.
>
> What is the likely cause of this?
>
> Due to the sheer amount of source code associated with this stuff, I 
> will provide source on request. No point in adding a truck load of 
> code for no reason.
>
> Cheers.
>
OK, worked out what was failing, now, I need to understand why.

On my form.showForm, I would pass in some work data. When I removed this 
data, it stopped being a problem. It was being spit out on the form as a 
hidden input, but it wasn't really being used. I thought you could pass 
variables into showForm. If that is the case, what is wrong with what I did?


-- 
Kamal Bhatt


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