Re: [html-formfu] 'default_empty_value' doesn't work

2008-10-31 Thread Michele Beltrame
Hi Juergen! > Maybe a hint could be added to pod to clarify the behavior of > default_empty_value ... I spoke to other developers and they also > misunderstood it :) I just patched H::F::Element::_Field.pm POD in trunk to better clear this situation. I also adding something regarding it on the

Re: [html-formfu] get_element problem

2008-10-31 Thread Carl Franks
2008/10/31 Dermot <[EMAIL PROTECTED]>: > 2008/10/31 Carl Franks <[EMAIL PROTECTED]>: >> You're using auto_fieldset - so get_elements() will only return the >> top-level fieldset - nothing else. > > That twice you've mention auto_fields in replies to me. That's because you're using it in the YAML

Re: [html-formfu] get_element problem

2008-10-31 Thread Dermot
2008/10/31 Carl Franks <[EMAIL PROTECTED]>: > 2008/10/31 Dermot <[EMAIL PROTECTED]>: >> Hi, >> Is there something wrong with the snippet/yml file below? > > several things :) > >> ... >> else { >>my @types = keys %fileTypes; >>$c->log->debug("Types ",join ', ', @types); >>my $select =

Re: [html-formfu] get_element problem

2008-10-31 Thread Carl Franks
2008/10/31 Dermot <[EMAIL PROTECTED]>: > Hi, > > I struggle with the get_element method and in the past have fallen > back on the get_all_elements method. Perhaps someone can spot where I > am going wrong. In the snippets below I always receive an "Can't call > method "options" on an undefined" val

[html-formfu] get_element problem

2008-10-31 Thread Dermot
Hi, I struggle with the get_element method and in the past have fallen back on the get_all_elements method. Perhaps someone can spot where I am going wrong. In the snippets below I always receive an "Can't call method "options" on an undefined" value error Is there something wrong with the snippe

Re: [html-formfu] 'default_empty_value' doesn't work

2008-10-31 Thread Juergen Mathwich
Am Freitag 31 Oktober 2008 10:23:29 schrieb Carl Franks: > 2008/10/31 Michele Beltrame <[EMAIL PROTECTED]>: > > Hi Juergen! > > > >> 3. add the suggested "default_if_unchecked" to formfu > > > > On secondo thought, this might not be a good idea. A checkbox, by > > definition, doesn't have a value i

Re: [html-formfu] 'default_empty_value' doesn't work

2008-10-31 Thread Carl Franks
2008/10/31 Michele Beltrame <[EMAIL PROTECTED]>: > Hi Juergen! > >> 3. add the suggested "default_if_unchecked" to formfu > > On secondo thought, this might not be a good idea. A checkbox, by > definition, doesn't have a value if unchecked. If you have a: > > > > it's either "1" or nothing at all

Re: [html-formfu] 'default_empty_value' doesn't work

2008-10-31 Thread Michele Beltrame
Hi Juergen! > 3. add the suggested "default_if_unchecked" to formfu On secondo thought, this might not be a good idea. A checkbox, by definition, doesn't have a value if unchecked. If you have a: it's either "1" or nothing at all (undefined). The "empty_if_unchecked" thing is useful for testin

Re: [html-formfu] 'default_empty_value' doesn't work

2008-10-31 Thread Juergen Mathwich
Am Freitag 31 Oktober 2008 09:47:39 schrieb Carl Franks: > 2008/10/31 Juergen Mathwich <[EMAIL PROTECTED]>: > > Hi Michele > > > > Thanks for your reply. > > > > I read following information from this thread > > http://lists.scsys.co.uk/pipermail/html-formfu/2008-August/001334.html > > > >> If you'

Re: [html-formfu] 'default_empty_value' doesn't work

2008-10-31 Thread Carl Franks
2008/10/31 Juergen Mathwich <[EMAIL PROTECTED]>: > Hi Michele > > Thanks for your reply. > > I read following information from this thread > http://lists.scsys.co.uk/pipermail/html-formfu/2008-August/001334.html > >> If you're using hand-rolled code to update the database - be aware >> that the bro

Re: [html-formfu] 'default_empty_value' doesn't work

2008-10-31 Thread Juergen Mathwich
Hi Michele Thanks for your reply. I read following information from this thread http://lists.scsys.co.uk/pipermail/html-formfu/2008-August/001334.html > If you're using hand-rolled code to update the database - be aware > that the browser doesn't send anything back for unchecked checkboxes - >

Re: [html-formfu] 'default_empty_value' doesn't work

2008-10-31 Thread Michele Beltrame
Hi Juergen! > shows me that it is empty, not 0 as expected: > > 'ACTIVE' => '', I think this is the expected behaviour: the field is empty as opposed to undefined. If you want it become 0 you could add a transformer to your checkboxes. Or, maybe, default_empty_value could b