On Thu, Aug 21, 2008 at 2:54 PM, Paul McNett <[EMAIL PROTECTED]> wrote:

> Mike Mabey wrote:
> >
> > Thanks, that explanation helps.  So, excuse my ignorance, but how would I
> > set a default value for the radio list?  Better yet, where is Dabo
> calling
> > whatever it is that is looking for a radio button matching '1'?  IOW,
> where
> > is this error coming from that I originally posted:
> >
> > Dabo Error Log: Thu Aug 21 14:09:27 2008: No radio button matching '1'
> was
> > found.
>
> You must be trying to set radiolist.Value = "1" somewhere. Or, the field
> in the table that is the source of the data has a value of "1" as the
> field. And perhaps that is happening before the Choices/Keys have been
> entered?



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.


Are you following my example or your example here? It matters because I
> don't know what your settings are for Choices, ValueMode, and (if
> ValueMode=="key") Keys.



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.


> Actually I really don't care about a default value, I just want this error
> > to go away.  The only thing I really care about as far as this radio list
> > goes is I'd like to keep the radio button value when the user creates a
> new
> > record, which I'm sure I can figure out how to do.
>
>
>
> If connected to a DataSource and DataField, the dRadioList will take the
> Value from the field in the table. So if you want a new record to have
> the same value as the prior record, then you'll need to override
> biz.afterSave() to accomplish that.
>
> If not connected to a DataField, then the dRadioList should keep the
> prior value passively.
>


Great.



> > My biggest concern is that this is the only error I'm getting when the
> app
> > runs, yet when it's running and I try to save the new record to the
> > database, the app says that the changes have been saved, when in reality
> > nothing has changed in the database and no new record was created.  Since
> > everything else seems to be working fine, this is my only lead as to what
> > the problem is.
>
> This likely isn't the problem. For now, take the dRadioList out of the
> picture entirely to make sure.
>
>
> > Sorry to shotgun the problem at you, I'm just getting a little frustrated
> > with this problem.
>
> I'm sure there's a good reason for your problems saving. So you do a
> form.new() and enter values, and then form.save() and nothing is saved?
> Is a blank new record saved?
>
>
Okay, so this was one thing I didn't know before.  I had just assumed that I
could leave all the controls empty and they would be ready to accept values
for a new record, since the app is strictly for adding new entries and not
editing or viewing, so the form never does a requery().  So I added
self.new() to the form's afterInitAll() method, and the new record now shows
up in the database after a save() in the app.

So at this point I've made good progress, and I've been able to get rid of
all errors except for the one listed above.

Thanks for your help,
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