On Fri, Aug 22, 2008 at 1:27 PM, Paul McNett <[EMAIL PROTECTED]> wrote:

> Mike Mabey wrote:
> > On Fri, Aug 22, 2008 at 1:10 PM, Paul McNett <[EMAIL PROTECTED]> wrote:
> >>
> >> In the radio list's afterInit(), tell me the return values of:
> >>
> >> print [(v, type(v)) for v in self.Choices]
> >> print self.Value, type(self.Value)
> >>
> >> Paul
> >>
> >
> >>From start to finish, this is what is printed to the console:
> >
> > Dabo Error Log: Fri Aug 22 13:14:40 2008: No radio button matching '1'
> was
> > found.
> > [('1', <type 'str'>), ('2', <type 'str'>), ('3', <type 'str'>), ('4',
> <type
> > 'str'>)]
> > 1 <type 'str'>
> > Dabo Error Log: Fri Aug 22 13:14:41 2008: No radio button matching '0'
> was
> > found.
> > Dabo Error Log: Fri Aug 22 13:14:41 2008: No radio button matching '0'
> was
> > found.
>
> Edit dabo/dabo/ui/uiwx/dRadioList.py, and insert lines 493 and 494 as
> follows:
>
>     491         if val is not None:
>     492           # No such string.
>     493           print val, type(val)
>     494           print [(v, type(v)) for v in self.Choices]
>     495           dabo.errorLog.write(_("No radio button matching '%s'
> was found.") % val)



Okay, this is what is printed:

1 <type 'int'>
[('1', <type 'str'>), ('2', <type 'str'>), ('3', <type 'str'>), ('4', <type
'str'>)]
Dabo Error Log: Fri Aug 22 13:39:27 2008: No radio button matching '1' was
found.
[('1', <type 'str'>), ('2', <type 'str'>), ('3', <type 'str'>), ('4', <type
'str'>)]
1 <type 'str'>
0 <type 'long'>
[('1', <type 'str'>), ('2', <type 'str'>), ('3', <type 'str'>), ('4', <type
'str'>)]
Dabo Error Log: Fri Aug 22 13:39:28 2008: No radio button matching '0' was
found.
0 <type 'long'>
[('1', <type 'str'>), ('2', <type 'str'>), ('3', <type 'str'>), ('4', <type
'str'>)]
Dabo Error Log: Fri Aug 22 13:39:29 2008: No radio button matching '0' was
found.

So, how would it be getting ints and floats as the val?



> The '0' is likely coming from your default value for the field in the
> bizobj. If '0' is a valid value in the database, the add it as a choice
> in the Choices. If it is not a valid value, then keep your bizobj from
> assigning the value of 0 by setting the field's DefaultValue.



I never added any code to set a default value anywhere.  I tried adding the
code that Uwe suggested:

self.DefaultValues['rlist'] = 1

in my bizobj code, but it gives me the error 'Compilation Error:No records
in the data set.' which is weird since I know there are records in the
table.


> Test to see by asking the bizobj:
>   print biz.getFieldVal(fieldname)
>

I'm not sure what you mean by this.  Where should I put that?

Thanks again,
Mike M.


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to