John, thanks so much! I knew there had to be a simpler way. Ihad already
successfully created the drop downlist it was getting it populated without a
db look up that I was having an issue with. Now it is populating and
correctly saving everything to the database.

Still one issue however. I am now getting the following error shown in the
terminal window (I'm running linux) This is only a partial trace back:

File "/usr/lib/python2.5/site-packages/dabo/ui/uiwx/dControlItemMixin.py",
line 356, in _setStringValue
    raise ValueError(_("String must be present in the choices."))
ValueError: String must be present in the choices.

Any ideas?
This is also preventing the form from resetting itself.

####### Partial cdxml files created with Class Designer #######

<dDropdownList sizerInfo="{'RowSpan': 1, 'ColSpan': 1, 'HAlign': 'Left',
'ColExpand': True}" rowColPos="(5, 1)" Choices="[u&apos;None&apos;,
u&apos;AL&apos;, u&apos;TX&apos;, u&apos;WA&apos;]"
designerClass="controlMix" DataSource="clients"
DataField="stateprov"></dDropdownList>

####### End Partial cdxml files created with Class Designer #######

Nothing was written to the ClientForm-code.py file when I saved and closed
CD.
Should I have an onHit statement or something in this file?

Thanks again for helping me gain some ground.
Carey


On Tue, Jul 14, 2009 at 10:35 PM, John <[email protected]> wrote:

> On Tuesday 14 July 2009 05:32:22 pm Carey Gagnon wrote:
> > Ok....two days have passed and I still can't figure it out. I need a
> sample
> > to study.
> > What I am trying to do is take the step by step tutorial (
> > http://docs.google.com/Doc?id=dg79jzmg_3x78zkp) and create a form to add
> > new clients. I've gotten this far with success.
> >
> > Now what I want to do on the form is take the dTextBox for adding the
> state
> > and turn it into a dDropdownList for the states. I want to hard code this
> > NOT pull it in from the database.
> >
> > I've tried numerous things to no avail. I've tried the many pointer Larry
> > and Ed gave me and can only manage a drop down properly populated with
> the
> > hard coded values. But when I click the save button
> > everything is written to the database except for a value for the
> stateprov
> > field of the clients table.
> >
> > I guess I'm not under standing which of these tips go into which file.
> What
> > goes into my ClientForm-code.py and what goes into my ClientBizobj.py
> file?
> >
> > Prior to my previous statements, spoon feeding take me back to a warm
> fuzzy
> > place.
> >
> > Thanks in advance
> > Carey
> >
> > On Sun, Jul 12, 2009 at 8:35 PM, <[email protected]> wrote:
> > > Carey,
> > >
> > > Sorry, my carriage returns didn't go thru....
> > >
> > > statesdropdown = dabo.ui.dDropdownList(self,DataSource = ClientBizobj,
> > > DataField = "stateprov")
> > >
> > > choices = []
> > > keys = {}
> > > for location in locations:
> > >        choices.append("%s" % (location['state']))
> > >        keys[location["iid"]] = len(choices) - 1
> > >
> > > statesdropdown.Choices = choices
> > > statesdropdown.Keys = keys
> > > statesdropdown.ValueMode = "key"
> > >
> > > Larry
>
> I think I understand what you are attempting to do.  I assume Larry thought
> you were hand coding your form and not using ClassDesigner.
>
> First edit the form (the one you created following the step-by-step
> tutorial)
> in ClassDesigner.  Select the textbox next to the 'State:' label and delete
> the dTextBox.  Now replace the dTextBox with a dDropDown.  To get that done
> you right click on the empty spot and select a dDropDown (part of
> the 'Display Controls' list).  Now in the "object info"  window (recall you
> have the dDropDown selected) fill in the 'Choices' property with the values
> of the states by clicking on the 'Edit' button on the bottom
> ('CA','TX','WA' - note the commas).  Next fill in the "DataSource" property
> with 'clients' and "DataField" property with 'stateprov'.  That should work
> immediately.
>
> But there are other ways to get this done.  As you learn more you will be
> able
> create controls along with everything needed other ways.
>
> Feel free to ask more questions if you have trouble.
>
> Johnf
>
>
>
>
[excessive quoting removed by server]

_______________________________________________
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