Mike Mabey wrote:
> On Thu, Aug 21, 2008 at 5:34 PM, Paul McNett <[EMAIL PROTECTED]> wrote:
> 
>> Mike Mabey wrote:
>>
>>> I've looked through my code and made sure that I'm not setting the radio
>>> list's value anywhere, and I'm still getting that error.  In fact after
>>> cleaning up one section of code to be more Pythonic, I'm getting the
>> error
>>> two or three times before the app fully initializes:
>>>
>>> Dabo Error Log: Thu Aug 21 15:16:21 2008: No radio button matching '1'
>> was
>>> found.
>>> Dabo Error Log: Thu Aug 21 15:16:30 2008: No radio button matching '0'
>> was
>>> found.
>>>
>>> If it would help for me to post my .cdxml file and my *-code.py file, I
>>> will.
>> Actually, the answer is in the snippet you post below:
>>
>>> Here's the section of code for the radio list straight from the cdxml
>> file:
>>> <dRadioList code-ID="dRadioList-dPanel" sizerInfo="{'HAlign': 'Center'}"
>>> Orientation="Horizontal" Caption="Level" Value="1"
>> Choices="[&apos;1&apos;,
>>> &apos;2&apos;, &apos;3&apos;, &apos;4&apos;]" Width="125"
>>> designerClass="controlMix" DataField="level" RegID="LevelField"
>> Height="35"
>>> DataSource="categories"></dRadioList>
>>>
>>> This is the code as generated by the ClassDesigner.  I've tried changing
>>> &apos; to ' a few times with no change in behavior.
>> Here's the equivalent python that will help unravel the issue (actually,
>> Ed, please review, as I'm confused that some attributes seem to not
>> require embedded &apos; and others do. Specifically, is Value evaluated
>> to a string or an int?):
>>
>> class dRadioList-dPanel(dabo.ui.dRadioList):
>>   def initProperties(self):
>>     self.RegID = "LevelField"
>>     self.Caption = "Level"
>>     self.Orientation = "Horizontal"
>>      self.Choices = ["1", "2", "3", "4"]
>>      self.DataSource = "categories"
>>     self.DataField = "level"
>>     self.Width = 125
>>     self.Height = 35
>>     self.Value = 1
>>
>> Okay, all the controlitem classes such as dRadioList default to a
>> ValueMode of 'string'. This means that if you set radio.Value = "1"
>> given the above example, the first button (position of 0) should be
>> checked.
>>
>> However, you appear to be setting the Value to 1 (an int) and not "1" (a
>> string). I'm not sure if this is due to you or the Class Designer though.
>>
>> Can you try changing Value to "1"? Failing that, can you set ValueMode
>> to "position" and set Value to 0?
>>
> 
> 
> Actually, the snippet I posted already uses the code Value="1".  Just as an
> experiment, I tried taking the quotes off the one, but it wouldn't run, of
> course.  I also tried adding self.Value = "1" to the initProperties() method
> of the radio list, but I still get:
> 
> Dabo Error Log: Fri Aug 22 12:39:09 2008: No radio button matching '1' was
> found.
> Dabo Error Log: Fri Aug 22 12:39:10 2008: No radio button matching '0' was
> found.
> Dabo Error Log: Fri Aug 22 12:39:10 2008: No radio button matching '0' was
> found.
> 
> All three of which print before the app finishes initializing.  Just as an
> additional note, I have ValueMode set to "String" and took out the keys.  It
> just seemed silly to be using keys to reference strings that had the same
> value as their keys.
> 
> This is probably a vain attempt to scrape the bottom of the barrel, but do
> you have any other ideas?  It's so close to being finished!

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


_______________________________________________
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